Commit 26f8ed9c authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[CMake] hpp-fcl >= 1.3.0 + check that hpp-fcl bindings are available.

parent 07c34bc0
......@@ -100,12 +100,6 @@ IF(BUILD_WITH_URDF_SUPPORT)
LIST(APPEND CFLAGS_DEPENDENCIES "-DPINOCCHIO_WITH_URDFDOM")
ENDIF(BUILD_WITH_URDF_SUPPORT)
IF(BUILD_WITH_HPP_FCL_SUPPORT)
ADD_DEFINITIONS(-DPINOCCHIO_WITH_HPP_FCL)
LIST(APPEND CFLAGS_DEPENDENCIES "-DPINOCCHIO_WITH_HPP_FCL")
ADD_REQUIRED_DEPENDENCY("hpp-fcl >= 1.0.0")
ENDIF(BUILD_WITH_HPP_FCL_SUPPORT)
IF(BUILD_WITH_AUTODIFF_SUPPORT)
ADD_REQUIRED_DEPENDENCY("cppad >= 20180000.0")
ENDIF(BUILD_WITH_AUTODIFF_SUPPORT)
......@@ -165,6 +159,27 @@ IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON()
ENDIF(BUILD_PYTHON_INTERFACE)
IF(BUILD_WITH_HPP_FCL_SUPPORT)
ADD_DEFINITIONS(-DPINOCCHIO_WITH_HPP_FCL)
LIST(APPEND CFLAGS_DEPENDENCIES "-DPINOCCHIO_WITH_HPP_FCL")
ADD_REQUIRED_DEPENDENCY("hpp-fcl >= 1.3.0")
# Check whether hpp-fcl python bindings are available.
SET(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS FALSE)
IF(BUILD_PYTHON_INTERFACE)
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import hppfcl"
RESULT_VARIABLE _hpp_fcl_python_bindings_not_found
OUTPUT_QUIET
ERROR_QUIET)
IF(_hpp_fcl_python_bindings_not_found EQUAL 0)
SET(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS TRUE)
MESSAGE(STATUS "Found hpp-fcl python bindings.")
ELSE()
MESSAGE(STATUS "Did not find hpp-fcl python bindings.")
ENDIF()
UNSET(_hpp_fcl_python_bindings_not_found)
ENDIF(BUILD_PYTHON_INTERFACE)
ENDIF(BUILD_WITH_HPP_FCL_SUPPORT)
SET(BOOST_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} ${BOOST_OPTIONAL_COMPONENTS} ${BOOST_BUILD_COMPONENTS})
SEARCH_FOR_BOOST()
# Enforce the preprocessed version of boost::list and boost::vector
......
......@@ -77,7 +77,7 @@ REMOVE_PATH_FROM_LIST("${${PROJECT_NAME}_PYTHON_HEADERS}" "${CMAKE_CURRENT_SOURC
REMOVE_PATH_FROM_LIST("${${PROJECT_NAME}_PYTHON_SOURCES}" "${CMAKE_CURRENT_SOURCE_DIR}/" ${PROJECT_NAME}_PYTHON_SOURCES)
# Python exposition of FCL
IF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
IF(NOT BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_HEADERS
multibody/fcl/transform.hpp
)
......@@ -85,7 +85,7 @@ IF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_SOURCES
multibody/fcl/expose-fcl.cpp
)
ENDIF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
ENDIF(NOT BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
LIST(APPEND HEADERS ${${PROJECT_NAME}_PYTHON_HEADERS})
......@@ -94,9 +94,9 @@ MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python"
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/spatial")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/multibody")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/multibody/joint")
IF(BUILD_WITH_HPP_FCL_SUPPORT)
IF(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/multibody/fcl")
ENDIF(BUILD_WITH_HPP_FCL_SUPPORT)
ENDIF(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/parsers")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/serialization")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/algorithm")
......@@ -129,6 +129,9 @@ IF(BUILD_PYTHON_INTERFACE)
IF(HPP_FCL_FOUND)
PKG_CONFIG_USE_DEPENDENCY(${PYWRAP} hpp-fcl)
ENDIF(HPP_FCL_FOUND)
IF(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
TARGET_COMPILE_DEFINITIONS(${PYWRAP} PRIVATE -DPINOCCHIO_WITH_HPP_FCL_PYTHON_BINDINGS)
ENDIF(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
IF(CPPAD_FOUND)
PKG_CONFIG_USE_DEPENDENCY(${PYWRAP} "cppad")
......
......@@ -38,9 +38,9 @@ namespace pinocchio
// Expose algorithms
void exposeAlgorithms();
#ifdef PINOCCHIO_WITH_HPP_FCL
#ifdef PINOCCHIO_WITH_HPP_FCL_PYTHON_BINDINGS
void exposeFCL();
#endif // PINOCCHIO_WITH_HPP_FCL
#endif // PINOCCHIO_WITH_HPP_FCL_PYTHON_BINDINGS
} // namespace python
} // namespace pinocchio
......
......@@ -77,9 +77,9 @@ BOOST_PYTHON_MODULE(libpinocchio_pywrap)
exposeAlgorithms();
exposeParsers();
#ifdef PINOCCHIO_WITH_HPP_FCL
#ifdef PINOCCHIO_WITH_HPP_FCL_PYTHON_BINDINGS
exposeFCL();
#endif // PINOCCHIO_WITH_HPP_FCL
#endif // PINOCCHIO_WITH_HPP_FCL_PYTHON_BINDINGS
exposeVersion();
exposeDependencies();
......
......@@ -29,8 +29,13 @@ IF(HPP_FCL_FOUND)
SET(${PROJECT_NAME}_PYTHON_TESTS
${${PROJECT_NAME}_PYTHON_TESTS}
bindings_geometry_object
bindings_fcl_transform
)
IF(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
SET(${PROJECT_NAME}_PYTHON_TESTS
${${PROJECT_NAME}_PYTHON_TESTS}
bindings_fcl_transform
)
ENDIF(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
ENDIF(HPP_FCL_FOUND)
IF(URDFDOM_FOUND)
......
Markdown is supported
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