[CMake] find_package(Qt4): EXACT doesn't work

Tyler Roscoe tyler at cryptio.net
Thu Jan 29 19:27:10 EST 2009


Hey cmakers,

I think I've found a bug:

[tylermr at alta:~/tmp/build]$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 2.6)

find_package(Qt4 99999 EXACT REQUIRED)
message("qt4_found is ${QT4_FOUND}")
message("qt_use_file is ${QT_USE_FILE}")



[tylermr at alta:~/tmp/build]$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/lib64/ccache/gcc
-- Check for working C compiler: /usr/lib64/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt-Version 4.4.3
-- Found OpenSSL: /usr/lib64/libssl.so
-- Looking for _POSIX_TIMERS
-- Looking for _POSIX_TIMERS - found
qt4_found is YES
qt_use_file is
/alta/tylermr/cmake-2.6.2-Linux-i386/share/cmake-2.6/Modules/UseQt4.cmake
-- Configuring done
-- Generating done
-- Build files have been written to: /alta/tylermr/tmp/build


So it finds my Qt, discovers that it is version 4.4.3, but doesn't
complain that 4.4.3 is not an EXACT match for the totally bogus version
99999.

Am I misunderstanding or is this a bug?

As a workaround, I can manually test whatever variable gets the Qt
version against my preferred version, but isn't this exactly what EXACT
is for?

Thanks,
tyler


More information about the CMake mailing list