aboutsummaryrefslogtreecommitdiff
path: root/autotests/CMakeLists.txt
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2021-12-03 22:33:28 +0200
committerAhmad Samir <a.samirh78@gmail.com>2021-12-16 18:05:02 +0000
commit10c4a4b4bdfdd468e52ae0fbbf84c77b64df2f8f (patch)
treef8a26e38bb4764474d076199bcb91bb5da8c1fe9 /autotests/CMakeLists.txt
parentbdb7f8bbd2d283fa87386a0fa2a505cb93b4a35c (diff)
downloadkconfig-10c4a4b4bdfdd468e52ae0fbbf84c77b64df2f8f.tar.gz
kconfig-10c4a4b4bdfdd468e52ae0fbbf84c77b64df2f8f.tar.bz2
WIP: Change the build system to enable building with Qt 6
This was built with: -DQT_MAJOR_VERSION=6 \ -DEXCLUDE_DEPRECATED_BEFORE_AND_AT=5.90.0 \ -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055a00 Move the include(KDEInstallDirs) call before the first find_package(Qt*, the former is what auto-detects the Qt version, and defaults to 5. This is needed to be able to build against Qt5 by default. All unit tests still pass.
Diffstat (limited to 'autotests/CMakeLists.txt')
-rw-r--r--autotests/CMakeLists.txt22
1 files changed, 11 insertions, 11 deletions
diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
index cae4c0b1..a7e37e5a 100644
--- a/autotests/CMakeLists.txt
+++ b/autotests/CMakeLists.txt
@@ -1,14 +1,14 @@
include(ECMAddTests)
-find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
-find_package(Qt5Concurrent ${REQUIRED_QT_VERSION} CONFIG QUIET)
+find_package(Qt${QT_MAJOR_VERSION}Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
+find_package(Qt${QT_MAJOR_VERSION}Concurrent ${REQUIRED_QT_VERSION} CONFIG QUIET)
-if(NOT Qt5Test_FOUND)
+if(NOT Qt${QT_MAJOR_VERSION}Test_FOUND)
message(STATUS "Qt5Test not found, autotests will not be built.")
return()
endif()
-if(NOT Qt5Concurrent_FOUND)
+if(NOT Qt${QT_MAJOR_VERSION}Concurrent_FOUND)
message(STATUS "Qt5Concurrent not found, autotests will not be built.")
return()
endif()
@@ -18,7 +18,7 @@ ecm_add_test(
kentrymaptest.cpp
../src/core/kconfigdata.cpp
TEST_NAME kentrymaptest
- LINK_LIBRARIES Qt5::Test
+ LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test
)
target_include_directories(kentrymaptest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src/core)
@@ -27,17 +27,17 @@ ecm_add_test(
test_kconfigutils.cpp
../src/kconf_update/kconfigutils.cpp
TEST_NAME test_kconfigutils
- LINK_LIBRARIES KF5::ConfigCore Qt5::Test
+ LINK_LIBRARIES KF5::ConfigCore Qt${QT_MAJOR_VERSION}::Test
)
target_include_directories(test_kconfigutils PRIVATE ../src/kconf_update)
qt_add_resources(sharedconfigresources sharedconfigresources.qrc)
-ecm_add_test(ksharedconfigtest.cpp ${sharedconfigresources} TEST_NAME kconfigcore-ksharedconfigtest LINK_LIBRARIES KF5::ConfigCore Qt5::Test Qt5::Concurrent)
+ecm_add_test(ksharedconfigtest.cpp ${sharedconfigresources} TEST_NAME kconfigcore-ksharedconfigtest LINK_LIBRARIES KF5::ConfigCore Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Concurrent)
# test for fallback to :/kconfig/xxxx config resource
qt_add_resources(fallbackconfigresources fallbackconfigresources.qrc)
-ecm_add_test(fallbackconfigresourcestest.cpp ${fallbackconfigresources} TEST_NAME kconfigcore-fallbackconfigresourcestest LINK_LIBRARIES KF5::ConfigCore Qt5::Test Qt5::Concurrent)
+ecm_add_test(fallbackconfigresourcestest.cpp ${fallbackconfigresources} TEST_NAME kconfigcore-fallbackconfigresourcestest LINK_LIBRARIES KF5::ConfigCore Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Concurrent)
ecm_add_tests(
kconfignokdehometest.cpp
@@ -46,19 +46,19 @@ ecm_add_tests(
test_kconf_update.cpp
ksharedconfig_in_global_object.cpp
NAME_PREFIX kconfigcore-
- LINK_LIBRARIES KF5::ConfigCore Qt5::Test Qt5::Concurrent
+ LINK_LIBRARIES KF5::ConfigCore Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Concurrent
)
target_include_directories(test_kconf_update PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../src/kconf_update)
-if(TARGET Qt5::Gui)
+if(TARGET Qt${QT_MAJOR_VERSION}::Gui)
ecm_add_tests(
kconfigguitest.cpp
kconfigloadertest.cpp
kconfigskeletontest.cpp
kstandardshortcuttest.cpp
NAME_PREFIX kconfiggui-
- LINK_LIBRARIES KF5::ConfigGui Qt5::Test
+ LINK_LIBRARIES KF5::ConfigGui Qt${QT_MAJOR_VERSION}::Test
)
# These tests do a global cleanup of ~/.qttest, so they can't run in parallel