[Qt-creator] qmake debug release conditional builds

Andre Poenitz andre.poenitz at mathematik.tu-chemnitz.de
Sun Nov 8 15:53:50 CET 2009


On Sun, Nov 08, 2009 at 11:29:18PM +0000, paulo wrote:
> Hi all,
>
> there's been a few threads about conditional release debug build problems.
> I myself wrote one a while ago, but with no success.
>
> Anyone can try something like this:
>
>
> debug {
>
> release {
>
> error("release set with debug!")
>
> }
>
> TARGET = app.bin
>
> } else {
>
> TARGET = app.dbg
>
> }
>
>
> This is a bit annoying. Apparently due to a bit of mess in the loaded  
> config files, or some problem in qtcreator, both debug and release flags  
> are set at the same time...

Don't use 'debug' and 'release' scopes. It's almost never what you need.
Instead use:

CONFIG(debug, debug|release) {
	# That is the "debug" branch
	TARGET = app.dbg
} else {
	# That is the "release" branch
	TARGET = app.bin
}

Andre'




More information about the Qt-creator-old mailing list