Skip to content

Commit

Permalink
determine cuke_qt runtime path for qt tests from library names as var…
Browse files Browse the repository at this point in the history
…iable
  • Loading branch information
kreuzberger authored and ursfassler committed Aug 1, 2024
1 parent 8f342e9 commit 586a232
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,11 @@ if(CUKE_ENABLE_QT_5)

message(STATUS "Found Qt version: ${Qt5Core_VERSION_STRING}")
if(Qt5Core_VERSION_STRING VERSION_LESS 5.15.0)
add_library(Qt::Core INTERFACE IMPORTED)
add_library(Qt::Gui INTERFACE IMPORTED)
add_library(Qt::Widgets INTERFACE IMPORTED)
add_library(Qt::Test INTERFACE IMPORTED)
set_target_properties(Qt::Core PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Core )
set_target_properties(Qt::Gui PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Gui )
set_target_properties(Qt::Widgets PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Widgets)
set_target_properties(Qt::Test PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Test )
add_library( Qt::Core ALIAS Qt5::Core)
add_library( Qt::Gui ALIAS Qt5::Gui)
add_library( Qt::Widgets ALIAS Qt5::Widgets)
add_library( Qt::Test ALIAS Qt5::Test)
set( CUKE_QT_RUNTIME_PATH $<TARGET_FILE_DIR:Qt5::Test> )
endif()
endif()

Expand All @@ -185,6 +182,7 @@ if(CUKE_ENABLE_QT_6)
)

message(STATUS "Found Qt version: ${Qt6Core_VERSION}")
set( CUKE_QT_RUNTIME_PATH $<TARGET_FILE_DIR:Qt6::Test> )
endif()


Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ if((TARGET Qt::Test)
AND (NOT VALGRIND_TESTS)
)
cuke_add_driver_test(integration/drivers/QtTestDriverTest Qt::Test)
cuke_set_environment( QTTEST_ENVIRONMENT RUNPATH "$<TARGET_FILE_DIR:Qt::Core>" )
cuke_set_environment( QTTEST_ENVIRONMENT RUNPATH "${CUKE_QT_RUNTIME_PATH}" )
set_tests_properties(QtTestDriverTest PROPERTIES ENVIRONMENT_MODIFICATION ${QTTEST_ENVIRONMENT})
endif()

Expand Down

0 comments on commit 586a232

Please sign in to comment.