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

[CMake] put ADD_REQUIRED_DEPENDENCY in main CMakeLists

parent 980c08dc
......@@ -7,8 +7,8 @@ INCLUDE(cmake/hpp.cmake)
SET(PROJECT_NAME hpp-centroidal-dynamics)
SET(PROJECT_DESCRIPTION
"Utility classes for testing (robust) equilibrium of a system in contact with the environment, and other centroidal dynamics methods."
)
"Utility classes for testing (robust) equilibrium of a system in contact with the environment, and other centroidal dynamics methods."
)
SET(CUSTOM_HEADER_DIR "hpp/centroidal-dynamics")
......@@ -23,13 +23,15 @@ MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
IF(BUILD_PYTHON_INTERFACE)
# search for python
FINDPYTHON(2.7 EXACT REQUIRED)
find_package( PythonLibs 2.7 REQUIRED )
include_directories( ${PYTHON_INCLUDE_DIRS} )
# search for python
FINDPYTHON(2.7 EXACT REQUIRED)
find_package( PythonLibs 2.7 REQUIRED )
include_directories( ${PYTHON_INCLUDE_DIRS} )
find_package( Boost COMPONENTS python REQUIRED )
include_directories( ${Boost_INCLUDE_DIR} )
ADD_REQUIRED_DEPENDENCY("eigenpy")
find_package( Boost COMPONENTS python REQUIRED )
include_directories( ${Boost_INCLUDE_DIR} )
ENDIF(BUILD_PYTHON_INTERFACE)
......@@ -37,20 +39,20 @@ ADD_REQUIRED_DEPENDENCY("eigen3")
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
set(CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/cmake/find-external/CDD
${PROJECT_SOURCE_DIR}/cmake/find-external/CLP
${PROJECT_SOURCE_DIR}/cmake/find-external/qpOASES
)
${PROJECT_SOURCE_DIR}/cmake/find-external/CDD
${PROJECT_SOURCE_DIR}/cmake/find-external/CLP
${PROJECT_SOURCE_DIR}/cmake/find-external/qpOASES
)
find_package(CDD REQUIRED)
find_package(qpOASES REQUIRED)
find_package(CLP)
IF("${CLP_LIBRARY}" STREQUAL "CLP_LIBRARY-NOTFOUND")
message(STATUS "CLP_LIBRARY equal to CLP_LIBRARY-NOTFOUND so I assume CLP was not found ")
message(STATUS "CLP_LIBRARY equal to CLP_LIBRARY-NOTFOUND so I assume CLP was not found ")
else()
message(STATUS "CLP library found, defining macro CLP_FOUND")
add_definitions(-DCLP_FOUND)
message(STATUS "CLP library found, defining macro CLP_FOUND")
add_definitions(-DCLP_FOUND)
endif()
INCLUDE_DIRECTORIES(${qpOASES_INCLUDE_DIRS})
......@@ -60,7 +62,7 @@ ADD_SUBDIRECTORY (include/${CUSTOM_HEADER_DIR})
add_subdirectory (src)
add_subdirectory (test)
IF(BUILD_PYTHON_INTERFACE)
add_subdirectory (python)
add_subdirectory (python)
ENDIF(BUILD_PYTHON_INTERFACE)
SETUP_PROJECT_FINALIZE()
......@@ -2,8 +2,6 @@ cmake_minimum_required( VERSION 2.8 )
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
ADD_REQUIRED_DEPENDENCY("eigenpy")
# Define the wrapper library that wraps our library
add_library( ${PY_NAME} SHARED centroidal_dynamics_python.cpp )
target_link_libraries( ${PY_NAME} ${Boost_LIBRARIES} ${PROJECT_NAME} )
......@@ -11,14 +9,14 @@ target_link_libraries( ${PY_NAME} ${Boost_LIBRARIES} ${PROJECT_NAME} )
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")
# 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}
)
TARGETS ${PY_NAME} DESTINATION ${PYTHON_SITELIB}
)
# TODO
#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