Sure.
qmake Code:
debug_basic { # ... } release_basic { # ... }To copy to clipboard, switch view to plain text mode
And then call qmake CONFIG+=debug_basic.
Sure.
qmake Code:
debug_basic { # ... } release_basic { # ... }To copy to clipboard, switch view to plain text mode
And then call qmake CONFIG+=debug_basic.
DasHannes (10th October 2011)
With your suggestion, i would have to call qmake to generate a separate vcproj file for each configuration, is that correct?
What i was hoping to achieve is calling qmake once, and then having
- on a windows machine one .vcproj with 6 different build configurations
- on a mac one xcode project with 6 different build configurations
- on a linux box: a Makefile with 6 different targets
Is that possible?
I have no idea, very unlikely. Even for debug and release you have two separate Makefiles on Windows and Linux. When using Makefiles you could have one (manually written or autogenerated) Makefile contain references to all other makefiles but for other generators, I doubt it.
This may be a little late coming, but for completeness I'll share the best answer I was able to come up with.
I've resorted to using the following QMake conditions:
CONFIG(DebugBuild):message(">>>> Debug build")
CONFIG(ReleaseBuild):message(">>>> Release build")
These values are present both within Visual Studio and QtCreator using the Visual Studio compiler tool chain. "Debug" and "Release" with leading capitals may also work.
Unfortunately it looks like these CONFIG values are not present on other platforms (I tried OSX, under QtCreator). For non-Visual Studio platforms you may be able to find something usable by printing the CONFIG variable value, like so:
message("CONFIG: $${CONFIG}")
Bookmarks