Skip to content

Commit

Permalink
Merge pull request #4 from nim65s/coal-more-compat
Browse files Browse the repository at this point in the history
Coal more compat
  • Loading branch information
lmontaut authored Jul 25, 2024
2 parents 69da2d6 + 3e7eaac commit eaa94d6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
13 changes: 12 additions & 1 deletion hpp-fclConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,15 @@
message(WARNING "Please update your CMake from 'hpp-fcl' to 'coal'")

find_package(coal REQUIRED)
add_library(hpp-fcl::hpp-fcl ALIAS coal::coal)

if(CMAKE_VERSION VERSION_LESS "3.18.0")
if(NOT TARGET hpp-fcl::hpp-fcl)
add_library(hpp-fcl::hpp-fcl SHARED IMPORTED)
target_link_libraries(hpp-fcl::hpp-fcl INTERFACE coal::coal)
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}")
endif()
else()
add_library(hpp-fcl::hpp-fcl ALIAS coal::coal)
endif()
10 changes: 7 additions & 3 deletions include/hpp/fcl/coal.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#ifndef HPP_FCL_COAL_HH
#define HPP_FCL_COAL_HH
#ifndef HPP_FCL_COAL_HPP
#define HPP_FCL_COAL_HPP

#include <coal/config.hh>
#include <coal/deprecated.hh>

#define COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL

#ifdef _MSC_VER
#pragma message COAL_DEPRECATED_HEADER( \
"Please update your includes from 'hpp/fcl' to 'coal'")
#else
#warning "Please update your includes from 'hpp/fcl' to 'coal'"
#endif

#define HPP_FCL_VERSION_AT_LEAST(major, minor, patch) \
COAL_VERSION_AT_LEAST(major, minor, patch)

#endif // COAL_FWD_HH
#endif // COAL_FWD_HPP

0 comments on commit eaa94d6

Please sign in to comment.