问题:总是在Qt Creator 2.8.1 for
Linux中选择调试或发布的地方评估CONFIG(调试,调试|发布)和CONFIG(发布,发布|发布).
我在Qt Creator应用程序中的配置(库存 – 新项目的默认值):
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++
我在proj.pro中的配置:
message(Variable CONFIG:)
message($$CONFIG)
CONFIG(debug,debug|release)
{
message(Debug build)
}
CONFIG(release,debug|release)
{
message(Release build)
}
调试控制台上的输出:
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
在控制台上输出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
在Windows 7下,我没有遇到过这种.pro配置的任何问题,而且工作正常.
我是绝望和修改.pro文件:
CONFIG = test
message(Variable CONFIG:)
message($$CONFIG)
CONFIG(debug,debug|release)
{
message(Release build)
}
我对输出很惊讶:
Project MESSAGE: Variable CONFIG:
Project MESSAGE: test
Project MESSAGE: Debug build
Project MESSAGE: Release build
所以,即使我完全清理CONFIG变量,它仍然会看到调试和发布配置.
我做错了什么?