On OS X, what is the correct setup for $ QTDIR?

I am trying to install QtROOT and as part of the installation (in particular, the readme file in the QtROOT tar file at http://root.bnl.gov/QtRoot/downloads/qtFullRoot.tar.gz ), it mentions that QTDIR is installed. I installed the Qt 4.6.3 SDK installation for Mac OS X and I don’t have such an environment variable. I tried a google search to find out where it should be installed, but the options I found (e.g. / usr / local / qt) do not exist. Why should this variable be set?

OS X 10.6.4, Qt 4.6.3, ROOT 5.26 / 00, QtROOT ... I have no idea .: P

Thanks,

Floor

+4
source share
3 answers

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.

+7
source

I did not install Qt from the installer (but compiled it myself), so I do not know the default location.

However, when you installed Qt, there is your QTDIR. Find qmake, it should be in some bin / folder. one of them is QTDIR ($ QTDIR / bin / qmake). Usually you no longer need to install QTDIR these days to build a Qt project, just qmake should be in PATH, then everything else will be found. However, some projects may require it (if they use a custom build system that still uses QTDIR).

+1
source

I need to install LiteIDE on my Mac and in the installation guide, QTDIR is required. I install qt from homebrew on brew install qt --build-from-source , this takes about 2 hours in RMBP. After the installation is complete, the QTDIR path is still missing. By checking build_osx.sh , I only know this is the parent bin folder. so I set the path to export QTDIR=/usr/local/Cellar/qt/4.8.6 . Then run ./build_osx.sh again. it is working.

Hope this will be helpful.

+1
source

All Articles