How to set different qmake configuration depending on debug / release?

后端 未结 2 1519
无人共我
无人共我 2021-02-13 05:14

I need to specify different output and intermediate folders in my .pro file for debug and release builds. I created a following test .pro file:

release {
  messa         


        
相关标签:
2条回答
  • 2021-02-13 05:22

    Try:

    CONFIG(debug, debug|release){
    message("debug")
    } else {
    message("release")
    }
    

    the qmake will display "debug" if you are building your project in a debug or debug|release mode, otherwise (i.e.: if you are building it in a release mode) a "release" message will be shown.

    0 讨论(0)
  • 2021-02-13 05:39

    According to the qmake manual:

    CONFIG(release, debug|release) {
      message( "release" )
    }
    CONFIG(debug, debug|release) {
      message( "debug" )
    }
    

    I don't really get the explanation, though. It seems that both of the options are really selected, and only one of them is "active". But qmake is famous for counter-intuitive things.

    0 讨论(0)
提交回复
热议问题