.pro CONFIG: what to do with a third configuration?



  • Hello,
    I've read a lot of things about CONFIG usage but I still don't understand.
    I have a project with three configurations: release, debug and "localRelease".
    I want to enable a debug gui in DEBUG configuration, and to disable it in the other cases.
    If I had only two configurations, DEBUG and RELEASE, I'd write:
    @
    CONFIG(release, debug|release) {
    #all release defines
    }

    CONFIG(debug, debug|release) {
    DEFINES += "WITH_GUI"
    }
    @

    and it would work, the gui would be enabled only when running the debug configuration.

    But what to do with my third configuration?
    I tried something like:

    @
    CONFIG(release, debug|release) {
    #all release defines
    }

    CONFIG(localRelease, debug|localRelease) {
    #all localRelease defines
    }

    CONFIG(debug, debug|release) {
    DEFINES += "WITH_GUI"
    }
    @

    ...but I always see the gui, even if in localRelease run.
    Could somebody help me solve my problem? Thank you all in advance.



  • It's really (and unfortunately) only debug, or release. You can have other flags by directly setting them (using QMAKE_* variables), or by modifying or using an alternative mkspec.



  • It seems to me very strange that one can't introduce a third configuration behaviour. Also because you can write something like

    @CONFIG += "localRelease"@

    in the .pro, so why can't you define a "localRelease" behaviour?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.