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

后端 未结 2 1518
无人共我
无人共我 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.

提交回复
热议问题