diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b48fbc4..e751acc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,6 @@ endif () if (SKBUILD) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) -# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_INSTALL_RPATH "${CMAKE_SOURCE_DIR}/build/lib") endif () diff --git a/conanfile.py b/conanfile.py index 36da7146..6761de79 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,6 +1,8 @@ from conan import ConanFile +from conan.tools.apple import is_apple_os from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps from conan.tools.files import copy + from lanelet2_python.src.lanelet2 import __version__ @@ -98,6 +100,11 @@ def generate(self): copy(self, "*.so*", dep.cpp_info.libdirs[0], str(self.source_path / "build" / "lib")) copy(self, "*.dll", dep.cpp_info.bindirs[0], str(self.source_path / "build" / "lib")) + if is_apple_os(self): + path_to_lib = str(self.source_path / "build" / "lib" / "libboost_filesystem.dylib") + command = f"install_name_tool -add_rpath @loader_path {path_to_lib}" + self.run(command) + def build(self): cmake = CMake(self) cmake.configure()