Skip to content

Commit 3e7eaac

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

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

hpp-fclConfig.cmake

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,15 @@
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+
if(NOT TARGET hpp-fcl::hpp-fcl)
9+
add_library(hpp-fcl::hpp-fcl SHARED IMPORTED)
10+
target_link_libraries(hpp-fcl::hpp-fcl INTERFACE coal::coal)
11+
get_property(_cfg TARGET coal::coal PROPERTY IMPORTED_CONFIGURATIONS)
12+
get_property(_loc TARGET coal::coal PROPERTY "IMPORTED_LOCATION_${_cfg}")
13+
set_property(TARGET hpp-fcl::hpp-fcl PROPERTY IMPORTED_LOCATION "${_loc}")
14+
endif()
15+
else()
16+
add_library(hpp-fcl::hpp-fcl ALIAS coal::coal)
17+
endif()

0 commit comments

Comments
 (0)