PDA

View Full Version : how to detect Qt3 ahd Qt4 with qmake?



learning_qt
16th October 2009, 11:44
Hello, i have a problem about qmake.
The problem is like this:
I installed qt3 and qt4 (qt4.5 and qt4.6) in my computer, i hope qmake can detect if qt4.6 is installed and can get header file path and libs automatically. If there is no qt4.6, it stops.

Thanks in advance!

DrDonut
16th October 2009, 12:41
First: What is your exact question? Do you want to make sure your program is compiled with the latest compiler?

Second: Why do you have multiple versions of QT on your computer anyway. If you want to compile some project which has some QT3 code in it, you can use QT3_support.

It might be possible that we are able to help you further if you provide these answers.

Good luck!

learning_qt
16th October 2009, 12:48
Sorry , for confusion
The idea is:
My application need Qt4.6 and some computers have Qt3, Qt4.4.3 and Qt4.6. So, are there some ways in Qmake or project file to detect if Qt4.6 is installed? if so, we get the header files path automatically so makefile can use this path in -I/usr/local/...?

Thanks in advance!

DrDonut
16th October 2009, 12:58
If you use Qmake from the command line, I would assume that it would take the header files from the directory QMake itself is in. For example you call:


C:\QT\4.6\bin\make.exe

That qt automaticly uses the header files from: C:\QT\4.6\include...

But I don't know how those files are stored in a linux system which you seem to be using (I only program using Windows).

So maybe you can try this, and maybe someone else around here knows more about that.

Good luck!

learning_qt
19th October 2009, 05:41
Thanks!

I hope to add some into project file so that QMake can detect which version of Qt is installed and where it is?