Problem: CONFIG (debug, debug | release) and CONFIG (release, deubg | release) are always evaluated wherever debugging or release is selected in Qt Creator 2.8.1 for Linux.
My configuration in Qt Creator application (availability is the default for a 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) }
Debug console output:
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
On Windows 7, I had no problems with this .pro configuration, and it worked fine. I was a 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 surprised by the output:
Project MESSAGE: Variable CONFIG: Project MESSAGE: test Project MESSAGE: Debug build Project MESSAGE: Release build
therefore, even if I completely clear the CONFIG variable, it still sees the debug and release configuration.
What am I doing wrong?
linux windows qt qt-creator
killdaclick
source share