CMake: make tests independent of Qt5/6

This commit is contained in:
Adriaan de Groot 2023-09-03 14:14:48 +02:00
parent b905afb169
commit 2b40ab9a5b
2 changed files with 6 additions and 6 deletions

View File

@ -86,9 +86,9 @@ function(calamares_add_library)
# add link targets # add link targets
target_link_libraries(${target} target_link_libraries(${target}
LINK_PUBLIC ${Calamares_LIBRARIES} LINK_PUBLIC ${Calamares_LIBRARIES}
Qt5::Core ${qtname}::Core
Qt5::Gui ${qtname}::Gui
Qt5::Widgets ${qtname}::Widgets
) )
if(LIBRARY_LINK_LIBRARIES) if(LIBRARY_LINK_LIBRARIES)
target_link_libraries(${target} LINK_PUBLIC ${LIBRARY_LINK_LIBRARIES}) target_link_libraries(${target} LINK_PUBLIC ${LIBRARY_LINK_LIBRARIES})

View File

@ -36,8 +36,8 @@ function(calamares_add_test name)
LINK_LIBRARIES LINK_LIBRARIES
Calamares::calamares Calamares::calamares
${TEST_LIBRARIES} ${TEST_LIBRARIES}
Qt5::Core ${qtname}::Core
Qt5::Test ${qtname}::Test
) )
calamares_automoc( ${TEST_NAME} ) calamares_automoc( ${TEST_NAME} )
# We specifically pass in the source directory of the test-being- # 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} PRIVATE -DBUILD_AS_TEST="${CMAKE_CURRENT_SOURCE_DIR}" ${TEST_DEFINITIONS}
) )
if(TEST_GUI) if(TEST_GUI)
target_link_libraries(${TEST_NAME} Calamares::calamaresui Qt5::Gui) target_link_libraries(${TEST_NAME} Calamares::calamaresui ${qtname}::Gui)
endif() endif()
if(TEST_RESOURCES) if(TEST_RESOURCES)
calamares_autorcc( ${TEST_NAME} ${TEST_RESOURCES} ) calamares_autorcc( ${TEST_NAME} ${TEST_RESOURCES} )