Skip to content
Snippets Groups Projects
Verified Commit 7e438a97 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

cmake: small refactoring of the code for nice export

parent a553870e
No related branches found
No related tags found
No related merge requests found
...@@ -47,9 +47,8 @@ ADD_LIBRARY(${LIBRARY_NAME} SHARED ...@@ -47,9 +47,8 @@ ADD_LIBRARY(${LIBRARY_NAME} SHARED
distance.cc distance.cc
fcl.cc) fcl.cc)
TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME}) TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME} PUBLIC)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES}) TARGET_LINK_LIBRARIES(${LIBRARY_NAME} PUBLIC ${PROJECT_NAME})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${PROJECT_NAME})
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} eigenpy) PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} eigenpy)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES
......
...@@ -82,19 +82,28 @@ set(${LIBRARY_NAME}_SOURCES ...@@ -82,19 +82,28 @@ set(${LIBRARY_NAME}_SOURCES
mesh_loader/loader.cpp mesh_loader/loader.cpp
) )
link_directories(${Boost_LIBRARY_DIRS})
add_library(${LIBRARY_NAME} add_library(${LIBRARY_NAME}
SHARED SHARED
${${LIBRARY_NAME}_SOURCES} ${${LIBRARY_NAME}_SOURCES}
) )
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
target_include_directories(${LIBRARY_NAME} SYSTEM PUBLIC TARGET_LINK_LIBRARIES(${LIBRARY_NAME}
PUBLIC
${Boost_thread_LIBRARY}
${Boost_date_time_LIBRARY}
${Boost_system_LIBRARY})
target_include_directories(${LIBRARY_NAME}
SYSTEM PUBLIC
${EIGEN3_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
) )
target_include_directories(${LIBRARY_NAME}
PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} assimp) PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} assimp)
if (NOT ${ASSIMP_VERSION} VERSION_LESS "2.0.1150") if (NOT ${ASSIMP_VERSION} VERSION_LESS "2.0.1150")
target_compile_definitions(${LIBRARY_NAME} PRIVATE -DHPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES) target_compile_definitions(${LIBRARY_NAME} PRIVATE -DHPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES)
...@@ -111,8 +120,6 @@ IF(OCTOMAP_FOUND) ...@@ -111,8 +120,6 @@ IF(OCTOMAP_FOUND)
-DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION}) -DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION})
ENDIF(OCTOMAP_FOUND) ENDIF(OCTOMAP_FOUND)
target_include_directories(${LIBRARY_NAME} PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
install(TARGETS ${LIBRARY_NAME} install(TARGETS ${LIBRARY_NAME}
EXPORT ${TARGETS_EXPORT_NAME} EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}) DESTINATION ${CMAKE_INSTALL_LIBDIR})
...@@ -11,6 +11,7 @@ endmacro(add_fcl_template_test) ...@@ -11,6 +11,7 @@ endmacro(add_fcl_template_test)
macro(add_fcl_test test_name) macro(add_fcl_test test_name)
add_executable(${ARGV}) add_executable(${ARGV})
target_link_libraries(${test_name} target_link_libraries(${test_name}
PUBLIC
hpp-fcl hpp-fcl
${Boost_LIBRARIES} ${Boost_LIBRARIES}
utility utility
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment