Skip to content

Commit

Permalink
try manual link directory specification
Browse files Browse the repository at this point in the history
  • Loading branch information
jadebenn committed Apr 6, 2024
1 parent d41349d commit 0c2d406
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/FindMariaDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()

Expand Down
5 changes: 5 additions & 0 deletions tests/dCommonTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0c2d406

Please sign in to comment.