Commit 3315e87e authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[CMake] clean

parent 223915f6
Pipeline #4143 failed with stage
in 2 minutes and 11 seconds
cmake_minimum_required(VERSION 2.6)
project(curve)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/test.cmake)
INCLUDE(cmake/python.cmake)
INCLUDE(cmake/hpp.cmake)
......@@ -13,26 +14,28 @@ SET(PROJECT_DESCRIPTION
# Disable -Werror on Unix for now.
SET(CXX_DISABLE_WERROR True)
SET(CMAKE_VERBOSE_MAKEFILE True)
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
SETUP_HPP_PROJECT()
ADD_REQUIRED_DEPENDENCY(eigen3)
SET(BOOST_COMPONENTS unit_test_framework)
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
IF(BUILD_PYTHON_INTERFACE)
# search for python
FINDPYTHON(2.7 REQUIRED)
find_package( PythonLibs 2.7 REQUIRED )
include_directories( ${PYTHON_INCLUDE_DIRS} )
FINDPYTHON()
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS})
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
find_package( Boost COMPONENTS python REQUIRED )
include_directories( ${Boost_INCLUDE_DIR} )
ADD_REQUIRED_DEPENDENCY("eigenpy")
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
add_subdirectory (python)
ADD_SUBDIRECTORY(python)
ENDIF(BUILD_PYTHON_INTERFACE)
SEARCH_FOR_BOOST()
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
ADD_SUBDIRECTORY(include/curve)
ADD_SUBDIRECTORY(tests)
......
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
ADD_REQUIRED_DEPENDENCY("eigenpy")
SET(${PY_NAME}_BINDINGS_SOURCES
curve_python.cpp
python_variables.cpp
python_variables.h
)
# Define the wrapper library that wraps our library
add_library( ${PY_NAME} SHARED curve_python.cpp python_variables.cpp python_variables.h )
#~ target_link_libraries( centroidal_dynamics ${Boost_LIBRARIES} ${PROJECT_NAME} )
# don't prepend wrapper library name with lib
set_target_properties( ${PY_NAME} PROPERTIES PREFIX "" )
ADD_LIBRARY(${PY_NAME} SHARED ${${PY_NAME}_BINDINGS_SOURCES})
SET_TARGET_PROPERTIES(${PY_NAME} PROPERTIES PREFIX "")
PKG_CONFIG_USE_DEPENDENCY(${PY_NAME} eigenpy)
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-curve" "python/test/test.py" "python")
ADD_UNIT_TEST(
curve_tests Main.cpp
)
curve_tests Main.cpp
)
PKG_CONFIG_USE_DEPENDENCY(curve_tests eigen3)
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