Commit 1427311c authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[CMake] use exports

parent eab7fb4e
......@@ -5,7 +5,7 @@
# Paul Dandignac, LAAS/CNRS
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
SET(PROJECT_NAMESPACE stack-of-tasks)
SET(PROJECT_NAME sot-torque-control)
......@@ -31,8 +31,8 @@ SET(PKG_CONFIG_ADDITIONAL_VARIABLES
plugindir
)
CMAKE_POLICY(SET CMP0048 OLD)
PROJECT(${PROJECT_NAME} CXX)
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
OPTION (INITIALIZE_WITH_NAN "Initialize Eigen entries with NaN" ON)
IF(INITIALIZE_WITH_NAN)
......@@ -53,19 +53,17 @@ OPTION (INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python binding" OFF)
IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON()
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
ADD_REQUIRED_DEPENDENCY("dynamic-graph-python >= 3.0.0")
ADD_PROJECT_DEPENDENCY(dynamic-graph-python 3.0.0 REQUIRED PKG_CONFIG_REQUIRES "dynamic-graph-python >= 3.0.0")
SET(PYTHON_LIBRARY_DIR dynamic_graph/sot/torque_control)
SET(PYTHON_INSTALL_DIR ${PYTHON_SITELIB}/${PYTHON_LIBRARY_DIR})
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIR})
ENDIF(BUILD_PYTHON_INTERFACE)
SEARCH_FOR_BOOST()
SEARCH_FOR_EIGEN()
ADD_REQUIRED_DEPENDENCY("dynamic-graph >= 3.0.0")
ADD_REQUIRED_DEPENDENCY("sot-core >= 3.0.0")
ADD_REQUIRED_DEPENDENCY("pinocchio >= 1.2")
ADD_PROJECT_DEPENDENCY(Eigen3 REQUIRED PKG_CONFIG_REQUIRES eigen3)
ADD_PROJECT_DEPENDENCY(dynamic-graph 3.8.0 REQUIRED PKG_CONFIG_REQUIRES "dynamic-graph >= 3.8.0")
ADD_PROJECT_DEPENDENCY(sot-core 4.8.0 REQUIRED PKG_CONFIG_REQUIRES "sot-core >= 4.8.0")
ADD_PROJECT_DEPENDENCY(pinocchio 2.3.1 REQUIRED PKG_CONFIG_REQUIRES "pinocchio >= 2.3.1")
ADD_REQUIRED_DEPENDENCY("tsid")
ADD_REQUIRED_DEPENDENCY("parametric-curves")
ADD_REQUIRED_DEPENDENCY("simple_humanoid_description")
......
Subproject commit 63efaecd7c1fa3f9c190b5365561c38ea33f3236
Subproject commit 4514454f5f9462047b5c29f61b6c3e0db731c416
......@@ -2,9 +2,9 @@
#
# Verbosity level
IF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
IF(NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
ADD_DEFINITIONS(-DVP_DEBUG_MODE=${CMAKE_VERBOSITY_LEVEL} -DVP_DEBUG)
ENDIF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
ENDIF(NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
IF(UNIX)
ADD_DEFINITIONS(-pthread)
......@@ -25,14 +25,16 @@ SET_TARGET_PROPERTIES(${LIBRARY_NAME}
SOVERSION ${PROJECT_VERSION}
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} dynamic-graph)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} sot-core)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} pinocchio)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME}
dynamic-graph::dynamic-graph
sot-core::sot-core
pinocchio::pinocchio
${Boost_LIBRARIES})
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} tsid)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} parametric-curves)
IF(BUILD_PYTHON_INTERFACE)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} dynamic-graph-python)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} dynamic-graph-python::dynamic-graph-python)
ENDIF(BUILD_PYTHON_INTERFACE)
IF(UNIX)
......@@ -42,8 +44,6 @@ IF(UNIX)
ENDIF(NOT APPLE)
ENDIF(UNIX)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
......@@ -117,9 +117,7 @@ FOREACH(plugin ${plugins})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} dl pthread)
ENDIF(UNIX AND NOT APPLE)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} dynamic-graph)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} sot-core)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} pinocchio)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} dynamic-graph::dynamic-graph sot-core::sot-core pinocchio::pinocchio)
IF(DDP_ACTUATOR_SOLVER_FOUND)
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/find-external/qpOASES")
......@@ -138,7 +136,7 @@ FOREACH(plugin ${plugins})
sot-torque-control-${PYTHON_LIBRARY_NAME}-wrap
)
ENDIF(BUILD_PYTHON_INTERFACE)
IF (NOT INSTALL_PYTHON_INTERFACE_ONLY)
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
# Install plugins
INSTALL(TARGETS ${LIBRARY_NAME}
DESTINATION ${DYNAMIC_GRAPH_PLUGINDIR})
......
......@@ -11,19 +11,16 @@ MACRO(SOT_TOR_CTR_TEST NAME)
ADD_TEST(test-${NAME} ${RUNTIME_OUTPUT_DIRECTORY}/test-${NAME} )
ENDIF (test-${NAME}-args)
TARGET_LINK_LIBRARIES(test-${NAME} ${PROJECT_NAME})
TARGET_LINK_LIBRARIES(test-${NAME} ${PROJECT_NAME}
dynamic-graph::dynamic-graph
pinocchio::pinocchio
${Boost_LIBRARIES})
ADD_DEPENDENCIES(test-${NAME} ${PROJECT_NAME})
PKG_CONFIG_USE_DEPENDENCY(test-${NAME} pinocchio)
PKG_CONFIG_USE_DEPENDENCY(test-${NAME} dynamic-graph)
IF (test-${NAME}-libs)
TARGET_LINK_LIBRARIES(test-${NAME} ${test-${NAME}-libs})
ADD_DEPENDENCIES(test-${NAME} ${test-${NAME}-libs})
ENDIF (test-${NAME}-libs)
# Link against Boost.
TARGET_LINK_LIBRARIES(test-${NAME} ${Boost_LIBRARIES})
ENDMACRO(SOT_TOR_CTR_TEST)
SET(urdfpath
......
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