From 2b40ab9a5b4d6dffd7d1dde666882e0f5b73e6f5 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 3 Sep 2023 14:14:48 +0200 Subject: [PATCH] CMake: make tests independent of Qt5/6 --- CMakeModules/CalamaresAddLibrary.cmake | 6 +++--- CMakeModules/CalamaresAddTest.cmake | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeModules/CalamaresAddLibrary.cmake b/CMakeModules/CalamaresAddLibrary.cmake index 0cbad7424..bc9b4ba6d 100644 --- a/CMakeModules/CalamaresAddLibrary.cmake +++ b/CMakeModules/CalamaresAddLibrary.cmake @@ -86,9 +86,9 @@ function(calamares_add_library) # add link targets target_link_libraries(${target} LINK_PUBLIC ${Calamares_LIBRARIES} - Qt5::Core - Qt5::Gui - Qt5::Widgets + ${qtname}::Core + ${qtname}::Gui + ${qtname}::Widgets ) if(LIBRARY_LINK_LIBRARIES) target_link_libraries(${target} LINK_PUBLIC ${LIBRARY_LINK_LIBRARIES}) diff --git a/CMakeModules/CalamaresAddTest.cmake b/CMakeModules/CalamaresAddTest.cmake index b40e92939..984077e83 100644 --- a/CMakeModules/CalamaresAddTest.cmake +++ b/CMakeModules/CalamaresAddTest.cmake @@ -36,8 +36,8 @@ function(calamares_add_test name) LINK_LIBRARIES Calamares::calamares ${TEST_LIBRARIES} - Qt5::Core - Qt5::Test + ${qtname}::Core + ${qtname}::Test ) calamares_automoc( ${TEST_NAME} ) # We specifically pass in the source directory of the test-being- @@ -47,7 +47,7 @@ function(calamares_add_test name) PRIVATE -DBUILD_AS_TEST="${CMAKE_CURRENT_SOURCE_DIR}" ${TEST_DEFINITIONS} ) if(TEST_GUI) - target_link_libraries(${TEST_NAME} Calamares::calamaresui Qt5::Gui) + target_link_libraries(${TEST_NAME} Calamares::calamaresui ${qtname}::Gui) endif() if(TEST_RESOURCES) calamares_autorcc( ${TEST_NAME} ${TEST_RESOURCES} )