Verified Commit 7e438a97 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

cmake: small refactoring of the code for nice export

parent a553870e
......@@ -47,9 +47,8 @@ ADD_LIBRARY(${LIBRARY_NAME} SHARED
distance.cc
fcl.cc)
TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${PROJECT_NAME})
TARGET_LINK_BOOST_PYTHON(${LIBRARY_NAME} PUBLIC)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} PUBLIC ${PROJECT_NAME})
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} eigenpy)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES
......
......@@ -82,19 +82,28 @@ set(${LIBRARY_NAME}_SOURCES
mesh_loader/loader.cpp
)
link_directories(${Boost_LIBRARY_DIRS})
add_library(${LIBRARY_NAME}
SHARED
${${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}
${Boost_INCLUDE_DIRS}
)
target_include_directories(${LIBRARY_NAME}
PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} assimp)
if (NOT ${ASSIMP_VERSION} VERSION_LESS "2.0.1150")
target_compile_definitions(${LIBRARY_NAME} PRIVATE -DHPP_FCL_USE_ASSIMP_UNIFIED_HEADER_NAMES)
......@@ -111,8 +120,6 @@ IF(OCTOMAP_FOUND)
-DOCTOMAP_PATCH_VERSION=${OCTOMAP_PATCH_VERSION})
ENDIF(OCTOMAP_FOUND)
target_include_directories(${LIBRARY_NAME} PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
install(TARGETS ${LIBRARY_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
......@@ -11,6 +11,7 @@ endmacro(add_fcl_template_test)
macro(add_fcl_test test_name)
add_executable(${ARGV})
target_link_libraries(${test_name}
PUBLIC
hpp-fcl
${Boost_LIBRARIES}
utility
......
Supports Markdown
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