[SOLVED]Qmake include file advice



  • 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


  • Lifetime Qt Champion

    Hi,

    IIRC you can use scopes for that

    win32-msvc2010 {
    // Visual Studio specific stuff
    }
    


  • Thank you! That did the trick.
    Paul


Log in to reply
 

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