diff --git a/CMakeLists.txt b/CMakeLists.txt index 65a6137..0c10655 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,6 +182,12 @@ add_library(tessesframework_shared SHARED ${TESSESFRAMEWORK_SOURCE}) TESSESFRAMEWORK_LINKDEPS(tessesframework_shared) if(TESSESFRAMEWORK_FETCHCONTENT AND TESSESFRAMEWORK_ENABLE_MBED) target_link_libraries(tessesframework_shared PUBLIC mbedtls mbedx509 mbedcrypto everest p256m) +set(CMAKE_MACOSX_RPATH 1) +if (APPLE) + set(CMAKE_INSTALL_RPATH "@executable_path/../${CMAKE_INSTALL_LIBDIR}") +else() + set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}") +endif() endif() list(APPEND TessesFrameworkLibs tessesframework_shared) endif()