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. Help me understand this QMake condition

Help me understand this QMake condition

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 345 Views 1 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.
  • C Offline
    C Offline
    Curtwagner1984
    wrote on last edited by
    #1

    Hello,

    I ran into the following QMake condition:

    
    CONFIG(debug, debug|release){
            LIBS += -lqextserialportd
    } else{
            LIBS += -lqextserialport
    }
    
    

    What does that mean exactly, My guess is if the first condition is true, then go to the first line and if the second condition is true then go to the 'else' clause?

    But doesn't this mean that it will go to else clause because whether the build is debug or release the second condition is true?

    jsulmJ 1 Reply Last reply
    0
    • kkoehneK Offline
      kkoehneK Offline
      kkoehne
      Moderators
      wrote on last edited by
      #2

      See https://wiki.qt.io/Technical_FAQ#What_does_the_syntax_CONFIG.28debug.2Cdebug.7Crelease.29_mean_.3F_What_does_the_1st_argument_specify_and_similarly_what_is_the_2nd_.3F

      Director R&D, The Qt Company

      1 Reply Last reply
      2
      • C Curtwagner1984

        Hello,

        I ran into the following QMake condition:

        
        CONFIG(debug, debug|release){
                LIBS += -lqextserialportd
        } else{
                LIBS += -lqextserialport
        }
        
        

        What does that mean exactly, My guess is if the first condition is true, then go to the first line and if the second condition is true then go to the 'else' clause?

        But doesn't this mean that it will go to else clause because whether the build is debug or release the second condition is true?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Curtwagner1984 Else is executed in case of a release build, the first one is for debug build.
        The reason is that for debug build debug version of the qextserialport lib is used (did you notice this d at the end of lqextserialportd?).
        "But doesn't this mean that it will go to else clause because whether the build is debug or release the second condition is true?" - not sure what you mean. There are only two conditions here: release or debug.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        C 1 Reply Last reply
        0
        • jsulmJ jsulm

          @Curtwagner1984 Else is executed in case of a release build, the first one is for debug build.
          The reason is that for debug build debug version of the qextserialport lib is used (did you notice this d at the end of lqextserialportd?).
          "But doesn't this mean that it will go to else clause because whether the build is debug or release the second condition is true?" - not sure what you mean. There are only two conditions here: release or debug.

          C Offline
          C Offline
          Curtwagner1984
          wrote on last edited by
          #4

          @jsulm I thought debug|release means Debug or Release, so no matter what, it will always go to the second condition.

          @kkoehne
          Thank you for the link, it's very helpful.

          1 Reply Last reply
          0

          • Login

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