How to conditionally add build settings?



  • Hi,

    I've tried to find solution on a forum but couldn't. I would like to add some build settings depending if I am building my program in debug or release mode, how to do that? For example:

    I have this setting:

    win32: LIBS += -L$$PWD/../../C++/Libs/MyLibrary/x64/ -lMyLibrary_x64_v141_Debug
    

    So I am statically linking a .lib which is in debug mode. How to link against different version of this library if I am building in release mode?

    Another case, I have a conditional define which I would like to only use in Debug build:

    DEFINES += WG_DEBUG_OBJECT
    

    Thanks for your help.


  • Qt Champions 2017

    Hi
    Something like

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


  • Thank you:)


Log in to reply
 

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