Skip to content

Commit

Permalink
cmake: Create hpp-fcl-compatibility component to allow to only instal…
Browse files Browse the repository at this point in the history
…l the compatibility layer
  • Loading branch information
jorisv committed Sep 19, 2024
1 parent e9ba840 commit 60ad7d2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "cmake"]
path = cmake
url = https://github.com/jrl-umi3218/jrl-cmakemodules.git
url = https://github.com/jorisv/jrl-cmakemodules.git
[submodule "third-parties/qhull"]
path = third-parties/qhull
url = https://github.com/qhull/qhull.git
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ SET(${PROJECT_NAME}_HEADERS
)

if(COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
LIST(APPEND ${PROJECT_NAME}_HEADERS
SET(HPP_FCL_BACKWARD_COMPATIBILITY_HEADERS
include/hpp/fcl/broadphase/broadphase_bruteforce.h
include/hpp/fcl/broadphase/broadphase_callbacks.h
include/hpp/fcl/broadphase/broadphase_collision_manager.h
Expand Down Expand Up @@ -444,6 +444,8 @@ if(COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
include/hpp/fcl/timings.h
include/hpp/fcl/warning.hh
)
LIST(APPEND ${PROJECT_NAME}_HEADERS ${HPP_FCL_BACKWARD_COMPATIBILITY_HEADERS})
HEADER_INSTALL(COMPONENT hpp-fcl-compatibility ${HPP_FCL_BACKWARD_COMPATIBILITY_HEADERS})
endif()

IF(COAL_HAS_OCTOMAP)
Expand Down Expand Up @@ -485,7 +487,11 @@ if(COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
write_basic_package_version_file(hpp-fclConfigVersion.cmake
VERSION 3.0.0
COMPATIBILITY AnyNewerVersion)
install(FILES hpp-fclConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/hpp-fclConfigVersion.cmake DESTINATION lib/cmake/hpp-fcl)
install(FILES hpp-fclConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/hpp-fclConfigVersion.cmake
DESTINATION lib/cmake/hpp-fcl
COMPONENT hpp-fcl-compatibility)
include("${JRL_CMAKE_MODULES}/install-helpers.cmake")
add_install_target(NAME hpp-fcl-compatibility COMPONENT hpp-fcl-compatibility)
endif()

setup_project_finalize()
5 changes: 4 additions & 1 deletion hpp-fclConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ if(CMAKE_VERSION VERSION_LESS "3.18.0")
get_property(_cfg TARGET coal::coal PROPERTY IMPORTED_CONFIGURATIONS)
get_property(_loc TARGET coal::coal PROPERTY "IMPORTED_LOCATION_${_cfg}")
set_property(TARGET hpp-fcl::hpp-fcl PROPERTY IMPORTED_LOCATION "${_loc}")
target_compile_definitions(hpp-fcl::hpp-fcl PUBLIC COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
endif()
else()
add_library(hpp-fcl::hpp-fcl ALIAS coal::coal)
add_library(hpp-fcl::hpp-fcl INTERFACE)
target_link_libraries(hpp-fcl::hpp-fcl INTERFACE coal::coal)
target_compile_definitions(hpp-fcl::hpp-fcl INTERFACE COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
endif()
4 changes: 2 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,6 @@ ENDFOREACH(python)


if(COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
python_install_on_site(hppfcl __init__.py)
python_install_on_site(hppfcl viewer.py)
python_install_on_site(hppfcl __init__.py COMPONENT hpp-fcl-compatibility)
python_install_on_site(hppfcl viewer.py COMPONENT hpp-fcl-compatibility)
endif()

0 comments on commit 60ad7d2

Please sign in to comment.