diff options
author | Craig Scott <craig.scott@crascit.com> | 2021-10-04 11:10:56 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2021-10-04 11:10:57 (GMT) |
commit | a7420884723c4fb09e6370fb25710a2172c10a0c (patch) | |
tree | 7d1d5cd434ca27e8b038457c784bf08af7f36c2f /Tests/QtAutogen/RerunMocOnMissingDependency | |
parent | b3a0bddc4e1c8f1f86078cdffaebbc4c493e4409 (diff) | |
download | CMake-a7420884723c4fb09e6370fb25710a2172c10a0c.zip CMake-a7420884723c4fb09e6370fb25710a2172c10a0c.tar.gz CMake-a7420884723c4fb09e6370fb25710a2172c10a0c.tar.bz2 |
Tests: Add support for testing Qt6
The minimum CMake version for Qt6 is 3.16, so all the calls to
cmake_minimum_required() are updated here to enforce that
minimum. This will avoid any CMake version-related warnings
from Qt.
Avoid hard-coding Qt5 where the tests could now be using
Qt5 or Qt6.
Fixes: #22188
Diffstat (limited to 'Tests/QtAutogen/RerunMocOnMissingDependency')
-rw-r--r-- | Tests/QtAutogen/RerunMocOnMissingDependency/CMakeLists.txt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Tests/QtAutogen/RerunMocOnMissingDependency/CMakeLists.txt b/Tests/QtAutogen/RerunMocOnMissingDependency/CMakeLists.txt index c5811eb..b17e4c5 100644 --- a/Tests/QtAutogen/RerunMocOnMissingDependency/CMakeLists.txt +++ b/Tests/QtAutogen/RerunMocOnMissingDependency/CMakeLists.txt @@ -1,6 +1,6 @@ # This test checks whether a missing dependency of the moc output triggers an AUTOMOC re-run. -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.16) project(RerunMocOnMissingDependency) include("../AutogenCoreTest.cmake") @@ -13,10 +13,10 @@ add_executable(exe "${main_source}") set(testProjectTemplateDir "${CMAKE_CURRENT_SOURCE_DIR}/MocOnMissingDependency") set(testProjectSrc "${CMAKE_CURRENT_BINARY_DIR}/MocOnMissingDependency") set(testProjectBinDir "${CMAKE_CURRENT_BINARY_DIR}/MocOnMissingDependency-build") -if(DEFINED Qt5Core_VERSION AND Qt5Core_VERSION VERSION_GREATER_EQUAL "5.15.0") - set(moc_depfiles_supported TRUE) +if(DEFINED Qt${QT_TEST_VERSION}Core_VERSION AND Qt${QT_TEST_VERSION}Core_VERSION VERSION_GREATER_EQUAL "5.15.0") + set(moc_depfiles_supported TRUE) else() - set(moc_depfiles_supported FALSE) + set(moc_depfiles_supported FALSE) endif() # Utility macros @@ -48,6 +48,7 @@ try_compile(MOC_RERUN MocOnMissingDependency CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}" "-DCMAKE_AUTOGEN_VERBOSE=ON" + "-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}" "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" OUTPUT_VARIABLE output ) |