Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED]Qmake include file advice
QtWS25 Last Chance

[SOLVED]Qmake include file advice

Scheduled Pinned Locked Moved Qt Creator and other tools
includeqmake
3 Posts 2 Posters 1.0k Views
  • 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.
  • Paul H.P Offline
    Paul H.P Offline
    Paul H.
    wrote on last edited by Paul H.
    #1

    Hello,
    i have a .pri file to set up library and include paths for a 3rd-party library. I am looking for a good way to determine the compiler being used. Right now I am only concerned about 2 versions of MSVC (2010, 2013), so the following code works for me:

        # Check which toolchain is being used
        test = $$(QTDIR)
        test2 = $$find(test, 2010)
        !isEmpty(test2) {
            compiler=vc10
            message($$compiler)
        }
        else {
            test2 = $$find(test, 2013)
            !isEmpty(test2) {
                compiler=vc12
                message($$compiler)
            }
        }
    

    Is there a better way to get this information? Perhaps an internal variable that I can check? Like I said, this works, but I wanted to see if anyone has a better way.
    Thank you.
    Paul

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

      Hi,

      IIRC you can use scopes for that

      win32-msvc2010 {
      // Visual Studio specific stuff
      }
      

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • Paul H.P Offline
        Paul H.P Offline
        Paul H.
        wrote on last edited by
        #3

        Thank you! That did the trick.
        Paul

        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