Skip to content

Commit

Permalink
feat: update conanfile.py
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Nov 23, 2023
1 parent 2cd7db4 commit b42a0de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

Expand Down
7 changes: 7 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -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__


Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit b42a0de

Please sign in to comment.