Fixing Qt errors in MacPorts

How to fix `Qt qmake not found!` errors when installing a MacPorts package.

Abbreviated version of `Qt make` error from MacPortsI’ve run into this or similar errors before when trying to install a new package via MacPorts on OS X, and I wasn’t sure how to approach it: there are many MacPorts bug reports on individual packages, which, after finding a fix, I think are probably inappropriate for those packages.

In my case, the error occurred most recently while trying to install the `lmms` port of the Linux Multimedia Studio package:

:info:configure CMake Error at /opt/local/share/cmake-2.8/Modules/FindQt4.cmake:1150 (MESSAGE):
 :info:configure   Qt qmake not found!
 :info:configure Call Stack (most recent call first):
 :info:configure   CMakeLists.txt:90 (FIND_PACKAGE)
 :info:configure -- Configuring incomplete, errors occurred!
 :info:configure shell command " cd "/opt/local/var/macports/build/    
  _release_ports_multimedia_lmms/work/lmms-0.4.8" && cmake -DCMAKE_INSTALL_PREFIX=/opt/local -DCMAKE_VERBOSE_MAKEFILE=    
  =/opt/local/lib -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_MODULE_PATH=/opt/local/share/cmake/modules -Wno    
 :error:configure Target org.macports.configure returned: configure failure: shell command failed (see log for detail    s)

The solution is surprisingly simple (given that you already have Apple’s Xcode installed), and it’s to first install another port called Qt Assistant, which fixes backwards compatability problems with some ports and newer versions of Qt:

sudo port install qt-assistant

Once I did this, and then cleaned my target lmms port directory of any possible problems:

sudo port clean lmms

… I was able to install the lmms port successfully.

sudo port install lmms

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s