I'm working in a similar issue though I didn't use Qt Creator.
I have a library stored in one path in Subversion. It's currently being brought into to my project via SVN's externals - but that's beside the point here. Needless to say, it's a shared set of static libraries that multiple applications will be using. Each project it gets brought into needs to ensure that it (or its respective subprojects) get built before the project itself is built. The structure is basically as follows
application\
application.pro
application.sln
application.vcproj
deps\
lib\
lib.debug\
include\
src\
src.pro
<subproject>\
<subproject>.pro
<subproject files>
application\
application.pro
application.sln
application.vcproj
deps\
lib\
lib.debug\
include\
src\
src.pro
<subproject>\
<subproject>.pro
<subproject files>
To copy to clipboard, switch view to plain text mode
The src.pro uses the 'subdirs' template, and each project under it puts its output (static library and PRL file) into lib or lib.debug (for release and debug builds respectively). I find this works very well as then the application only has to know about one (or two) places for linking.
I do, however, have the same problem - I want the application to be able to build the static libraries it needs by simply adding something to the application's project file (e.g. application.pro). Thus far I have tried:
include (deps/src/src.pro)
include (deps/src/src.pro)
To copy to clipboard, switch view to plain text mode
However, that doesn't seem to work and I have to manually run the library build before the applications build. This is complicated by having to support both VS and Qmake/Make (under Linux).
Further, I have numerous static libraries being generated and it'd be nice to be able to only build what I actually need and use.
Per working directly Qt via Visual Studios, I found the following to be helpful to run from a 'build' directory in parallel to the 'src' directory for the shared libraries:
$ qmake -tp vc -r ../src/src.pro
$ qmake -tp vc -r ../src/src.pro
To copy to clipboard, switch view to plain text mode
This generates the required solutions and project files, but requires that anyone modifying the qmake project files also update the solutions/projects by re-running this command when they're done and committing the results into source control. Fortunately it can be run on Windows _or_ other systems (e.g. Linux) (Okay for now, but not good as a long term solution.)
As the OP stated - we need to be able to build the dependency. Using the SUBDIR template for the application doesn't seem like a solution - since it would require an entirely different application source layout that just doesn't make sense for the project - I don't need two directories for what could be accomplished in one.
Scripting is problematic as there would have to be a script for Windows and a script for everything else.
I think QMake could easily resolve this solution - whether it already does (if so how?) or by modification to do so. Something like the include solution would be great.
In reading through the docs, the 'features' solution sounds like a good possibility, but it doesn't seem like Qt supports having features in sub-projects in this manner.
Bookmarks