PDA

View Full Version : where is Qt and qmake installed



timmu
8th August 2012, 15:24
I installed Qt on Mac from binary package. I don't know where it was installed (what folder) and where qmake is. How would I find out where it was installed? I'm new to Mac.

Thanks

myta212
9th August 2012, 06:25
Hi,
The simple method is you can search file qmake in your computer.

Best regards,

myta

spirit
9th August 2012, 06:57
I installed Qt on Mac from binary package. I don't know where it was installed (what folder) and where qmake is. How would I find out where it was installed? I'm new to Mac.

Thanks
If you used QtSDK then it should be in ~/QtSDK/Desktop/<qt.version>/<compilerversion>/bin.
If you built it and ran sudo make install then it should be in /usr/local/Trolltech/<qt.version>/bin.

timmu
9th August 2012, 08:26
Thank you very much for your answers.

Is it true that if Qt is correctly installed on Mac then if you go to the terminal and type "qmake", then it should recognize the command. And typing "qmake -query" should show where it was installed (what folder). This is not happening in my case.

Provided that Qt is installed in ~/QtSDK/Desktop/<qt.version>/<compilerversion>/bin as Spirit wrote above, how would I use qmake in that case? Do I need to navigate into the correct folder, put the source code in there and then use qmake through terminal to compile?

Thanks!

spirit
9th August 2012, 08:43
Well, if you use QtCreator from QtSDK then you don't need to do anything. QtCreator will find qmake by itself. But if you need to add additional Qt version then you should go to QtCreator's preferences (cmd + ,), navigate to "Build & Run", select "Qt Versions" tab. Here you can simply add any new versions.

If you need to use qmake in the console then you have to export path to the qmake into PATH system variable like this:


export QTDIR=<path_to_qt_folder>
export PATH=$QTDIR/bin:$PATH

After that you can simply use qmake in any project's folder to build it.

Optionally: You'd also, probably, need to install XCode's command line tools to use make and other comman-line tools, but it's only for XCode 4.3 and higher.

timmu
9th August 2012, 09:05
Thank you, Spirit!

I need to use console only, no QtSDK.
How do I export path to the qmake into PATH system? You sent me the commands but where do I type these (what file should I create or modify and where)?

So you are saying that installing Qt from Nokia website is not enough for executing this:

qmake -project
qmake
make

and I need something called XCode? Is that true even if I use the most basic compilation only (as shown above)?

Thanks!

spirit
9th August 2012, 09:17
1. Downloaded latest XCode from here (https://developer.apple.com/xcode/). (Of course if you don't have it).
1.1. Note this step can be skipped if you're using XCode < 4.3..
Open newly installed XCode, go to preferences (cmd + ,) -> "Downloads" and install "Command Line Tools". After these steps you will be able to use gcc, make etc.
2. Open terminal and export variables, type:


export QTDIR=<path_to_qt_folder>
export PATH=$QTDIR/bin:$PATH

NOTE: export of these variables must be done for each new terminal tab. There are to options: make a script which will export these variables and then you have to run it each time you open the terminal. Or add exporting of these vars in you profile.

As to your question:


and I need something called XCode? Is that true even if I use the most basic compilation only (as shown above)?


Yes, you need it, because it contains all necessary development stuff.

timmu
9th August 2012, 09:40
Thank you Spirit! Things are getting much more clear to me. I still have more questions if you don't mind.

1. Instead of exporting the variables every time, I'd like to make changes in my profile to do that. Do you have instructions for that?

2. How do you check if my computer already has XCode installed (and what version)?

Thanks!

spirit
9th August 2012, 09:46
Thank you Spirit! Things are getting much more clear to me. I still have more questions if you don't mind.

1. Instead of exporting the variables every time, I'd like to make changes in my profile to do that. Do you have instructions for that?


Add them to ~/.bash_profile



2. How do you check if my computer already has XCode installed (and what version)?

Thanks!

It should be in Applications (/Applications/XCode).

timmu
9th August 2012, 10:48
Hi Spirit!

Thanks. Last question (I hope):

Where is "bash_profile" located?

Thanks!

spirit
9th August 2012, 10:50
In your home (~) folder. If it doesn't exist you should create it.