[Qt-creator] qmake does not pick the right build configuration

Lincoln Ramsay lincoln.ramsay at nokia.com
Tue May 15 02:55:49 CEST 2012


The CONFIG(<term>, <condition>) function helps when checking for 
mutually-exclusive CONFIG values. CONFIG is (like other qmake variables) 
just a list so it does not handle removing terms that are 
mutually-exclusive.

ie.
CONFIG = debug
CONFIG += release # debug release
CONFIG += debug # debug release debug
CONFIG -= debug # release

So you can't just do:
     release {
         # something
     }
     debug {
         # something
     }
unless it's ok to do into both of those conditionals.

The CONFIG(<term>, <condition>) function call will look for the last 
word in the CONFIG variable matching <condition> and will return true if 
it is <term>.

CONFIG = debug
CONFIG(debug, debug|release) # true
CONFIG += release
CONFIG(debug, debug|release) # false
CONFIG += debug
CONFIG(debug, debug|release) # true
CONFIG -= debug
CONFIG(debug, debug|release) # false


-- 
Lincoln Ramsay - Senior Software Engineer
Qt Development Frameworks, Nokia - http://qt.nokia.com/



More information about the Qt-creator mailing list