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 Updated to NodeBB v4.3 + New Features

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 315 Views 1 Watching
  • 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.
  • Guy GizmoG Offline
    Guy GizmoG Offline
    Guy Gizmo
    wrote on 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
    • Guy GizmoG Offline
      Guy GizmoG Offline
      Guy Gizmo
      wrote on 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
      • Guy GizmoG Guy Gizmo has marked this topic as solved on

      • Login

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