From 5766b3d0dae32447ec01a53d1f895b99e7795257 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 12 Jan 2017 11:26:35 +0100 Subject: [PATCH] try to use a rpath for everything on Apple --- tools/cmake/Java.cmake | 5 ----- tools/cmake/MakeLib.cmake | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/cmake/Java.cmake b/tools/cmake/Java.cmake index 55bf8b83bf..eb20402562 100644 --- a/tools/cmake/Java.cmake +++ b/tools/cmake/Java.cmake @@ -37,11 +37,6 @@ endif() add_library(simgrid-java SHARED ${JMSG_C_SRC}) set_target_properties(simgrid-java PROPERTIES VERSION ${libsimgrid-java_version}) set_target_properties(simgrid-java PROPERTIES SKIP_BUILD_RPATH ON) -if(APPLE) - # add the current location of libsimgrid-java.dynlib as a location for libsimgrid.dynlib - # (useful when unpacking the native libraries from the jarfile) - set_target_properties(simgrid-java PROPERTIES CMAKE_INSTALL_RPATH "@loader_path/.") -endif() target_link_libraries(simgrid-java simgrid) diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index f67255192a..0d157fe851 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -3,6 +3,12 @@ # On Mac OSX, specify that rpath is useful to look for the dependencies # See https://cmake.org/Wiki/CMake_RPATH_handling and Java.cmake set(MACOSX_RPATH ON) +if(APPLE) + # add the current location of libsimgrid-java.dynlib as a location for libsimgrid.dynlib + # (useful when unpacking the native libraries from the jarfile) + set(CMAKE_INSTALL_RPATH "@loader_path/.") + SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +endif() ############################### # Declare the library content # -- 2.20.1