Skip to content

Commit 60ad7d2

Browse files
committed
cmake: Create hpp-fcl-compatibility component to allow to only install the compatibility layer
1 parent e9ba840 commit 60ad7d2

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "cmake"]
22
path = cmake
3-
url = https://github.com/jrl-umi3218/jrl-cmakemodules.git
3+
url = https://github.com/jorisv/jrl-cmakemodules.git
44
[submodule "third-parties/qhull"]
55
path = third-parties/qhull
66
url = https://github.com/qhull/qhull.git

CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ SET(${PROJECT_NAME}_HEADERS
317317
)
318318

319319
if(COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
320-
LIST(APPEND ${PROJECT_NAME}_HEADERS
320+
SET(HPP_FCL_BACKWARD_COMPATIBILITY_HEADERS
321321
include/hpp/fcl/broadphase/broadphase_bruteforce.h
322322
include/hpp/fcl/broadphase/broadphase_callbacks.h
323323
include/hpp/fcl/broadphase/broadphase_collision_manager.h
@@ -444,6 +444,8 @@ if(COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
444444
include/hpp/fcl/timings.h
445445
include/hpp/fcl/warning.hh
446446
)
447+
LIST(APPEND ${PROJECT_NAME}_HEADERS ${HPP_FCL_BACKWARD_COMPATIBILITY_HEADERS})
448+
HEADER_INSTALL(COMPONENT hpp-fcl-compatibility ${HPP_FCL_BACKWARD_COMPATIBILITY_HEADERS})
447449
endif()
448450

449451
IF(COAL_HAS_OCTOMAP)
@@ -485,7 +487,11 @@ if(COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
485487
write_basic_package_version_file(hpp-fclConfigVersion.cmake
486488
VERSION 3.0.0
487489
COMPATIBILITY AnyNewerVersion)
488-
install(FILES hpp-fclConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/hpp-fclConfigVersion.cmake DESTINATION lib/cmake/hpp-fcl)
490+
install(FILES hpp-fclConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/hpp-fclConfigVersion.cmake
491+
DESTINATION lib/cmake/hpp-fcl
492+
COMPONENT hpp-fcl-compatibility)
493+
include("${JRL_CMAKE_MODULES}/install-helpers.cmake")
494+
add_install_target(NAME hpp-fcl-compatibility COMPONENT hpp-fcl-compatibility)
489495
endif()
490496

491497
setup_project_finalize()

hpp-fclConfig.cmake

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ if(CMAKE_VERSION VERSION_LESS "3.18.0")
1111
get_property(_cfg TARGET coal::coal PROPERTY IMPORTED_CONFIGURATIONS)
1212
get_property(_loc TARGET coal::coal PROPERTY "IMPORTED_LOCATION_${_cfg}")
1313
set_property(TARGET hpp-fcl::hpp-fcl PROPERTY IMPORTED_LOCATION "${_loc}")
14+
target_compile_definitions(hpp-fcl::hpp-fcl PUBLIC COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
1415
endif()
1516
else()
16-
add_library(hpp-fcl::hpp-fcl ALIAS coal::coal)
17+
add_library(hpp-fcl::hpp-fcl INTERFACE)
18+
target_link_libraries(hpp-fcl::hpp-fcl INTERFACE coal::coal)
19+
target_compile_definitions(hpp-fcl::hpp-fcl INTERFACE COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
1720
endif()

python/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,6 @@ ENDFOREACH(python)
191191

192192

193193
if(COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL)
194-
python_install_on_site(hppfcl __init__.py)
195-
python_install_on_site(hppfcl viewer.py)
194+
python_install_on_site(hppfcl __init__.py COMPONENT hpp-fcl-compatibility)
195+
python_install_on_site(hppfcl viewer.py COMPONENT hpp-fcl-compatibility)
196196
endif()

0 commit comments

Comments
 (0)