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

2009-01-29 Thread Tyler Roscoe
Hey cmakers,

I think I've found a bug:

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

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



[tyle...@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
9.

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
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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

2009-01-30 Thread Andreas Pakulat
On 29.01.09 16:27:10, Tyler Roscoe wrote:
> Hey cmakers,
> 
> I think I've found a bug:

Not really :)
 
> [tyle...@alta:~/tmp/build]$ cat ../CMakeLists.txt
> cmake_minimum_required(VERSION 2.6)
> 
> find_package(Qt4 9 EXACT REQUIRED)
> message("qt4_found is ${QT4_FOUND}")
> message("qt_use_file is ${QT_USE_FILE}")

The reason this doesn't work is that FindQt4 simply hasn't been changed to
work with the new cmake2.6 feature of specifying the version in the
find_package call. Hence it only supports setting a cmake variable
"QT_MIN_VERISON" before running find_package. This also doesn't support an
exact match, its just a minimum required.

Of course you may file an enhancement report to make FindQt4.cmake care for
the cmake-variables set when using the version argument for find_package.

Andreas

-- 
Are you making all this up as you go along?
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake