Commit af403dc0 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[CMake] sync submodule and its use

parent d94aaeed
......@@ -38,19 +38,19 @@ CHECK_MINIMAL_CXX_STANDARD(11 ENFORCE)
ADD_PROJECT_DEPENDENCY(dynamic-graph REQUIRED PKG_CONFIG_REQUIRES dynamic-graph)
ADD_PROJECT_DEPENDENCY(pinocchio REQUIRED PKG_CONFIG_REQUIRES pinocchio)
ADD_PROJECT_DEPENDENCY(example-robot-data)
SET(BOOST_COMPONENTS filesystem system thread program_options
unit_test_framework regex)
ADD_PROJECT_DEPENDENCY(Boost REQUIRED COMPONENTS regex)
IF(BUILD_TESTING)
FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework program_options)
ENDIF()
IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON()
STRING(REGEX REPLACE "-" "_" PYTHON_DIR ${CUSTOM_HEADER_DIR})
ADD_PROJECT_DEPENDENCY(dynamic-graph-python REQUIRED
PKG_CONFIG_REQUIRES dynamic-graph-python)
ADD_PROJECT_DEPENDENCY(dynamic-graph-python REQUIRED PKG_CONFIG_REQUIRES dynamic-graph-python)
SEARCH_FOR_BOOST_PYTHON(REQUIRED)
ENDIF(BUILD_PYTHON_INTERFACE)
SEARCH_FOR_BOOST()
# Verbosity level
IF(NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
ADD_DEFINITIONS(-DVP_DEBUG_MODE=${CMAKE_VERBOSITY_LEVEL} -DVP_DEBUG)
......@@ -172,9 +172,7 @@ SET(${PROJECT_NAME}_SOURCES
ADD_LIBRARY(${PROJECT_NAME} SHARED
${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME}
SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${Boost_LIBRARIES}
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC Boost::regex
dynamic-graph::dynamic-graph pinocchio::pinocchio)
IF(SUFFIX_SO_VERSION)
......
......@@ -95,7 +95,7 @@ FOREACH(plugin ${plugins})
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
ENDIF(SUFFIX_SO_VERSION)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${PROJECT_NAME} ${${LIBRARY_NAME}_deps})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} PUBLIC ${PROJECT_NAME} ${${LIBRARY_NAME}_deps})
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
INSTALL(TARGETS ${LIBRARY_NAME} EXPORT ${TARGETS_EXPORT_NAME}
......@@ -160,12 +160,10 @@ IF(BUILD_PYTHON_INTERFACE)
# Robot_utils_sot_py PYTHON module *
# **********************************
ADD_LIBRARY(robot_utils_sot_py SHARED tools/robot-utils-py.cpp)
TARGET_INCLUDE_DIRECTORIES(robot_utils_sot_py SYSTEM PUBLIC ${PYTHON_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(robot_utils_sot_py
${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${PROJECT_NAME}
dynamic-graph::dynamic-graph pinocchio::pinocchio)
TARGET_INCLUDE_DIRECTORIES(robot_utils_sot_py PUBLIC pinocchio::pinocchio)
TARGET_LINK_BOOST_PYTHON(robot_utils_sot_py)
TARGET_INCLUDE_DIRECTORIES(robot_utils_sot_py SYSTEM PUBLIC ${PYTHON_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(robot_utils_sot_py PUBLIC
${PYTHON_LIBRARIES} ${PROJECT_NAME})
TARGET_LINK_BOOST_PYTHON(robot_utils_sot_py PRIVATE)
SET_TARGET_PROPERTIES(robot_utils_sot_py PROPERTIES PREFIX "")
INSTALL(TARGETS robot_utils_sot_py DESTINATION "${PYTHON_SITELIB}/dynamic_graph/${PYTHON_DIR}")
ENDIF(BUILD_PYTHON_INTERFACE)
......@@ -104,25 +104,21 @@ IF(UNIX)
ADD_LIBRARY(pluginabstract SHARED tools/plugin.cc)
ADD_EXECUTABLE(test_abstract_interface tools/test_abstract_interface.cpp)
TARGET_LINK_LIBRARIES(test_abstract_interface
pluginabstract ${CMAKE_DL_LIBS} ${Boost_LIBRARIES})
TARGET_INCLUDE_DIRECTORIES(test_abstract_interface
SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(test_abstract_interface PRIVATE
Boost::program_options
pluginabstract ${CMAKE_DL_LIBS})
ENDIF(UNIX)
FOREACH(path ${tests})
GET_FILENAME_COMPONENT(test ${path} NAME)
ADD_UNIT_TEST(${test} ${path}.cpp)
TARGET_LINK_LIBRARIES(${test}
PUBLIC
${PROJECT_NAME}
${TEST_${test}_LIBS} ${TEST_${test}_EXT_LIBS}
dynamic-graph::dynamic-graph)
TARGET_LINK_LIBRARIES(${test} PRIVATE ${PROJECT_NAME}
Boost::unit_test_framework
${TEST_${test}_LIBS} ${TEST_${test}_EXT_LIBS})
IF(UNIX)
TARGET_LINK_LIBRARIES(${test} PUBLIC ${CMAKE_DL_LIBS})
TARGET_LINK_LIBRARIES(${test} PRIVATE ${CMAKE_DL_LIBS})
ENDIF(UNIX)
ENDFOREACH(path ${tests})
......
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