Important: Please read the Qt Code of Conduct -

Using OSX environement variables in a .pro file [SOLVED]

  • I have Qt on my laptop and desktop. I have a library I had to move from one drive to another on my desktop. Now, my .pro file can't find the library unless I manually change the library path between my Desktop and laptop.

    Currently my .pro file is like this:

    @DEFINES += OSMac_
    INCLUDEPATH += $$MAYALOCATION/devkit/include@

    What I would rather have is to have MAYALOCATION be defined by an environment variable on my system. I just don't know how to access environment variables in the .pro file

    This is a basic problem I'm sure. But it doesn't change the fact I can't do what I need to do until I figure it out!

  • This worked. I made a environment variables called MAYAROOT with the appropriate path for the laptop and desktop. I changed the code above to this and everything worked:

    @DEFINES += OSMac_
    INCLUDEPATH += $$MAYAROOT/devkit/include@

Log in to reply