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. Adding projects to SUB_DIRS - order / selection of execution ?
QtWS25 Last Chance

Adding projects to SUB_DIRS - order / selection of execution ?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 2 Posters 349 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    As a test excise
    I have build new "subproject" and added as main project QWidgetApplication .
    Works as expected - runs and shows "main" window.

    Now I have added - as first subproject another QWidgetApplication .
    When run the newly added project executes and its window shows.

    At this point I am asking - what instructs the qmake(s) to actually select the project to run?

    The I have added several more SAME type of projects , last one being project "SUBDIR_A.

    In process of adding more subdirs project I managed to get the main , first added, project to ALWAYS execute.

    According to documentation SUBDIRS are "build" in order of dependency - if library is added it is build BEFORE project where it is used. ( I am not disputing that)

    From this exercise so far

    1. projects are added to subdir main project file in an alphabetical order
    2. there are no "TEMPLATE=app" in any of the added .pro files

    So the question is
    what determines which project out of several identical projects ( all have main.cpp)
    will be run?

    Here is my current main project file - and the SUBDISR_MAIN_PROJECT executes

    TEMPLATE = subdirs
    message(processing main project file )
    SUBDIRS += \
     #   SUBDIRS_FIRST_SUBPROJECT \
        SUBDIRS_A \
        SUBDIRS_MAIN_PROJECT \
        SUBDIRS_FIRST_SUBPROJECT \
        SUBDIRS_THIRD_project \
        SUNBIRS_SECOND_project
    
    CONFIG =ordered
    
    
    

    PS Adding CONFIG - expecting SUBDIRS_A to run - did not change - still executing SUBDIR_MAIN_PROJECT

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      qmake has nothing to do with which executable is run. It's in Qt Creator. Take a look at the computer icon that is just above the Run arrow. You can select there which project you will run from your sub-project.

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

      A 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        qmake has nothing to do with which executable is run. It's in Qt Creator. Take a look at the computer icon that is just above the Run arrow. You can select there which project you will run from your sub-project.

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        @SGaist I generally shy away from GUI , many because some of them are just poor and often incomplete copy / modification of CLI, and never payed attention to the strip of icons you are referring to. I use "Project" -> Run and when used in SUB_DIRS it apparently has no means to select the project. Will learn to live wit that.

        A 1 Reply Last reply
        0
        • A Anonymous_Banned275

          @SGaist I generally shy away from GUI , many because some of them are just poor and often incomplete copy / modification of CLI, and never payed attention to the strip of icons you are referring to. I use "Project" -> Run and when used in SUB_DIRS it apparently has no means to select the project. Will learn to live wit that.

          A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by Anonymous_Banned275
          #4

          I found this

          Creating Run Configurations for Subprojects

          To prevent Qt Creator from automatically creating run configurations for SUBDIRS projects, specify the following variable in the .pro file of the SUBDIRS project: CONFIG += qtc_runnable.

          Qt Creator creates run configurations only for subprojects that also have CONFIG += qtc_runnable set in their .pro files.

          However, after using the "big icon" adding CONFIG to both SUBDIR .pro and the project I want to run I still run the project selected by the icon.

          How do I "clear" the "icon" selection to test the CONFIG?

          ADDENDUM,
          let me say this - it somebody can point me to "purpose of the LEFT big icons" documentation I am game. It appears to be a "cute GUI" afterthought / replacement for "F1" help. ( There seems to be some relations to plain "options"... )

          I find it "interesting" how SUB_DIRS options are so scattered throughout Qt documentation. qmake docs covers how to setup sequence of its works , but one have to use "big icons" to find out how to actually select which SUB_DIRS project. to execute. There is something missing in philosophy of SUB_DIRS here.

          And in the process discovering "dependencies" .... ( next project - how to verify that these options are actually working ...)

          Personally - I would prefer all these "big icons " options to be part of the standard window style menu driven scheme.

          1 Reply Last reply
          0

          • Login

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