TemporalBeing
24th March 2009, 19:45
I have a structure like follows:
include
src
src/src.pro
src/<project>/<project stuff>
src/<project group>/<project>/<project stuff>
lib
lib.debug
I essentially have a number of widgets/objects/etc that I'd like to bundle into a series of static libraries for other projects to link against. I'd also like this to be centralized so the developer only has to do 'qmake && make' once and all the projects (or a sub-set thereof) get built and put into the 'lib' (for release) and 'lib.debug' (for debug) as needed. Then the main application can just search that one location during its link for its required libraries that I am providing.
I discovered the 'subdirs' template and it works very well, for the most part - allowing me to have a single point to compile the various projects. (cool). However, I am having some trouble with the release/debug side of doing the build.
I added the following to one of the sub-projects:
CONFIG += debug_and_release
CONFIG(debug,debug|release) {
DESTDIR = ../../lib.debug
} else {
DESTDIR = ../../lib
}
However, when I ran 'qmake && make' it only put binaries in the 'lib' folder - not the 'lib.debug' folder. I also could not do a 'make debug' or 'make release' at the parent (e.g. where src.pro is located). Is there any way to correct this? I am new to do all of this in qmake this way. (I have previously written scripts to manage VC++ projects in a lot more complicated manner that retrieved and built dependencies; but new to doing this part in Qt.)
Also, if possible, I'd rather have a line like:
DESTDIR = ${baseDir}/lib
instead of
DESTDIR = ../../lib
as I may have different depths involved and it would make building/modifying each project's pro file a lot simpler. Is there any variable I can use in this manner?
include
src
src/src.pro
src/<project>/<project stuff>
src/<project group>/<project>/<project stuff>
lib
lib.debug
I essentially have a number of widgets/objects/etc that I'd like to bundle into a series of static libraries for other projects to link against. I'd also like this to be centralized so the developer only has to do 'qmake && make' once and all the projects (or a sub-set thereof) get built and put into the 'lib' (for release) and 'lib.debug' (for debug) as needed. Then the main application can just search that one location during its link for its required libraries that I am providing.
I discovered the 'subdirs' template and it works very well, for the most part - allowing me to have a single point to compile the various projects. (cool). However, I am having some trouble with the release/debug side of doing the build.
I added the following to one of the sub-projects:
CONFIG += debug_and_release
CONFIG(debug,debug|release) {
DESTDIR = ../../lib.debug
} else {
DESTDIR = ../../lib
}
However, when I ran 'qmake && make' it only put binaries in the 'lib' folder - not the 'lib.debug' folder. I also could not do a 'make debug' or 'make release' at the parent (e.g. where src.pro is located). Is there any way to correct this? I am new to do all of this in qmake this way. (I have previously written scripts to manage VC++ projects in a lot more complicated manner that retrieved and built dependencies; but new to doing this part in Qt.)
Also, if possible, I'd rather have a line like:
DESTDIR = ${baseDir}/lib
instead of
DESTDIR = ../../lib
as I may have different depths involved and it would make building/modifying each project's pro file a lot simpler. Is there any variable I can use in this manner?