[CMake] Override find_package path for qt / multiarchitecture build windows 64 and windows 32

Thomas Wolf thomas.wolf at vision.ee.ethz.ch
Thu Feb 24 11:16:42 EST 2011


Dear all,

i want my build system for our project (several heavy libraries) to
build both 32 and 64 bit windows versions. Everything is integrated and
working, except one thing:

QT 4.7 is used, but installed independently (standard library, not
committed to repository). So everyone has it installed on their
machines. The thing is, there are no 64 bit builds by trolltech, so
everyone has to manually compile it (or create an external project in
cmake) - but thats fine, except that the installer of the prebuilt 32
bit version creates registry keys whereas the manually 64 bit version
apparently does not.

The cmake build files now detect very nicely with my scripts if i create
the visual studio 2008 solution file under 32 bit or 64 bit
architecture. For 64 bit I definied an environment variable "QTDIR64"
where the build shoud look into when requested as 64 bit build.

Now my problem is:
How can i *override *FIND_PACKAGE(QT) to use an additionally defined
path, be it environment variable or not? The find_qt cmake file at first
looks into the registry keys and therefore always find the 32 bit version...

Is there a way to force the qt detection mechanism into using my
directory which i missed or do i have to write my own modified
find_package for qt?

Thanks in advance & Regards,
Thomas



More information about the CMake mailing list