How to use debug/release switch in *.pro?



  • How to use debug/release switch in *.pro?

    I have installed qt-4.8.6,worked with qt-creator2.7.0.

    I created a project, and I want to make it different between debug and release, such as:

    debug{

    config += APP_OUTPUT_DEBUG_LOG_ON
    

    }else{

    config+=APP_OUTPUT_DEBUG_LOG_OFF
    

    }

    but It seems no effect, Because it always performed the first swtich:
    ------ APP_OUTPUT_DEBUG_LOG_OFF.

    when i output the config value:
    message(config)

    It always contains both debug and release, perhaps this is the original reason.

    How can I fix this?



  • try
    CONFIG(debug, debug|release) {
    #debug settings here....
    }else{
    #release settings here....
    }



  • @Gerd

    It worked, Thank you very much!


Log in to reply
 

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