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

use standard python bindings name

parent c8fd823c
cmake_minimum_required( VERSION 2.8 ) STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
include_directories("${EIGEN3_INCLUDE_DIR}")
ADD_REQUIRED_DEPENDENCY("eigenpy") ADD_REQUIRED_DEPENDENCY("eigenpy")
include_directories("${PROJECT_SOURCE_DIR}/include")
FILE(GLOB_RECURSE HeaderFiles "${PROJECT_SOURCE_DIR}/include/spline/*.h")
# Define the wrapper library that wraps our library # Define the wrapper library that wraps our library
add_library( spline SHARED spline_python.cpp ) add_library( ${PY_NAME} SHARED spline_python.cpp )
#~ target_link_libraries( centroidal_dynamics ${Boost_LIBRARIES} ${PROJECT_NAME} ) #~ target_link_libraries( centroidal_dynamics ${Boost_LIBRARIES} ${PROJECT_NAME} )
# don't prepend wrapper library name with lib # don't prepend wrapper library name with lib
set_target_properties( spline 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(spline PROPERTIES SUFFIX ".so") SET_TARGET_PROPERTIES(${PY_NAME} PROPERTIES SUFFIX ".so")
ENDIF(APPLE) ENDIF(APPLE)
PKG_CONFIG_USE_DEPENDENCY(spline eigenpy) PKG_CONFIG_USE_DEPENDENCY(${PY_NAME} eigenpy)
INSTALL( INSTALL(
TARGETS spline DESTINATION ${PYTHON_SITELIB} TARGETS ${PY_NAME} DESTINATION ${PYTHON_SITELIB}
) )
ADD_PYTHON_UNIT_TEST("python-spline" "python/test/test.py" "python") ADD_PYTHON_UNIT_TEST("python-spline" "python/test/test.py" "python")
...@@ -205,7 +205,7 @@ void set_end_acc(curve_constraints_t& c, const point_t& val) ...@@ -205,7 +205,7 @@ void set_end_acc(curve_constraints_t& c, const point_t& val)
BOOST_PYTHON_MODULE(spline) BOOST_PYTHON_MODULE(hpp_spline)
{ {
/** BEGIN eigenpy init**/ /** BEGIN eigenpy init**/
eigenpy::enableEigenPy(); eigenpy::enableEigenPy();
......
from numpy import matrix from numpy import matrix
from numpy.linalg import norm from numpy.linalg import norm
from spline import bezier, bezier6, curve_constraints, exact_cubic, from_bezier, polynom, spline_deriv_constraint from hpp_spline import bezier, bezier6, curve_constraints, exact_cubic, from_bezier, polynom, spline_deriv_constraint
__EPS = 1e-6 __EPS = 1e-6
......
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