diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake index f8a8615270..438c0b0649 100644 --- a/Modules/FindKDE3.cmake +++ b/Modules/FindKDE3.cmake @@ -212,7 +212,7 @@ if(NOT UNIX AND KDE3_FIND_REQUIRED) endif() # If Qt4 has already been found, fail. -if(QT4_FOUND) +if(Qt4_FOUND) if(KDE3_FIND_REQUIRED) message( FATAL_ERROR "KDE3/Qt3 and Qt4 cannot be used together in one project.") else() diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake index 9ab193a72e..ae4bb930da 100644 --- a/Modules/FindQt3.cmake +++ b/Modules/FindQt3.cmake @@ -92,7 +92,7 @@ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_ # QT_WRAP_UI set true if QT_UIC_EXECUTABLE is found # If Qt4 has already been found, fail. -if(QT4_FOUND) +if(Qt4_FOUND) if(Qt3_FIND_REQUIRED) message( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project.") else() diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 6ba7e1a3a5..c084e81f65 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -127,17 +127,18 @@ Result Variables This module defines the following variables: ``Qt4_FOUND`` - Boolean whether Qt4 has been found. If false, don't try to use Qt4. + Boolean indicating whether (the requested version of) Qt4 is found. + ``QT_FOUND`` - Boolean whether Qt4 has been found. If false, don't try to use Qt4. This - variable is for compatibility with other Qt find modules. -``QT4_FOUND`` - Boolean whether Qt4 has been found. If false, don't try to use Qt4. This - variable is for backward compatibility only. + Boolean indicating whether (the requested version of) Qt4 has been found. + This variable is available for compatibility with other Qt find modules. + ``QT_VERSION_MAJOR`` The major version of Qt found. + ``QT_VERSION_MINOR`` The minor version of Qt found. + ``QT_VERSION_PATCH`` The patch version of Qt found. @@ -438,6 +439,15 @@ such uses: the ``QtCore``, ``QtGui`` and ``QtDeclarative`` components on the project target ``myexe``. +Deprecated Variables +^^^^^^^^^^^^^^^^^^^^ + +The following variables are provided for backward compatibility: + +``QT4_FOUND`` + .. deprecated:: 2.8.11 + Use ``Qt4_FOUND``, which has the same value. + Examples ^^^^^^^^ diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2d40fd0072..65cae9c979 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -593,11 +593,11 @@ if(BUILD_TESTING) if(NOT DEFINED CMake_TEST_Qt4) set(CMake_TEST_Qt4 1) endif() - if(CMake_TEST_Qt4 AND NOT QT4_FOUND) + if(CMake_TEST_Qt4 AND NOT Qt4_FOUND) find_package(Qt4 QUIET) endif() - if(CMake_TEST_Qt4 AND QT4_FOUND) + if(CMake_TEST_Qt4 AND Qt4_FOUND) # test whether the Qt4 which has been found works, on some machines # which run nightly builds there were errors like "wrong file format" # for libQtCore.so. So first check it works, and only if it does add diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 566282ec0e..3ff3118119 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -44,7 +44,7 @@ foreach(FIND_MODULE IN LISTS FIND_MODULES) endforeach() # Qt4 is not present, so we can check Qt3 -if (NOT QT4_FOUND) +if (NOT Qt4_FOUND) set(DESIRED_QT_VERSION 3) foreach(FIND_MODULE ${NO_QT4_MODULES} "Qt") do_find(${FIND_MODULE}) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 7aeb1926f4..e6b60a6ea5 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -618,7 +618,7 @@ endif() if(NOT CMAKE_GENERATOR MATCHES "Visual Studio") add_RunCMake_test(VisibilityPreset) endif() -if (QT4_FOUND) +if (Qt4_FOUND) set(CompatibleInterface_ARGS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}) endif() add_RunCMake_test(CompatibleInterface) @@ -871,10 +871,10 @@ endif() if(CMake_TEST_Qt5) find_package(Qt5Core QUIET) endif() -if (CMake_TEST_Qt4 AND CMake_TEST_Qt5 AND QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0) +if (CMake_TEST_Qt4 AND CMake_TEST_Qt5 AND Qt4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0) add_RunCMake_test(IncompatibleQt) endif() -if (CMake_TEST_Qt4 AND QT4_FOUND) +if (CMake_TEST_Qt4 AND Qt4_FOUND) add_RunCMake_test(ObsoleteQtMacros -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}) endif()