Building a subdirs project
-
I have a project which is organzed as follows
project.pro:
TEMPLATE = subdirs
SUBDIRS =
lib
app
app.depends = liblib.pro
TARGET = MyLib
TEMPLATE = lib
CONFIG += staticlib
CONFIG += create_prl # Following http://qt-project.org/doc/qt-5/qmake-advanced-usage.htmlapp.pro:
TARGET = MyApp
TEMPLATE = app
CONFIG += link_prl # Following http://qt-project.org/doc/qt-5/qmake-advanced-usage.htmlProblem
If I make a change in the lib source, then I find that if I build the project (by pressing the hammer in QtCreator), then the changes do not actually show up in the program that runs. If I try to build by just pressing Run or Start Debugging, I get the same effect. MyApp is the only build target I can choose from the Computer icon in QtCreator. As a result I actually have to Rebuild (by right clicking on root node in the Project explorer tree), which takes ages every time, however small the change I make.
How can I get QtCreator to only build the small parts of my project where a change occurs?
-
I recently resolved a boatload of issues like this in my project, and I found that if you use the wizard to add an internal library, pointing to your dependent library, all of the necessary bookkeeping is done for you. I then took the resulting auto-generated code and created a .pri file. Then instead of using the wizard all the time, I just include the .pri file and all of the paths etc. are taken care of.