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

[CMake] update

parent a65354d2
...@@ -19,7 +19,6 @@ IF(NOT INSTALL_PYTHON_INTERFACE_ONLY) ...@@ -19,7 +19,6 @@ IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
SET(PROJECT_USE_CMAKE_EXPORT TRUE) SET(PROJECT_USE_CMAKE_EXPORT TRUE)
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY) ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
SET(CUSTOM_HEADER_DIR "${PROJECT_NAME}") SET(CUSTOM_HEADER_DIR "${PROJECT_NAME}")
SET(CMAKE_CXX_STANDARD 11)
SET(CXX_DISABLE_WERROR TRUE) SET(CXX_DISABLE_WERROR TRUE)
SET(DOXYGEN_USE_MATHJAX YES) SET(DOXYGEN_USE_MATHJAX YES)
...@@ -32,28 +31,25 @@ INCLUDE(cmake/ide.cmake) ...@@ -32,28 +31,25 @@ INCLUDE(cmake/ide.cmake)
# Project definition # Project definition
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX) COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS}) PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
SET(CMAKE_CXX_STANDARD 11) CHECK_MINIMAL_CXX_STANDARD(11 ENFORCE)
# Project dependencies # Project dependencies
ADD_PROJECT_DEPENDENCY(pinocchio REQUIRED PKG_CONFIG_REQUIRES "pinocchio >= 2.0.0") ADD_PROJECT_DEPENDENCY(pinocchio REQUIRED)
ADD_PROJECT_DEPENDENCY(ndcurves 1.0.0 REQUIRED PKG_CONFIG_REQUIRES "ndcurves >= 0.5.1") ADD_PROJECT_DEPENDENCY(ndcurves 1.0.0 REQUIRED)
IF(NOT CURVES_WITH_PINOCCHIO_SUPPORT) IF(NOT CURVES_WITH_PINOCCHIO_SUPPORT)
MESSAGE(FATAL_ERROR "you need to use a ndcurves version compiled with pinocchio support") MESSAGE(FATAL_ERROR "you need to use a ndcurves version compiled with pinocchio support")
ENDIF(NOT CURVES_WITH_PINOCCHIO_SUPPORT) ENDIF(NOT CURVES_WITH_PINOCCHIO_SUPPORT)
SET(BOOST_COMPONENTS unit_test_framework serialization) ADD_PROJECT_DEPENDENCY(Boost REQUIRED COMPONENTS unit_test_framework serialization)
IF(BUILD_PYTHON_INTERFACE) IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON() FINDPYTHON()
STRING(REGEX REPLACE "-" "_" PY_NAME ${CUSTOM_HEADER_DIR}) SEARCH_FOR_BOOST_PYTHON(REQUIRED)
ADD_PROJECT_DEPENDENCY(eigenpy REQUIRED PKG_CONFIG_REQUIRES "eigenpy >= 1.6.12") ADD_PROJECT_DEPENDENCY(eigenpy REQUIRED)
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS})
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME}) STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
SET(${PY_NAME}_INSTALL_DIR ${PYTHON_SITELIB}/${PY_NAME}) SET(${PY_NAME}_INSTALL_DIR ${PYTHON_SITELIB}/${PY_NAME})
ENDIF(BUILD_PYTHON_INTERFACE) ENDIF(BUILD_PYTHON_INTERFACE)
SEARCH_FOR_BOOST()
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
# Main Library # Main Library
...@@ -70,5 +66,3 @@ IF(NOT INSTALL_PYTHON_INTERFACE_ONLY) ...@@ -70,5 +66,3 @@ IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY) ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
ADD_SUBDIRECTORY(bindings) ADD_SUBDIRECTORY(bindings)
ADD_SUBDIRECTORY(unittest) ADD_SUBDIRECTORY(unittest)
PKG_CONFIG_APPEND_BOOST_LIBS(serialization)
...@@ -17,7 +17,7 @@ ADD_LIBRARY(${PY_NAME} SHARED ${${PROJECT_NAME}_PYTHON_SOURCES} ${${PROJECT_NAME ...@@ -17,7 +17,7 @@ ADD_LIBRARY(${PY_NAME} SHARED ${${PROJECT_NAME}_PYTHON_SOURCES} ${${PROJECT_NAME
ADD_SOURCE_GROUP(${PROJECT_NAME}_PYTHON_SOURCES) ADD_SOURCE_GROUP(${PROJECT_NAME}_PYTHON_SOURCES)
TARGET_LINK_LIBRARIES(${PY_NAME} ${PROJECT_NAME} ${Boost_SERIALIZATION_LIBRARIES} eigenpy::eigenpy) TARGET_LINK_LIBRARIES(${PY_NAME} ${PROJECT_NAME} eigenpy::eigenpy)
TARGET_LINK_BOOST_PYTHON(${PY_NAME}) TARGET_LINK_BOOST_PYTHON(${PY_NAME})
SET_TARGET_PROPERTIES(${PY_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PY_NAME} SOVERSION ${PROJECT_VERSION}) SET_TARGET_PROPERTIES(${PY_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PY_NAME} SOVERSION ${PROJECT_VERSION})
......
Subproject commit fb4c22c319ec5320f9a85527eb1a4130954846f5 Subproject commit f9f19535583faa2bb2ff21d97cb33f8ab7624d36
...@@ -12,7 +12,7 @@ SET(${PROJECT_NAME}_TESTS ...@@ -12,7 +12,7 @@ SET(${PROJECT_NAME}_TESTS
FOREACH(TEST ${${PROJECT_NAME}_TESTS}) FOREACH(TEST ${${PROJECT_NAME}_TESTS})
ADD_UNIT_TEST(${TEST} "${TEST}.cpp") ADD_UNIT_TEST(${TEST} "${TEST}.cpp")
TARGET_LINK_LIBRARIES(${TEST} ${PROJECT_NAME} ${Boost_LIBRARIES}) TARGET_LINK_LIBRARIES(${TEST} ${PROJECT_NAME} Boost::unit_test_framework)
ENDFOREACH(TEST ${${PROJECT_NAME}_TESTS}) ENDFOREACH(TEST ${${PROJECT_NAME}_TESTS})
TARGET_COMPILE_DEFINITIONS(examples PRIVATE -DTEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/../examples/") TARGET_COMPILE_DEFINITIONS(examples PRIVATE -DTEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/../examples/")
......
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