I\'ve been using Qt Creator for a while now and my project is getting large enough that I\'d like to move to using Qt\'s SUBDIRS template type to better organize my growing
Not all of my projects ready to run the code, how can I select one project to run, having subdir root project?
You can maintain several TEMPLATE = app projects to start parts of your code, say, unit tests for selected libraries as well as the entire app GUI starter. And try to isolate as much of shared code possible in TEMPLATE = lib types of projects. Whether the lib type of project needs to be a static library or dynamic with DEFINES += SHAREDLIB_LIBRARY is another question and the answer depends on how you distribute the app. I maintain my current subdir project with many dynamic libraries to prevent them being linked to executable all the time due to memory restrictions.
Open 'Projects' menu and make sure that Run Configuration points to your application project that contains main function and has:
# app.pro file contains
TEMPLATE = app
and also
# unit_test1.pro file contains
TEMPLATE = app
If some of your projects won't compile, exclude it from subdirs project:
TEMPLATE = subdirs
SUBDIRS = lib unit-test
# SUBDIRS = lib unit-test app # app not ready
# app.depends = lib # may exclude dependcies
unit-test.depends = lib
Mind 'Run configuration' choice of started projects below:
P.S. Don't forget to run qmake after project file changed.