Skip to content

Commit bc5a2f6

Browse files
committed
CMake hpp-fcl compat: fix for CMake < 3.18
1 parent 1b20de9 commit bc5a2f6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

hpp-fclConfig.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,13 @@
33
message(WARNING "Please update your CMake from 'hpp-fcl' to 'coal'")
44

55
find_package(coal REQUIRED)
6-
add_library(hpp-fcl::hpp-fcl ALIAS coal::coal)
6+
7+
if(CMAKE_VERSION VERSION_LESS "3.18.0")
8+
add_library(hpp-fcl::hpp-fcl SHARED IMPORTED)
9+
target_link_libraries(hpp-fcl::hpp-fcl INTERFACE coal::coal)
10+
get_property(_cfg TARGET coal::coal PROPERTY IMPORTED_CONFIGURATIONS)
11+
get_property(_loc TARGET coal::coal PROPERTY "IMPORTED_LOCATION_${_cfg}")
12+
set_property(TARGET hpp-fcl::hpp-fcl PROPERTY IMPORTED_LOCATION "${_loc}")
13+
else()
14+
add_library(hpp-fcl::hpp-fcl ALIAS coal::coal)
15+
endif()

0 commit comments

Comments
 (0)