[CMake] Qt find package location

Doug Henry doug.henry+cmake at brilligent.com
Wed Mar 11 13:40:18 EDT 2009


Looks like QTDIR is checked last, so it will always use the one found in my
path.  I was (incorrectly) expecting QTDIR to be an override, but it
functions more like a safety net.

-thanks


On Wed, Mar 11, 2009 at 1:34 PM, Doug Henry
<doug.henry+cmake at brilligent.com<doug.henry%2Bcmake at brilligent.com>
> wrote:

> thanks for the responses.  I may have missed a detail somewhere.  I set
> QTDIR (environment and I tried in cmake file) but it always finds the same
> version of Qt.  Below is a listing of my attempts.  cmake always finds
> version 4.3.4, which is installed in /tools/lin64, but my QTDIR variable
> points to the qmake directory for the newest 4.5.0 version of Qt SDK.  If I
> change my path so /home/dhenry/qtsdk-2009.01/qt/bin is first, then cmake
> will find version 4.5.  any thoughts on my usage of QTDIR?
>
> (lin64):~/tmp/build$ echo $QTDIR
> /home/dhenry/qtsdk-2009.01/qt/bin
>
> (lin64):~/tmp/build$ which qmake
> /tools/lin64/bin/qmake
>
> (lin64):~/tmp/build$ ls /home/dhenry/qtsdk-2009.01/qt/bin/qmake
> /home/dhenry/qtsdk-2009.01/qt/bin/qmake
>
>
>
> On Wed, Mar 11, 2009 at 12:58 PM, Pau Garcia i Quiles <
> pgquiles at elpauer.org> wrote:
>
>> On Wed, Mar 11, 2009 at 5:48 PM, Boudewijn Rempt <boud at valdyas.org>
>> wrote:
>> > On Wed, 11 Mar 2009, Doug Henry wrote:
>> >
>> >> I have multiple Qt installations and would like to know how I guide the
>> >> find_package(Qt4) command to find the correct one.  I assume there is a
>> >> variable I can set which defines the search path, which will allow me
>> to
>> >> change the path to find a different installed version.  Thanks.
>> >
>> > Afaik, that uses the location of the first qmake it finds on the path
>>
>> In addition to that, if you use the CVS version of CMake, you can
>> specify a particular version of Qt:
>>
>> FIND_PACKAGE( Qt4 4.4.3 )
>>
>> That means "prefer 4.4.3" to any other version. If you add EXACT to
>> that, it will only accept Qt 4.4.3:
>>
>> FIND_PACKAGE( Qt4 4.4.3 EXACT )
>>
>> You can also use the COMPONENTS syntax instead of SET(
>> QT_USE_component) to say what components you want:
>>
>> FIND_PACKAGE( Qt4 COMPONENTS QtGui QtXml QtNetwork )
>>
>> --
>> Pau Garcia i Quiles
>> http://www.elpauer.org
>> (Due to my workload, I may need 10 days to answer)
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090311/b5b9c5cc/attachment.htm>


More information about the CMake mailing list