From 33e3c5eb41ee9c5c3ea326e0b788f9efbfcf2e30 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Sun, 23 Jan 2022 13:06:05 +0100 Subject: Forward the Qt6 build option to the CMake test runs Fixes a number of unit tests that rely on Qt in some form when using Qt6. --- tests/ECMQmlModuleTest/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/ECMQmlModuleTest/CMakeLists.txt') diff --git a/tests/ECMQmlModuleTest/CMakeLists.txt b/tests/ECMQmlModuleTest/CMakeLists.txt index 49d76594..e0f9e298 100644 --- a/tests/ECMQmlModuleTest/CMakeLists.txt +++ b/tests/ECMQmlModuleTest/CMakeLists.txt @@ -8,8 +8,9 @@ cmake_minimum_required(VERSION 3.5) set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../modules) set(CMAKE_MODULE_PATH "${ECM_FIND_MODULE_DIR}" "${ECM_MODULE_DIR}") +include(QtVersionOption) -find_package(Qt5 REQUIRED COMPONENTS Qml) +find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Qml) include(ECMQmlModule) if(QML_ONLY) @@ -17,7 +18,7 @@ if(QML_ONLY) else() ecm_add_qml_module(TestModule URI Test) target_sources(TestModule PRIVATE qmlmodule.cpp) - target_link_libraries(TestModule Qt5::Qml) + target_link_libraries(TestModule Qt${QT_MAJOR_VERSION}::Qml) endif() if (DEPENDS) -- cgit v1.2.1