From a52cfb5b0bbc61fe96fde43703fc1f1a3dcce427 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 5 Jan 2024 22:32:27 +0100 Subject: [PATCH] fix: macos? --- cmake/FindMariaDB.cmake | 3 ++- tests/CMakeLists.txt | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 47054697..2a76e0aa 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -142,7 +142,8 @@ if(WIN32) IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}") elseif(APPLE) set_target_properties(MariaDB::ConnCpp PROPERTIES - MACOSX_RPATH TRUE) + MACOSX_RPATH TRUE + INSTALL_NAME_DIR "@rpath") endif() # Add directories to include lists diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 62de71d7..e8765191 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,9 +6,11 @@ include(GoogleTest) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) -set(CMAKE_BUILD_WITH_INSTALL_RPATH True) -set(CMAKE_INSTALL_RPATH "@executable_path") +if(APPLE) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) + set(CMAKE_BUILD_WITH_INSTALL_RPATH True) + set(CMAKE_INSTALL_RPATH "@executable_path") +endif() add_custom_target(conncpp_tests ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})