[Qt-creator] Where is QTDIR defined on OSX?

Danny Price deepblue842 at googlemail.com
Wed Feb 29 23:54:22 CET 2012

OK this is driving me nuts.

I did a clean install of the SDK with Qt 4.8 and unchecked the 'Desktop' install of Qt so that I could build it myself. I set the prefix to a directory local to he SDK instead of /usr/local/whatever.

I have no .profile file in the home dir and no environment variables set in  ~/.MacOSX/environment.plist. Typing export into Terminal, there are no Qt variables and the other variables must be coming from /etc/

There are no settings for Nokia under ~/.config (yes it took a while to figure this all out on OSX!).

Now I fire up Creator and in preferences there is no Qt version listed under 'Auto-Detected'. Cool. I use the Add button to point it at my custom Qt 4.8 build.

I note that a qtversion.xml file has appeared under ~/.config/Nokia containing my custom Qt path.

Now I drag in a test project .pro file (no make files, no pro.user) and Creator builds the make files. I switch to the Project screen and low and behold, QTDIR is listed in the System Environment! I can even output the contents in the pro.file during the build as though it were any other env variable.

So WHERE is this magic variable coming from in the above scenario? It cannot be defined within QtCreator because I can build the project directly with the make file via Terminal (because on the Mac, terminal tools gets their variables from the profile and /etc/). Nor is there any sign of it in the makefile or in any of the other Mac environment variable hideouts that I know of.

WHERE is this variable coming from?!!

More information about the Qt-creator mailing list