Skip to content

Commit

Permalink
feat: update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Nov 23, 2023
1 parent 6f645b7 commit 41ef62e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions lanelet2_python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ foreach (PROJECT_PYTHON_SOURCE_FILE ${PROJECT_PYTHON_SOURCE_FILES_SRC})
set_target_properties(${PYTHON_MODULE_NAME} PROPERTIES
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_RPATH_USE_LINK_PATH TRUE
INSTALL_RPATH "/usr/local/lanelet2")
INSTALL_RPATH "${CMAKE_SOURCE_DIR}/build/lib")
endif ()
endforeach ()

Expand All @@ -38,12 +38,11 @@ if (DEFINED SKBUILD)
install(TARGETS ${PROJECT_PYTHON_TARGETS} DESTINATION "lanelet2")
if (WIN32)
# Bundle shared library dependencies on Windows
get_filename_component(PYTHON_LIBRARIES_NAME ${Python_LIBRARIES} NAME_WE)
foreach (PROJECT_PYTHON_TARGET ${PROJECT_PYTHON_TARGETS})
install(FILES $<FILTER:$<TARGET_RUNTIME_DLLS:${PROJECT_PYTHON_TARGET}>,EXCLUDE,${PYTHON_LIBRARIES_NAME}.dll> DESTINATION "lanelet2/bin")
install(FILES :$<TARGET_RUNTIME_DLLS:${PROJECT_PYTHON_TARGET}> DESTINATION "bin")
endforeach ()
else ()
# Save shared library dependencies to RPATH on Unix
install(TARGETS lanelet2_core lanelet2_io lanelet2_projection lanelet2_traffic_rules lanelet2_routing lanelet2_matching DESTINATION "/usr/local/lanelet2")
install(TARGETS lanelet2_core lanelet2_io lanelet2_projection lanelet2_traffic_rules lanelet2_routing lanelet2_matching DESTINATION "${CMAKE_SOURCE_DIR}/build/lib")
endif ()
endif ()
2 changes: 1 addition & 1 deletion lanelet2_python/src/lanelet2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
bin_dir = None

try:
bin_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "bin"))
bin_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "bin"))
try:
os.add_dll_directory(bin_dir)
except (Exception,):
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ before-build = [
"python -m pip install --upgrade pip",
"pip install -r requirements.txt",
"conan profile detect --force",
"conan install . --output-folder=build --build=missing"
"conan install . --output-folder=build --build=*"
]

[tool.cibuildwheel.linux]
Expand All @@ -85,5 +85,5 @@ before-build = [
"pip install -r requirements.txt",
"conan profile detect --force",
# set the generator to use ninja because scikit-build-core will default to ninja
"conan install . --output-folder=build --build=missing -c tools.cmake.cmaketoolchain:generator=Ninja"
"conan install . --output-folder=build --build=* -c tools.cmake.cmaketoolchain:generator=Ninja"
]

0 comments on commit 41ef62e

Please sign in to comment.