From c68405d4dda88638bbea851d01154ef6bc7342f0 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 17 Mar 2021 08:52:52 +0100 Subject: [PATCH] Prospective fix for macos ctest not finding Qt Not sure how this could happen, but we should be able to limit the rpath workaround to Linux --- api/sixtyfps-cpp/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/sixtyfps-cpp/CMakeLists.txt b/api/sixtyfps-cpp/CMakeLists.txt index 304f33c93..436a52344 100644 --- a/api/sixtyfps-cpp/CMakeLists.txt +++ b/api/sixtyfps-cpp/CMakeLists.txt @@ -137,5 +137,9 @@ if(BUILD_TESTING) add_executable(api_tests tests/tests.cpp) target_link_libraries(api_tests PRIVATE SixtyFPS Catch2::Catch2) add_test(api_tests ${CMAKE_CURRENT_BINARY_DIR}/api_tests) - set_property(TEST api_tests PROPERTY WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") + # Somehow the wrong relative rpath ends up in the binary, requiring us to change the + # working directory. + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set_property(TEST api_tests PROPERTY WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") + endif() endif()