Qt Creator CONFIG (debug, release) switches does NOT work
Posted
by
killdaclick
on Stack Overflow
See other posts from Stack Overflow
or by killdaclick
Published on 2013-10-24T09:51:56Z
Indexed on
2013/10/24
9:54 UTC
Read the original article
Hit count: 252
Problem: CONFIG(debug,debug|release) and CONFIG(release,deubg|release) are always evaluated wherever debug or release is choosen in Qt Creator 2.8.1 for Linux.
My configuration in Qt Creator application (stock - default for new project):
Projects->Build Settings->Debug Build Steps:
qmake build configuration: Debug
Effective qmake call: qmake2 proj.pro -r -spec linux-gnueabi-oe-g++ CONFIG+=debug
Projects->Build Settings->Release Build Steps:
qmake build configuration: Release
Effective qmake call: qmake2 proj.pro -r -spec linux-gnueabi-oe-g++
My configuration in proj.pro:
message(Variable CONFIG:)
message($$CONFIG)
CONFIG(debug,debug|release)
{
message(Debug build)
}
CONFIG(release,debug|release)
{
message(Release build)
}
Output on console for Debug:
Project MESSAGE: Variable CONFIG:
Project MESSAGE: lex yacc warn_on debug uic resources warn_on release incremental link_prl no_mocdepend release stl qt_no_framework debug console
Project MESSAGE: Debug build
Project MESSAGE: Release build
Output on console for Release:
Project MESSAGE: Variable CONFIG:
Project MESSAGE: lex yacc warn_on uic resources warn_on release incremental link_prl no_mocdepend release stl qt_no_framework console
Project MESSAGE: Debug build
Project MESSAGE: Release build
Under Windows 7 I didnt experienced any problem with such .pro configuration and it worked fine. I was desperate and modified .pro file:
CONFIG = test
message(Variable CONFIG:)
message($$CONFIG)
CONFIG(debug,debug|release)
{
message(Debug build)
}
CONFIG(release,debug|release)
{
message(Release build)
}
and I was suprised with the output:
Project MESSAGE: Variable CONFIG:
Project MESSAGE: test
Project MESSAGE: Debug build
Project MESSAGE: Release build
so even if I completly clean CONFIG variable it still see debug and release configuration.
What Im doing wrong?
© Stack Overflow or respective owner