Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. how to only run subprojects?

how to only run subprojects?

Scheduled Pinned Locked Moved Qt Creator and other tools
subdirs
7 Posts 3 Posters 5.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    T3STY
    wrote on 23 Mar 2015, 22:24 last edited by T3STY
    #1

    I have a created a subdirs huge project which is structured as follows:

    <MAIN_PROJECT>
    |---sources
    |---<subproject_1>
    |---<subproject_2>
    |---<subproject_3>
    |---<testunits>
        |---<test_1>
        |    |---sources
        |
        |---<test_2>
        |    |---sources
        |
        |---<test_3>
             |---sources
    

    There is the main project which is a subdirs project, followed by many app or lib projects, and then another subdirs project called testunits with its own app subprojects.
    The whole structure is configured properly and Qt Creator loads them perfectly.
    Building separately each subproject (especially testunits) works fine. But if I try to run a subproject, Qt Creator will try to run main project's exe, instead of the subproject exe only. When I try to run the built subproject exe it will also complain about missing DLLs (including some gcc runtime libs) so I can't run it unless I figure out all the DLLs it needs.

    Can I somehow tell Qt Creator to only run the subproject exe instead of the main one?
    Or am I using subdirs projects the wrong way? How should I configure such a project with testunits?
    I was looking for a way to configure each subproject (of the main project) with its own testunit subproject, but I haven't had much luck... any suggestions?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 23 Mar 2015, 22:42 last edited by
      #2

      Hi,

      AFAIK, it's possible to have each project having it's own unit tests subproject and calling them independently from Qt Creator. It might come from your pro files setup. How did you write them ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        T3STY
        wrote on 24 Mar 2015, 00:17 last edited by
        #3

        Please have a look at this project:
        https://drive.google.com/file/d/0B9uTCyb7q8yXdXdPNTAzd3RjbHc/view?usp=sharing
        sorry, I made it on the fly... I'm a bit tired and I don't have much time to properly make a runnable project with some not dummy code... however that is the exact same project structure I am using right now.

        As I said before, subprojects and testunits build fine, but if right-click one of them and choose "Run", Qt Creator will try to compile the main project and run its exe rather than simply running the testunit (or subproject) exe.

        Since it's not working as I expect it to, I suppose I am doing it the wrong way... is it you could give me an example project with testunits that can run on their own?

        1 Reply Last reply
        0
        • T Offline
          T Offline
          T3STY
          wrote on 27 Mar 2015, 11:21 last edited by
          #4

          Guys, sorry to bump... any suggestions, please?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mcosta
            wrote on 27 Mar 2015, 11:35 last edited by
            #5

            I have a BIG project with 10 executables and more than 100 TestExecutables.

            I manage in in Qt Creator using multiple build/run configurations

            Once your problem is solved don't forget to:

            • Mark the thread as SOLVED using the Topic Tool menu
            • Vote up the answer(s) that helped you to solve the issue

            You can embed images using (http://imgur.com/) or (http://postimage.org/)

            1 Reply Last reply
            0
            • T Offline
              T Offline
              T3STY
              wrote on 27 Mar 2015, 13:57 last edited by T3STY
              #6

              Finally! I've been able to properly configure a subdirs project in a way that I like!
              https://drive.google.com/file/d/0B9uTCyb7q8yXdDg5b21kSFBTY3c/view?usp=sharing
              if you could please have a look, I would gladly accept any suggestions for making it better (unlike the previous one, the project is fully runnable).
              Also, although it works fine like this, would it be possible to have testunits under the same sub_project that is to test? I mean having this kind of structure

              BIG_PROJECT
              --sub_project_1
              ----unit_sources
              ----testunit
              ------testunit_sources
              --sub_project_2
              ----unit_sources
              ----testunit
              ------testunit_sources
              
              1 Reply Last reply
              0
              • T Offline
                T Offline
                T3STY
                wrote on 27 Mar 2015, 16:28 last edited by T3STY
                #7

                I'm not sure if I should open a new thread or not, since it's related but not the same argument.

                Anyway, with the project structure above It works fine. But everytime I make a change in a file, and I run single subproject, Qt creator will actually recompile all the subprojects opened, even if I don't need the other units. This takes a lot more time than compiling a single unit and it's frustrating.

                How can I tell Qt Creator to compile a single "unit" instead of all the projects?
                EDIT
                Ok, so, it doesn't always compile all the units. It only does so when I Run the unit.
                But still, how can I stop it from doing that? My project is not very large now, but it will grow significantly in time... I can't imagine waiting for it to recompile 10 big units before I get a single run...

                1 Reply Last reply
                0

                6/7

                27 Mar 2015, 13:57

                • Login

                • Login or register to search.
                6 out of 7
                • First post
                  6/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved