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. In a subdir project, any way to only build the active subproject and its dependencies?
Forum Update on Monday, May 27th 2025

In a subdir project, any way to only build the active subproject and its dependencies?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
qt creatorsubdirssubproject
2 Posts 1 Posters 186 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.
  • G Offline
    G Offline
    Guy Gizmo
    wrote on 23 Dec 2024, 19:46 last edited by
    #1

    I have a subdirs project that looks like this:

    TEMPLATE = subdirs
    
    SUBDIRS += app foo bar lib
    
    app.subdir = app
    foo.subdir = foo
    bar.subdir = bar
    lib.subdir = lib
    
    app.depends = lib
    

    When the run configuration is set to app and I press Command+B (or Control+B if I'm on Windows), it will go through and run the build process for all four subprojects. And since they share a lot of source files, often there's quite a bit of compilation to do for either foo or bar. However I don't need the build results for foo or bar in order to run app, so the time spent trying to compile them, or even just analyze them to see if anything needs compiling, only delays me.

    So is there any way I can have Qt Creator only build what's necessary to run whichever subproject is selected as the run configuration, when I type the keyboard shortcut to build or run?

    I've found I can right-click one of the subprojects and tell just that to build, but a) that doesn't build any dependencies, and b) I haven't found any way to assign that to a keystroke.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      Guy Gizmo
      wrote on 30 Dec 2024, 17:49 last edited by
      #2

      I've figured it out: the trick is to use the menu item "Build for run configuration..." and assign that the Command+B keystroke.

      1 Reply Last reply
      2
      • G Guy Gizmo has marked this topic as solved on 30 Dec 2024, 17:49

      2/2

      30 Dec 2024, 17:49

      • Login

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