From 0c2d40632ee5df9c241532d8bf62de9969e47f51 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:09:03 -0500 Subject: [PATCH] try manual link directory specification --- cmake/FindMariaDB.cmake | 2 +- tests/dCommonTests/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 6f047a70..65f77db4 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -121,6 +121,7 @@ else() # Build from source endif() set(MARIADBCPP_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/${MARIADB_SHARED_LIBRARY_NAME}") + message(STATUS "MARIADBCPP_SHARED_LIBRARY_LOCATION = ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") if(WIN32) set(MARIADBC_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/libmariadb.lib") endif() @@ -137,7 +138,6 @@ if(WIN32) IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}") elseif(APPLE) set_target_properties(MariaDB::ConnCpp PROPERTIES - IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}" IMPORTED_SONAME "libmariadbcpp") endif() diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index a20e4b6b..c3c0faa9 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -33,6 +33,11 @@ add_dependencies(dCommonTests conncpp_tests) #set_target_properties(libmariadbcpp PROPERTIES IMPORTED_LOCATION @rpath/libmariadbcpp.dylib) +# TEST +if(APPLE) + link_directories(${CMAKE_BINARY_DIR}/mariadbcpp) +endif() + # Link needed libraries target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main MariaDB::ConnCpp)