Commit 63c56ebb authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[CMake] export target hpp-fcl

parent 199a3c7b
...@@ -39,6 +39,7 @@ set(PROJECT_NAME hpp-fcl) ...@@ -39,6 +39,7 @@ set(PROJECT_NAME hpp-fcl)
set(PROJECT_DESCRIPTION set(PROJECT_DESCRIPTION
"HPP fork of FCL -- The Flexible Collision Library" "HPP fork of FCL -- The Flexible Collision Library"
) )
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
include(cmake/eigen.cmake) include(cmake/eigen.cmake)
include(cmake/boost.cmake) include(cmake/boost.cmake)
...@@ -73,16 +74,11 @@ search_for_boost() ...@@ -73,16 +74,11 @@ search_for_boost()
# Optional dependencies # Optional dependencies
add_optional_dependency("octomap >= 1.6") add_optional_dependency("octomap >= 1.6")
if (OCTOMAP_FOUND) if (OCTOMAP_FOUND)
link_directories(${OCTOMAP_LIBRARY_DIRS})
SET(HPP_FCL_HAVE_OCTOMAP TRUE) SET(HPP_FCL_HAVE_OCTOMAP TRUE)
add_definitions (-DHPP_FCL_HAVE_OCTOMAP)
string(REPLACE "." ";" VERSION_LIST ${OCTOMAP_VERSION}) string(REPLACE "." ";" VERSION_LIST ${OCTOMAP_VERSION})
list(GET VERSION_LIST 0 OCTOMAP_MAJOR_VERSION) list(GET VERSION_LIST 0 OCTOMAP_MAJOR_VERSION)
list(GET VERSION_LIST 1 OCTOMAP_MINOR_VERSION) list(GET VERSION_LIST 1 OCTOMAP_MINOR_VERSION)
list(GET VERSION_LIST 2 OCTOMAP_PATCH_VERSION) list(GET VERSION_LIST 2 OCTOMAP_PATCH_VERSION)
add_definitions (-DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION}
-DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION}
-DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION})
message(STATUS "FCL uses Octomap") message(STATUS "FCL uses Octomap")
else() else()
SET(HPP_FCL_HAVE_OCTOMAP FALSE) SET(HPP_FCL_HAVE_OCTOMAP FALSE)
......
...@@ -105,6 +105,15 @@ else() ...@@ -105,6 +105,15 @@ else()
endif() endif()
IF(OCTOMAP_FOUND) IF(OCTOMAP_FOUND)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} octomap) PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} octomap)
target_compile_definitions (${LIBRARY_NAME} PUBLIC
-DHPP_FCL_HAVE_OCTOMAP
-DOCTOMAP_MAJOR_VERSION=${OCTOMAP_MAJOR_VERSION}
-DOCTOMAP_MINOR_VERSION=${OCTOMAP_MINOR_VERSION}
-DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION})
ENDIF(OCTOMAP_FOUND) ENDIF(OCTOMAP_FOUND)
install(TARGETS ${LIBRARY_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}) target_include_directories(${LIBRARY_NAME} PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
install(TARGETS ${LIBRARY_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
...@@ -22,11 +22,7 @@ endmacro(add_fcl_test) ...@@ -22,11 +22,7 @@ endmacro(add_fcl_test)
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_library(utility STATIC utility.cpp) add_library(utility STATIC utility.cpp)
target_include_directories(utility SYSTEM PUBLIC target_link_libraries(utility hpp-fcl)
${EIGEN3_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
$<$<BOOL:${HPP_FCL_HAVE_OCTOMAP}>:${OCTOMAP_INCLUDE_DIRS}>
)
add_fcl_test(math math.cpp) add_fcl_test(math math.cpp)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment