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

[CMake] fix python 3

parent ec38684d
...@@ -4,6 +4,7 @@ INCLUDE(cmake/base.cmake) ...@@ -4,6 +4,7 @@ INCLUDE(cmake/base.cmake)
INCLUDE(cmake/test.cmake) INCLUDE(cmake/test.cmake)
INCLUDE(cmake/python.cmake) INCLUDE(cmake/python.cmake)
INCLUDE(cmake/hpp.cmake) INCLUDE(cmake/hpp.cmake)
INCLUDE(cmake/boost.cmake)
SET(PROJECT_NAME hpp-centroidal-dynamics) SET(PROJECT_NAME hpp-centroidal-dynamics)
SET(PROJECT_DESCRIPTION SET(PROJECT_DESCRIPTION
...@@ -27,9 +28,9 @@ IF(BUILD_PYTHON_INTERFACE) ...@@ -27,9 +28,9 @@ IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON() FINDPYTHON()
include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS} ) include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS} )
find_package( Boost COMPONENTS python REQUIRED ) SET(BOOST_COMPONENTS python)
SEARCH_FOR_BOOST()
include_directories(SYSTEM ${Boost_INCLUDE_DIR} ) include_directories(SYSTEM ${Boost_INCLUDE_DIR} )
ENDIF(BUILD_PYTHON_INTERFACE) ENDIF(BUILD_PYTHON_INTERFACE)
ADD_REQUIRED_DEPENDENCY("eigen3") ADD_REQUIRED_DEPENDENCY("eigen3")
......
cmake_minimum_required( VERSION 2.8 )
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME}) STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
ADD_REQUIRED_DEPENDENCY("eigenpy") ADD_REQUIRED_DEPENDENCY("eigenpy")
# Define the wrapper library that wraps our library # Define the wrapper library that wraps our library
add_library( ${PY_NAME} SHARED centroidal_dynamics_python.cpp ) add_library( ${PY_NAME} SHARED centroidal_dynamics_python )
target_link_libraries( ${PY_NAME} ${Boost_LIBRARIES} ${PROJECT_NAME} ) target_link_libraries( ${PY_NAME} ${Boost_LIBRARIES} ${PROJECT_NAME} )
# don't prepend wrapper library name with lib # don't prepend wrapper library name with lib
set_target_properties( ${PY_NAME} PROPERTIES PREFIX "" ) set_target_properties( ${PY_NAME} PROPERTIES PREFIX "" )
IF(APPLE) IF(APPLE)
# We need to change the extension for python bindings # We need to change the extension for python bindings
SET_TARGET_PROPERTIES(${PY_NAME} PROPERTIES SUFFIX ".so") SET_TARGET_PROPERTIES(${PY_NAME} PROPERTIES SUFFIX ".so")
ENDIF(APPLE) ENDIF(APPLE)
PKG_CONFIG_USE_DEPENDENCY(${PY_NAME} eigenpy) PKG_CONFIG_USE_DEPENDENCY(${PY_NAME} eigenpy)
INSTALL( INSTALL(
TARGETS ${PY_NAME} DESTINATION ${PYTHON_SITELIB} TARGETS ${PY_NAME} DESTINATION ${PYTHON_SITELIB}
) )
ADD_PYTHON_UNIT_TEST("python-centroidal-dynamics" "python/test/binding_tests.py" "python") ADD_PYTHON_UNIT_TEST("python-centroidal-dynamics" "python/test/binding_tests.py" "python")
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