Skip to content
Snippets Groups Projects
Commit e7eba081 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[CMake] sync submodule and its use

parent 1a87f662
Branches devel master
Tags v4.10.0
No related merge requests found
Pipeline #11757 passed
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.1)
SET(PROJECT_NAME hpp-spline)
SET(PROJECT_DESCRIPTION "template based classes for creating and manipulating spline and bezier curves. Comes with extra options specific to end-effector trajectories in robotics.")
INCLUDE(cmake/hpp.cmake)
INCLUDE(cmake/test.cmake)
INCLUDE(cmake/python.cmake)
INCLUDE(cmake/boost.cmake)
......@@ -12,8 +11,9 @@ INCLUDE(cmake/boost.cmake)
SET(CXX_DISABLE_WERROR True)
SET(CMAKE_VERBOSE_MAKEFILE True)
SET(DOXYGEN_USE_MATHJAX YES)
SET(PROJECT_USE_CMAKE_EXPORT True)
ADD_REQUIRED_DEPENDENCY(eigen3)
ADD_PROJECT_DEPENDENCY(Eigen3 REQUIRED)
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
......@@ -22,15 +22,29 @@ OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
IF(BUILD_PYTHON_INTERFACE)
# search for python
FINDPYTHON()
include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS} )
SET(BOOST_COMPONENTS python)
SEARCH_FOR_BOOST()
include_directories(SYSTEM ${Boost_INCLUDE_DIRS} )
add_subdirectory (python)
SEARCH_FOR_BOOST_PYTHON(REQUIRED)
ADD_PROJECT_DEPENDENCY(eigenpy REQUIRED)
add_subdirectory(python)
ENDIF(BUILD_PYTHON_INTERFACE)
ADD_SUBDIRECTORY(include/hpp/spline)
SET(${PROJECT_NAME}_HEADERS
include/hpp/spline/bernstein.h
include/hpp/spline/bezier_polynom_conversion.h
include/hpp/spline/curve_abc.h
include/hpp/spline/exact_cubic.h
include/hpp/spline/MathDefs.h
include/hpp/spline/polynom.h
include/hpp/spline/spline_deriv_constraint.h
include/hpp/spline/bezier_curve.h
include/hpp/spline/cubic_spline.h
include/hpp/spline/curve_constraint.h
include/hpp/spline/quintic_spline.h
include/hpp/spline/helpers/effector_spline.h
include/hpp/spline/helpers/effector_spline_rotation.h
)
ADD_LIBRARY(${PROJECT_NAME} INTERFACE)
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} INTERFACE ${EIGEN3_INCLUDE_DIR} $<INSTALL_INTERFACE:include>)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
ADD_SUBDIRECTORY(tests)
Subproject commit f5e018896d0b1746a03f07ba02a5199e17eaee67
Subproject commit 32015cb28d977b592227675665d17d11531ef418
SET(${PROJECT_NAME}_HEADERS
bernstein.h
bezier_polynom_conversion.h
curve_abc.h
exact_cubic.h
MathDefs.h
polynom.h
spline_deriv_constraint.h
bezier_curve.h
cubic_spline.h
curve_constraint.h
quintic_spline.h
)
INSTALL(FILES
${${PROJECT_NAME}_HEADERS}
DESTINATION include/hpp/spline
)
ADD_SUBDIRECTORY(helpers)
SET(${PROJECT_NAME}_HELPERS_HEADERS
effector_spline.h
effector_spline_rotation.h
)
INSTALL(FILES
${${PROJECT_NAME}_HELPERS_HEADERS}
DESTINATION include/hpp/spline/helpers
)
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
ADD_REQUIRED_DEPENDENCY("eigenpy")
# Define the wrapper library that wraps our library
add_library( ${PY_NAME} SHARED spline_python.cpp )
add_library(${PY_NAME} SHARED spline_python.cpp)
target_link_libraries(${PY_NAME} eigenpy::eigenpy)
#~ target_link_libraries( centroidal_dynamics ${Boost_LIBRARIES} ${PROJECT_NAME} )
# don't prepend wrapper library name with lib
set_target_properties( ${PY_NAME} PROPERTIES PREFIX "" )
set_target_properties(${PY_NAME} PROPERTIES PREFIX "")
IF(APPLE)
# We need to change the extension for python bindings
SET_TARGET_PROPERTIES(${PY_NAME} PROPERTIES SUFFIX ".so")
ENDIF(APPLE)
PKG_CONFIG_USE_DEPENDENCY(${PY_NAME} eigenpy)
INSTALL(
TARGETS ${PY_NAME} DESTINATION ${PYTHON_SITELIB}
)
INSTALL(TARGETS ${PY_NAME} DESTINATION ${PYTHON_SITELIB})
ADD_PYTHON_UNIT_TEST("python-spline" "python/test/test.py" "python")
ADD_UNIT_TEST(spline_tests Main.cpp)
PKG_CONFIG_USE_DEPENDENCY(spline_tests eigen3)
TARGET_LINK_LIBRARIES(spline_tests PRIVATE ${PROJECT_NAME})
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