Search code examples
c++qtqmake

what is the meaning of qmake config


In my .pro file , I have found this snippet:

 win32 {
        CONFIG(debug, debug|release) {

            LIBS += $$(QwtDir)/lib/qwtd.lib\
                    version.lib

            } else {

            LIBS += $$(QwtDir)/lib/qwt.lib\
                    version.lib
        }

I looked at the documentation of qmake and it said you can use CONFIG as a conditional statement, and they gave an example of CONFIG(debug) , which means if in debugging mode, but what about CONFIG(debug, debug|release)? what does it mean?


Solution

  • When qmake processes a pro file it could process it up to three times depending on what the configuration is set to. Usually it will do it three times. Once for debug, once for release and one final one for debug_and_release

    ...this construct CONFIG(debug, debug|release) ... checks for when the debug configuration is being processed comparing where “debug” and “release” are mutually exclusive.

    This is taken from the detailed explanation here.