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. QMake. Legendary scope switch CONFIG(debug, debug|release)
Forum Updated to NodeBB v4.3 + New Features

QMake. Legendary scope switch CONFIG(debug, debug|release)

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 9.6k 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.
  • A Offline
    A Offline
    Algirdasss
    wrote on last edited by
    #1

    Hy,

    I and many other developers came to this point, when project debug and release versions must have some different config. In QMake docs everything seems very easy ... just use "debug { ... }" or "release { ... }" and you have what you want, but that that's not so easy if one is using QtCreator.

    For half of day I was searching for normal explanation in the internet what a heck these parameters mean in the config function: "CONFIG (debug, debug|release)" or "CONFIG (release, debug|release)". There is some info in QMake docs but it does not make much sense for me. What exactly the second parameters does??

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      Here's a little test .pro:
      @CONFIG(debug) {
      message(debug)
      }
      CONFIG(release) {
      message(release)
      }
      CONFIG(debug, debug|release) {
      message("debug, debug|release")
      }
      CONFIG(release, debug|release) {
      message("release, debug|release")
      }
      @

      With the outputs:
      @$ qmake
      Project MESSAGE: debug
      Project MESSAGE: release
      Project MESSAGE: debug, debug|release

      $ qmake CONFIG-=release CONFIG+=debug
      Project MESSAGE: debug
      Project MESSAGE: debug, debug|release

      $ qmake CONFIG-=release CONFIG-=debug

      $ qmake CONFIG+=release CONFIG-=debug
      Project MESSAGE: release
      Project MESSAGE: release, debug|release
      @
      The second parameter seems to be which configuration options to check for. If I change the last check into
      @CONFIG(release, debug|unrelease) {
      message("release, debug|release")
      }@

      @$ qmake CONFIG+= release CONFIG-=debug
      Project MESSAGE: release
      @

      If I change the check into
      @CONFIG(release, release) {
      message("release, debug|release")
      }@

      I get
      @$ qmake CONFIG+=release CONFIG+=debug
      Project MESSAGE: debug
      Project MESSAGE: release
      Project MESSAGE: debug, debug|release
      Project MESSAGE: release, debug|release
      @

      Besides specifying the items to check for, some seem to take precedence. I'm not all too sure how this is determined. Anyway, I hope this at least clarifies something.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      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