Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to conditionally add build settings?
Qt 6.11 is out! See what's new in the release blog

How to conditionally add build settings?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 884 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wodzu
    wrote on last edited by
    #1

    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.

    As above so below...

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Something like

      CONFIG(debug, debug|release) {
          message("debug")
      } else {
          message("release")
      }
      
      1 Reply Last reply
      3
      • W Offline
        W Offline
        Wodzu
        wrote on last edited by
        #3

        Thank you:)

        As above so below...

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved