PDA

View Full Version : Qt on Mac still possible?



auba
14th May 2009, 23:58
I just installed the latest Qt SDK on my new MacBook Pro... and everything is under /Development :confused:

Ok, I thought, just get it right, write down a small script and create some smart links to get my QTDIR (ln -s to map all needed tools to qt451/bin).

But starting qmake on my pro files only generates xcode project files. Isn't it possible anymore to start make on the command line?

wysota
15th May 2009, 01:11
Nothing has changed. You need to tell qmake that your default working environment is gcc not xcode. You can do it either every time you run qmake by specifying the "-spec" switch with the appropriate parameter or do it in a global way, either by changing the link "default" in the mkspecs directory if it's supported on your system or by modifying the QMAKESPEC environment variable.

auba
15th May 2009, 10:52
woaa... how stupid. Sorry to ask such a question at all :rolleyes:

Mmmh... but is there a way to get the old QTDIR way back? Install everything in ~/sources/qtXXX to have different versions installed? Even on win32, the installation path seems to be hardwired in alle .exe/.dll files. So I wonder if this will be possible anymore...

wysota
15th May 2009, 12:09
The best way is to have different qmake executables which are hardwired to different installations (which is the default). An alternative is to handle it through the QMAKESPEC variable but this is a straight path to problems.

auba
15th May 2009, 12:15
Yes ok, but I wonder how the Trolls want to manage that? The SDK installs in /Develop... no way to have different qmake's :confused: On win32/linux I can setup a directory, which seems much more comfortable to me

wysota
15th May 2009, 13:37
Manage what exactly?

auba
15th May 2009, 13:44
Well, to have more than one version of a qt environment on a Mac. Yes, you may have a /Develop/Programs/Qt3 (or Qt5, who knows), but you cannot easily switch between two of them as you have more than one directory (/Develop/Tools/Qt3 and so on).

wysota
15th May 2009, 18:04
I don't understand.

If you a have one Qt installation under /a/b/c and another at /a/b/d then what is the problem with running /a/b/c/bin/qmake and /a/b/d/bin/qmake exactly?

auba
15th May 2009, 18:24
If you use the program just by reaching them with the finder, there is no problem.

When you want to call designer or assistant in the bash, it becomes a little bit more difficult. Then you have at least to have some batches to set the right paths. Or you set them in the .profile, but thats uncomfortbale when you often switch between two qt version (as I have to as we still have qt3 programs).

When you have a look at my makemk tools, desribed in Qt Software... it has to call the tool chain of qt (qmake, lupdate and so on). So its much more fun when I know they are in $QTDIR/bin (while I can change this QTDIR on the fly before calling the tools) and I don't have to search them somewhere in /Develop. When I have only the current version of Qt, I may can hardwire the path on Macs to /Develop/Tools/Qt... but as soon as I need a second instance of this Qt installation, it won't work.

wysota
15th May 2009, 21:02
So what keeps you from defining QTDIR yourself?

auba
16th May 2009, 01:06
Oh, I already did so. Else my programs would not run. I make my own sources/qt451/bin dir and put symlinks there to all needed tools. Yes, ok... that indeed is a possibility. I just thought I may misunderstood something or missed a special tool to "convert" the SDK stuff back to the old fashion.

Well, then I have to checkin my bash script. Cool, then I now can test my brand new book "programming the shell" :D Well, let's see... (book is in the office, I just scribble down some thoughts, so no code quotes)
#!/bin/bash
dir = $1
# dont know how to check/handle params
test [ -d $dir | die "Dir already exist" ]
# or was "die" from perl?
test [ -d $dir/bin | mkdir $dir/bin ]
# or similar
for( $i in ["qmake" "assisant" "linguist" ]
ln -sf /Develop/Tools/Qt/$i.app/dontremember/MacOS/$i $dir/bin/$i

Something like that, I'll have it next week :) Anyway, it becomes deep OT :rolleyes:

wysota
16th May 2009, 22:57
There is no "old fashion". It has always been that way, since Qt 4.0 at least. I really admit I don't understand your problem.