Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. .pro CONFIG: what to do with a third configuration?

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

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nibbio_notturno
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andrep
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nibbio_notturno
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved