[CMake] Suggesting to FindQT4.cmake where to find QT4

Bill Hoffman bill.hoffman at kitware.com
Mon May 25 17:22:03 EDT 2009


David Thompson wrote:
>>> Have you ever tried setting the PATH?  It is actually quite easy and does
>>> not involve "great contortions".
>>>
>>> All I do is execute
>>>
>>> PATH='/home/software/qtsdk-2009.02/qt/bin:'$PATH
>>>
>>> and from then on, cmake uses the version of Qt4 that I downloaded and
>>> installed in the specified location.  If I want the system version of Qt4
>>> again (which I don't for my needs), I remove the above from my PATH.
>> The issue is obviously what happens as soon as there are two independent
>> libraries that are both so selfish.  Reylying on PATH being set up
>> specially for you is terrible design unless you can guarantee that there
>> will never be another.
> 
> Perhaps there is a miscommunication here; I think Alan is assuming that
> you install at least one (if not all) versions of Qt into their own
> directories (with no other software
> in /home/software/qtsdk-2009.02/qt/bin except Qt) while you are assuming
> that multiple packages are being installed into the same directory tree.
> Doing things the former way, you can have as many of these entries in
> your path as you like and there will never be a conflict among packages
> because each PATH entry only points to a single package.
> 

You can also set QMake on the cmake command line as well:

cmake -DQT_QMAKE_EXECUTABLE=/path/to/qmake ../source

-Bill



More information about the CMake mailing list