How can I get qmake on Mac OS X?

83

8

I'm trying to install QtiPlot on Mac OS X, but I can't compile it since qmake isn't known. How can I install qmake on Mac OS X?

Fábio Perez

Posted 2011-03-11T12:37:14.733

Reputation: 1 544

Answers

127

Homebrew version

$ brew install qt

jabley

Posted 2011-03-11T12:37:14.733

Reputation: 1 466

4While qmake does exist in the Homebrew package, it doesn't appear to be symlinked by default anymore. Try brew link qt Or if that doesn't work: ln -s /usr/local/Cellar/qt/<QT_VERSION_HERE>/bin/qmake /usr/local/bin/qmake – TrinitronX – 2017-12-05T20:47:28.643

1If you need specific version of qt, for example 4.8.7_2: use brew switch qt 4.8.7_2. Make sure you add it to PATH: export PATH="/usr/local/opt/qt/bin:$PATH" – TrinitronX – 2017-12-05T20:53:06.057

I have installed qt with Homebrew but I didn't find Qt Maintenance Tool – user36582 – 2018-01-23T21:18:24.443

1@TrinitronX's suggestion is good to use brew link qt, but I had to use --force. Here's the whole command: brew link qt --force. To verify it worked, then run which qmake to print out the path to qmake. – kbpontius – 2019-11-06T16:29:58.967

@kbpontius: Thanks! I've updated the solution to add this information :-) – TrinitronX – 2019-11-06T22:50:44.903

5Better than MacPorts! – Fábio Perez – 2013-11-05T04:46:26.933

2If you get Error: Qt currently requires --HEAD on Mavericks, run brew install qt --HEAD (requires git). – Jace Browning – 2014-01-28T03:37:03.513

23

Just to elaborate for anyone who finds that after installing qt5, can't access qmake in the terminal.

Install QT5 using:

brew install qt5

Then to allow access qmake from the terminal you'll need to run:

brew link qt5 --force

elMarquis

Posted 2011-03-11T12:37:14.733

Reputation: 403

20

Just got it!

  1. Install MacPorts: http://www.macports.org/

  2. On Terminal: sudo port install qt4-mac

Then, I got qmake. You can install qtiplot directly by running: sudo port install qtiplot. Process takes about 3h.

Fábio Perez

Posted 2011-03-11T12:37:14.733

Reputation: 1 544

2

It appears that either updating the path, or manually symlinking qmake is now needed: http://stackoverflow.com/a/31318672/1959808

– Ioannis Filippidis – 2015-11-11T23:10:39.897

13

The official Qt installer, including qmake, is available from nokia at http://qt.nokia.com/downloads, but BE CAREFUL:

The so-called "SDK" download, which appears near the top of the page is not what you want. Maddeningly, qmake and other needed tools are available from the "Qt Libraries" download. Scroll down the page and find "Qt libraries". This gets me confused every time I install Qt on the Mac.

Christopher Bruns

Posted 2011-03-11T12:37:14.733

Reputation: 201

8

QMake is part of Qt since 3.0, earlier versions had tMake.

So, either look for tMake instead or install/upgrade your Qt to get QMake, good luck!

Tamara Wijsman

Posted 2011-03-11T12:37:14.733

Reputation: 54 163

I don't have Qt installed. I just want to install QtiPlot, but their documentation isn't intuitive. – Fábio Perez – 2011-03-11T12:46:31.370

You will need the Qt-devel and Qt-config and their dependencies in order to have QMake – Tamara Wijsman – 2011-03-11T12:48:45.020

Thanks, do you know any alternative to qmake? – Fábio Perez – 2011-03-11T13:01:40.733

2@FábioPerez: No, QtiPlot is written with the intent that QMake generates the Makefiles. – Tamara Wijsman – 2011-03-11T13:03:08.733

5

For installing Qt5 with brew, you can do

brew install qt5

Junv

Posted 2011-03-11T12:37:14.733

Reputation: 151

2Isn't this essentially the same as the accepted answer (wouldn't anyone doing the installation recognize a name change and understand to use the actual name of what they want to install)? – fixer1234 – 2014-11-16T05:27:26.043

1This gave me qt5 but not qmake. I only get qmake with brew install qt, but then it is the old version of qmake :( – Thomas Ahle – 2016-09-02T10:55:08.380

worked for me by also doing what suggested by elMarquis – Riccardo Cossu – 2016-12-09T10:25:57.260

Can't work out whether it's a synonym in Homebrew, but it does the same thing as brew install qt. Today's homebrew recipe doesn't symlink qtmake sadly. – paul_h – 2017-12-30T12:15:13.533

This absolutely includes qmake. See elMarquis's answer. – Flimbus Akimbo – 2018-09-21T18:25:54.437