From 2ef4ef003c2006df1458de6d47fbe3d2338edf69 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Fri, 4 Jan 2019 11:51:26 +0100 Subject: [PATCH] Fix install_name in macOS using MACOS_RPATH Instead of librst.1.dylib use @rpath/libsrt.1.dylib This is also the recommended setting as per CMP0042 policy --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90d42184a..a9ca9be13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,9 +304,8 @@ if(WIN32) message(STATUS "DETECTED SYSTEM: WINDOWS; WIN32=1; PTW32_STATIC_LIB=1") add_definitions(-DWIN32=1 -DPTW32_STATIC_LIB=1) elseif(DARWIN) - message(STATUS "DETECTED SYSTEM: DARWIN; OSX=1; MACOSX_RPATH=OFF") + message(STATUS "DETECTED SYSTEM: DARWIN; OSX=1") add_definitions(-DOSX=1) - set(MACOSX_RPATH OFF) elseif(LINUX) add_definitions(-DLINUX=1) message(STATUS "DETECTED SYSTEM: LINUX; LINUX=1" ) @@ -482,6 +481,8 @@ if (srt_libspec_shared) target_link_libraries(${TARGET_srt}_shared PRIVATE ws2_32.lib) elseif (MINGW) target_link_libraries(${TARGET_srt}_shared PRIVATE wsock32.lib ws2_32.lib) + elseif (APPLE) + set_property(TARGET ${TARGET_srt}_shared PROPERTY MACOSX_RPATH ON) endif() endif()