mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 14:19:59 -05:00
Tests: Add missing guards on Qt4 and Qt5 tests
Add missing `CMake_TEST_Qt{4,5}` conditions on Qt4 an Qt5 tests.
Configuring CMake with `-DCMake_TEST_Qt5=OFF` should prevent any
attempt to search for Qt5.
Fixes: #23239
This commit is contained in:
@@ -580,12 +580,16 @@ if(NOT WIN32
|
|||||||
add_RunCMake_test(SymlinkTrees)
|
add_RunCMake_test(SymlinkTrees)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
find_package(Qt4 QUIET)
|
if(CMake_TEST_Qt4)
|
||||||
find_package(Qt5Core QUIET)
|
find_package(Qt4 QUIET)
|
||||||
if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0)
|
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)
|
||||||
add_RunCMake_test(IncompatibleQt)
|
add_RunCMake_test(IncompatibleQt)
|
||||||
endif()
|
endif()
|
||||||
if (QT4_FOUND)
|
if (CMake_TEST_Qt4 AND QT4_FOUND)
|
||||||
add_RunCMake_test(ObsoleteQtMacros -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
|
add_RunCMake_test(ObsoleteQtMacros -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user