Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add preprocessor definition only for Release build in Qt Creator

I want to define QT_NO_DEBUG_OUTPUT for Release build, but I couldn't find where to add it.

I need the preprocessor definition to be Release-specific, i.e. it should affect the Release build, but not the Debug build.

I'm looking for the equivalent of this (it's in Visual Studio):

enter image description here

like image 842
sashoalm Avatar asked Nov 24 '12 07:11

sashoalm


1 Answers

In your project file:

CONFIG(release, debug|release) {
    #This is a release build
    DEFINES += QT_NO_DEBUG_OUTPUT
} else {
    #This is a debug build
}

Note that CONFIG can contain both "release" as well as "debug". Only the last is effective, which is what the above check does. This is explained here:

http://doc.qt.digia.com/qt/qmake-function-reference.html#config-config

like image 62
Nikos C. Avatar answered Sep 29 '22 17:09

Nikos C.