CurrentBuild:Type



  • Hi!

    I have a common.pri configuration file that, among other things, defines the output directories.

    I would like to generate a different path for debug and release products, say .../products/debug/bin and ...products/release/bin.

    I found the CurrentBuild:Type variable, but when I can not use to use in my common.pri. I tried a simple message("CurrentBuild:Type = "%{CurrentBuild:Type}), but I got Project MESSAGE: CurrentBuild:Type = %{CurrentBuild:Type}

    So, how can I use %{CurrentBuild:Type} in my common.pri file? Or, is there another way to know the "name"/string/identifier of the mode (debug or release) it is being used?

    Thanks!


  • Moderators

    That's the usual way to detect mode:

    CONFIG(debug, debug|release) {
        message("This is debug mode or debug_and_release")
    } else {
        message("This is release mode or debug_and_release")
    }
    


  • @sierdzio

    Thanks!


Log in to reply
 

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