The Qt-packed installer for OSX scatters all the / Developer and / Library directories instead of installing it in a standalone location in / usr / local or / opt / local, as you might expect it to work on other unix based systems.
By the way, Qt follows Apple in doing something in this regard, so it really is not - it is completely different - but it makes some third-party Qt applications a little more difficult to build on OSX.
The following items may be included with the Qt Embedded Installer:
After a successful installation, you can find the latest things in / Developer. In particular, things will be located in the following places:
- Qt Designer, Qt Linguist: / Developer / Applications / Qt
- Qt Documentation: / Developer / Documentation / Qt
- Qt Examples: / Developer / Examples / Qt
- Qt Plugins: / Developer / Applications / Qt / Plugins
- Qt Frameworks: / Library / Frameworks
- Qt Libraries: / usr / lib
- qmake, moc, uic, etc.: / Developer / Tools / Qt (symbolic link to / usr / bin)
- Delete script: /Developer/Tools/uninstall-qt.py
So, it puts libs in '/ usr / lib', and it symbolizes the basic Qt tools (e.g. qmake) in '/ usr / bin'. This suggests that QTDIR can be set to '/ usr'. In practice, however, this does not work because qt headers remain in "/Library/Frameworks/Qt*/Headers/*.h", and assemblies that rely on $ QTDIR will look for qt headers in "$ {QTDIR} / include / ".
The easiest way to get around this is to build Qt from the source. The default installation location will be /usr/local/Trolltech/Qt-4.6.3 (pay attention to the version number and configure accordingly). You can override the default installation location using the -prefix option on ./configure .
A simpler approach is to let macports build it for you. This is the approach I got (and with great success). Just install macports if you don't already have one. Then:
> sudo port selfupdate > sudo port install qt4-mac
Macports will work with its magic, and when this is done, Qt will be fully installed in /opt/local/libexec/qt4-mac .
Regardless of how you build Qt, expect a complete build to take several hours. This is a very large code base.