diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e56d494..d1539dd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -154,6 +154,11 @@ endif() include(GNUInstallDirs) include(AnalyzeBuild) +if(APPLE) + set(CMAKE_INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR}") +else() + set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}") +endif() # Include Coverage before CTest so that COVERAGE_COMMAND can be modified # in the Coverage module should that ever be necessary. include(Coverage) diff --git a/src/tools/pubsub/CMakeLists.txt b/src/tools/pubsub/CMakeLists.txt index f7244c7..62a9494 100644 --- a/src/tools/pubsub/CMakeLists.txt +++ b/src/tools/pubsub/CMakeLists.txt @@ -11,6 +11,7 @@ # add_executable(pubsub pubsub.c common.c testtype.c porting.c) target_link_libraries(pubsub ddsc) + if(WIN32) target_compile_definitions(pubsub PRIVATE _CRT_SECURE_NO_WARNINGS) endif()