Skip to content

Commit

Permalink
Merge pull request #1067 from jcarpent/devel
Browse files Browse the repository at this point in the history
Full CMake export of Pinocchio
  • Loading branch information
jcarpent authored Feb 18, 2020
2 parents b8c1ae0 + 5f91ccb commit f3a9ee0
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 55 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ jobs:
export CTEST_OUTPUT_ON_FAILURE=1
make test
sudo make install
cd ../unittest/packaging
mkdir build
cd build
export CMAKE_PREFIX_PATH=/usr/local
cmake ..
make
cd ../../../build
sudo make uninstall
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: generic
sudo: required
os: linux
git:
depth: false
compiler:
Expand All @@ -19,9 +19,6 @@ env:
- BUILD_WITH_CATKIN_SUPPORT=false
- CTEST_OUTPUT_ON_FAILURE=1

notifications:
email:
- [email protected]
branches:
only:
- master
Expand Down Expand Up @@ -51,8 +48,6 @@ jobs:
- TRAVIS_PYTHON_VERSION=35
python: 3.5

allow_failures:
- compiler:
before_install: ./travis_custom/custom_before_install
install:
- pip install --user pyopenssl
Expand Down
73 changes: 50 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ SET(PROJECT_NAME pinocchio)
SET(PROJECT_DESCRIPTION "A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives")
SET(PROJECT_URL "http://github.com/stack-of-tasks/pinocchio")
SET(PROJECT_CUSTOM_HEADER_EXTENSION "hpp")
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(PROJECT_USE_KEYWORD_LINK_LIBRARIES TRUE)

# Disable -Werror on Unix for now.
SET(CXX_DISABLE_WERROR True)
Expand Down Expand Up @@ -59,12 +61,22 @@ OPTION(BUILD_WITH_AUTODIFF_SUPPORT "Build the library with the Automatic Differe
OPTION(BUILD_WITH_CASADI_SUPPORT "Build the library with the CASADI support" OFF)
OPTION(BUILD_WITH_CODEGEN_SUPPORT "Build the library with the Code Generation support" OFF)

OPTION (INITIALIZE_WITH_NAN "Initialize Eigen entries with NaN" OFF)
OPTION(INITIALIZE_WITH_NAN "Initialize Eigen entries with NaN" OFF)

IF (INITIALIZE_WITH_NAN)
IF(BUILD_WITH_COLLISION_SUPPORT)
SET(BUILD_WITH_HPP_FCL_SUPPORT TRUE)
ENDIF()
IF(BUILD_WITH_AUTODIFF_SUPPORT)
SET(BUILD_WITH_CPPAD_SUPPORT TRUE)
ENDIF()
IF(BUILD_WITH_CODEGEN_SUPPORT)
SET(BUILD_WITH_CPPAD_CODEGEN_SUPPORT TRUE)
ENDIF()

IF(INITIALIZE_WITH_NAN)
MESSAGE (STATUS "Initialize with NaN all the Eigen entries.")
ADD_DEFINITIONS(-DEIGEN_INITIALIZE_MATRICES_BY_NAN)
ENDIF (INITIALIZE_WITH_NAN)
ENDIF(INITIALIZE_WITH_NAN)

MACRO(TAG_LIBRARY_VERSION target)
SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${PROJECT_VERSION})
Expand All @@ -79,17 +91,21 @@ ADD_REQUIRED_DEPENDENCY("eigen3 >= 3.0.5")

IF(BUILD_WITH_URDF_SUPPORT)
ADD_REQUIRED_DEPENDENCY("urdfdom >= 0.2.0")
ADD_DEFINITIONS(-DPINOCCHIO_WITH_URDFDOM)
LIST(APPEND CFLAGS_DEPENDENCIES "-DPINOCCHIO_WITH_URDFDOM")
ENDIF(BUILD_WITH_URDF_SUPPORT)

IF(BUILD_WITH_COLLISION_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_COLLISION_SUPPORT)
ENDIF(BUILD_WITH_HPP_FCL_SUPPORT)

IF(BUILD_WITH_AUTODIFF_SUPPORT)
ADD_REQUIRED_DEPENDENCY("cppad >= 20180000.0")
ENDIF(BUILD_WITH_AUTODIFF_SUPPORT)

IF(CPPAD_FOUND AND BUILD_WITH_AUTODIFF_SUPPORT)
IF(BUILD_WITH_AUTODIFF_SUPPORT)
ADD_DEFINITIONS(-DPINOCCHIO_WITH_CPPAD_SUPPORT)
PKG_CONFIG_APPEND_CFLAGS("-DPINOCCHIO_WITH_CPPAD_SUPPORT")
IF(NOT ${CPPAD_VERSION} VERSION_GREATER "3.3.0")
Expand All @@ -98,13 +114,13 @@ IF(CPPAD_FOUND AND BUILD_WITH_AUTODIFF_SUPPORT)
ENDIF(NOT ${CPPAD_VERSION} VERSION_GREATER "3.3.0")

IF(BUILD_WITH_CODEGEN_SUPPORT)
ADD_OPTIONAL_DEPENDENCY("cppadcg")
ADD_REQUIRED_DEPENDENCY("cppadcg")
ENDIF(BUILD_WITH_CODEGEN_SUPPORT)
IF(CPPADCG_FOUND AND BUILD_WITH_CODEGEN_SUPPORT)
ADD_DEFINITIONS(-DPINOCCHIO_WITH_CPPADCG_SUPPORT)
PKG_CONFIG_APPEND_CFLAGS("-DPINOCCHIO_WITH_CPPADCG_SUPPORT")
ENDIF(CPPADCG_FOUND AND BUILD_WITH_CODEGEN_SUPPORT)
ENDIF(CPPAD_FOUND AND BUILD_WITH_AUTODIFF_SUPPORT)
ENDIF(BUILD_WITH_AUTODIFF_SUPPORT)

IF(BUILD_WITH_CASADI_SUPPORT)
ADD_REQUIRED_DEPENDENCY("casadi >= 3.4.5")
Expand All @@ -116,7 +132,7 @@ IF(CASADI_FOUND AND BUILD_WITH_CASADI_SUPPORT)
ENDIF(CASADI_FOUND AND BUILD_WITH_CASADI_SUPPORT)

# Special care of urdfdom version
IF(URDFDOM_FOUND AND BUILD_WITH_URDF_SUPPORT)
IF(BUILD_WITH_URDF_SUPPORT)
IF(${URDFDOM_VERSION} VERSION_LESS "0.3.0")
ADD_DEFINITIONS(-DPINOCCHIO_URDFDOM_COLLISION_WITH_GROUP_NAME)
PKG_CONFIG_APPEND_CFLAGS("-DPINOCCHIO_URDFDOM_COLLISION_WITH_GROUP_NAME")
Expand All @@ -133,7 +149,7 @@ IF(URDFDOM_FOUND AND BUILD_WITH_URDF_SUPPORT)
ADD_DEFINITIONS(-DPINOCCHIO_URDFDOM_USE_STD_SHARED_PTR)
PKG_CONFIG_APPEND_CFLAGS("-DPINOCCHIO_URDFDOM_USE_STD_SHARED_PTR")
ENDIF(${URDFDOM_VERSION} VERSION_GREATER "0.4.2")
ENDIF(URDFDOM_FOUND AND BUILD_WITH_URDF_SUPPORT)
ENDIF(BUILD_WITH_URDF_SUPPORT)

SET(BOOST_REQUIRED_COMPONENTS filesystem serialization system)
SET(BOOST_BUILD_COMPONENTS unit_test_framework)
Expand All @@ -142,7 +158,6 @@ SET(BOOST_OPTIONAL_COMPONENTS "")
IF(BUILD_PYTHON_INTERFACE)
SET(BOOST_OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_COMPONENTS} python)
FINDPYTHON()
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS})
ENDIF(BUILD_PYTHON_INTERFACE)

SET(BOOST_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} ${BOOST_OPTIONAL_COMPONENTS} ${BOOST_BUILD_COMPONENTS})
Expand All @@ -168,28 +183,21 @@ FILE(GLOB_RECURSE HEADERS
${PROJECT_SOURCE_DIR}/src/*.hxx
)

IF(URDFDOM_FOUND)
ADD_DEFINITIONS(-DPINOCCHIO_WITH_URDFDOM)
LIST(APPEND CFLAGS_DEPENDENCIES "-DPINOCCHIO_WITH_URDFDOM")
ELSE(URDFDOM_FOUND)
IF(NOT BUILD_WITH_URDF_SUPPORT)
LIST(REMOVE_ITEM HEADERS
${PROJECT_SOURCE_DIR}/src/parsers/urdf.hpp
${PROJECT_SOURCE_DIR}/src/parsers/urdf/model.hxx
${PROJECT_SOURCE_DIR}/src/parsers/urdf/geometry.hxx
${PROJECT_SOURCE_DIR}/src/parsers/urdf/utils.hpp
${PROJECT_SOURCE_DIR}/src/parsers/urdf/types.hpp
)
ENDIF(URDFDOM_FOUND)
ENDIF(NOT BUILD_WITH_URDF_SUPPORT)


IF(HPP_FCL_FOUND)
ADD_DEFINITIONS(-DPINOCCHIO_WITH_HPP_FCL)
LIST(APPEND CFLAGS_DEPENDENCIES "-DPINOCCHIO_WITH_HPP_FCL")
ELSE(HPP_FCL_FOUND)
IF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
LIST(REMOVE_ITEM HEADERS
${PROJECT_SOURCE_DIR}/src/spatial/fcl-pinocchio-conversions.hpp
)
ENDIF(HPP_FCL_FOUND)
ENDIF(NOT BUILD_WITH_HPP_FCL_SUPPORT)

LIST(APPEND HEADERS macros.hpp)

Expand Down Expand Up @@ -249,7 +257,26 @@ ADD_SUBDIRECTORY(examples)
ADD_SUBDIRECTORY(benchmark)

# --- PACKAGING ----------------------------------------------------------------
PKG_CONFIG_APPEND_LIBS (${PROJECT_NAME})
IF(BUILD_WITH_URDF_SUPPORT)
SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_USE_URDFDOM \"\")")
ENDIF()
IF(BUILD_WITH_HPP_FCL_SUPPORT)
SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_USE_HPP_FCL \"\")")
ENDIF()
IF(BUILD_WITH_CPPAD_SUPPORT)
SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_USE_CPPAD \"\")")
ENDIF()
IF(BUILD_WITH_CPPAD_CODEGEN_SUPPORT)
SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_USE_CPPAD_CODEGEN \"\")")
ENDIF()
IF(BUILD_WITH_CASADI_SUPPORT)
SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_USE_CASADI \"\")")
ENDIF()
IF(BUILD_PYTHON_INTERFACE)
SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_WITH_PYTHON_INTERFACE \"\")")
ENDIF()

PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
PKG_CONFIG_APPEND_BOOST_LIBS(${BOOST_REQUIRED_COMPONENTS})

FOREACH(cflags ${CFLAGS_DEPENDENCIES})
Expand Down
4 changes: 2 additions & 2 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MACRO(ADD_BENCH bench_name)
SET(link_to_main_lib ${ARGV1})
IF(link_to_main_lib)
SET_TARGET_PROPERTIES(${bench_name} PROPERTIES COMPILE_DEFINITIONS PINOCCHIO_MODEL_DIR="${PINOCCHIO_MODEL_DIR}")
TARGET_LINK_LIBRARIES(${bench_name} ${PROJECT_NAME})
TARGET_LINK_LIBRARIES(${bench_name} PUBLIC ${PROJECT_NAME})
PKG_CONFIG_USE_DEPENDENCY(${bench_name} eigen3)

IF(HPP_FCL_FOUND)
Expand Down Expand Up @@ -47,7 +47,7 @@ IF(CPPADCG_FOUND)
ADD_BENCH(timings-cg TRUE)
SET_PROPERTY(TARGET timings-cg PROPERTY CXX_STANDARD 11)
PKG_CONFIG_USE_DEPENDENCY(timings-cg "cppadcg")
TARGET_LINK_LIBRARIES(timings-cg ${CMAKE_DL_LIBS})
TARGET_LINK_LIBRARIES(timings-cg PUBLIC ${CMAKE_DL_LIBS})
ENDIF(CPPADCG_FOUND)

# timings
Expand Down
21 changes: 13 additions & 8 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2015-2019 CNRS INRIA
# Copyright (c) 2015-2020 CNRS INRIA
# Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
#

Expand Down Expand Up @@ -30,6 +30,7 @@ ENDFUNCTION(REMOVE_PATH_FROM_LIST)

# --- PYTHON TARGET --- #
IF(BUILD_PYTHON_INTERFACE)
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS})
ADD_CUSTOM_TARGET(python)
SET_TARGET_PROPERTIES(python PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)

Expand Down Expand Up @@ -76,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 HPP_FCL_FOUND)
IF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_HEADERS
multibody/fcl/contact.hpp
multibody/fcl/collision-result.hpp
Expand All @@ -89,7 +90,7 @@ IF(NOT HPP_FCL_FOUND)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_SOURCES
multibody/fcl/expose-fcl.cpp
)
ENDIF(NOT HPP_FCL_FOUND)
ENDIF(NOT BUILD_WITH_HPP_FCL_SUPPORT)

LIST(APPEND HEADERS ${${PROJECT_NAME}_PYTHON_HEADERS})

Expand All @@ -98,9 +99,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(HPP_FCL_FOUND)
IF(BUILD_WITH_HPP_FCL_SUPPORT)
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/multibody/fcl")
ENDIF(HPP_FCL_FOUND)
ENDIF(BUILD_WITH_HPP_FCL_SUPPORT)
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")
Expand All @@ -127,8 +128,8 @@ IF(BUILD_PYTHON_INTERFACE)
ADD_SOURCE_GROUP(${PYWRAP}_SOURCES)
PKG_CONFIG_USE_DEPENDENCY(${PYWRAP} eigenpy)

TARGET_LINK_LIBRARIES(${PYWRAP} ${PROJECT_NAME})
TARGET_LINK_BOOST_PYTHON(${PYWRAP})
TARGET_LINK_LIBRARIES(${PYWRAP} PUBLIC ${PROJECT_NAME})
TARGET_LINK_BOOST_PYTHON(${PYWRAP} PUBLIC)

IF(HPP_FCL_FOUND)
PKG_CONFIG_USE_DEPENDENCY(${PYWRAP} hpp-fcl)
Expand All @@ -150,7 +151,11 @@ IF(BUILD_PYTHON_INTERFACE)
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bindings/python/${PROJECT_NAME}")

INSTALL(TARGETS ${PYWRAP} DESTINATION ${${PYWRAP}_INSTALL_DIR})
INSTALL(
TARGETS ${PYWRAP}
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION ${${PYWRAP}_INSTALL_DIR}
)

# --- INSTALL SCRIPTS
SET(PYTHON_FILES
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FUNCTION(ADD_PINOCCHIO_CPP_EXAMPLE EXAMPLE)
GET_FILENAME_COMPONENT(EXAMPLE_NAME ${EXAMPLE} NAME)
SET(EXAMPLE_NAME "example-cpp-${EXAMPLE_NAME}")
ADD_UNIT_TEST(${EXAMPLE_NAME} ${EXAMPLE})
TARGET_LINK_LIBRARIES(${EXAMPLE_NAME} ${PROJECT_NAME})
TARGET_LINK_LIBRARIES(${EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
PKG_CONFIG_USE_DEPENDENCY(${EXAMPLE_NAME} eigen3)
IF(URDFDOM_FOUND)
PKG_CONFIG_USE_DEPENDENCY(${EXAMPLE_NAME} urdfdom)
Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ SET(${PROJECT_NAME}_SOURCES
${${PROJECT_NAME}_PARSERS_SOURCES}
)

# Extract the compile definitions of the project for export
GET_DIRECTORY_PROPERTY(CURRENT_COMPILE_DEFINITIONS COMPILE_DEFINITIONS)

IF(UNIX)
# Create target libpinocchio.so
ADD_LIBRARY(${PROJECT_NAME} SHARED ${HEADERS} ${${PROJECT_NAME}_SOURCES})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PUBLIC ${CURRENT_COMPILE_DEFINITIONS})
IF(BUILD_WITH_COMMIT_VERSION)
TAG_LIBRARY_VERSION(${PROJECT_NAME})
ENDIF(BUILD_WITH_COMMIT_VERSION)
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} eigen3)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_SERIALIZATION_LIBRARY})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_SERIALIZATION_LIBRARY})

IF(URDFDOM_FOUND)
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} urdfdom)
Expand Down
21 changes: 11 additions & 10 deletions unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ MACRO(ADD_PINOCCHIO_UNIT_TEST NAME)
PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} hpp-fcl)
ENDIF(HPP_FCL_FOUND)

TARGET_LINK_LIBRARIES(${TEST_NAME} ${PROJECT_NAME})
TARGET_LINK_LIBRARIES(${TEST_NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
TARGET_LINK_LIBRARIES(${TEST_NAME} PUBLIC ${PROJECT_NAME})
TARGET_LINK_LIBRARIES(${TEST_NAME} PRIVATE ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
ENDMACRO(ADD_PINOCCHIO_UNIT_TEST)

# --- RULES -------------------------------------------------------------------
Expand Down Expand Up @@ -76,9 +76,10 @@ ENDIF(URDFDOM_FOUND)

IF(BUILD_PYTHON_INTERFACE)
ADD_PINOCCHIO_UNIT_TEST(python_parser eigenpy)
TARGET_INCLUDE_DIRECTORIES(test-cpp-python_parser SYSTEM PUBLIC ${PYTHON_INCLUDE_DIRS})

TARGET_LINK_LIBRARIES(test-cpp-python_parser ${PYWRAP})
TARGET_LINK_LIBRARIES(test-cpp-python_parser ${PYTHON_LIBRARIES})
TARGET_LINK_LIBRARIES(test-cpp-python_parser PUBLIC ${PYWRAP})
TARGET_LINK_LIBRARIES(test-cpp-python_parser PUBLIC ${PYTHON_LIBRARIES})
SET(ENV_VARIABLES "PYTHONPATH=${CMAKE_BINARY_DIR}/bindings/python:$ENV{PYTHONPATH}")
IF(APPLE)
LIST(APPEND ENV_VARIABLES "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}")
Expand Down Expand Up @@ -124,25 +125,25 @@ ADD_PINOCCHIO_UNIT_TEST(contact-dynamics-derivatives)
ADD_PINOCCHIO_UNIT_TEST(multiprecision)

# Automatic differentiation
IF(CPPAD_FOUND AND BUILD_WITH_AUTODIFF_SUPPORT)
IF(BUILD_WITH_AUTODIFF_SUPPORT)
ADD_PINOCCHIO_UNIT_TEST(cppad-basic cppad)
ADD_PINOCCHIO_UNIT_TEST(cppad-spatial cppad)
ADD_PINOCCHIO_UNIT_TEST(cppad-joints cppad)
ADD_PINOCCHIO_UNIT_TEST(cppad-algo cppad)
ADD_PINOCCHIO_UNIT_TEST(cppad-algo-derivatives cppad)

IF(CPPADCG_FOUND AND BUILD_WITH_CODEGEN_SUPPORT)
IF(BUILD_WITH_CODEGEN_SUPPORT)
ADD_PINOCCHIO_UNIT_TEST(cppadcg-basic cppadcg)
SET_PROPERTY(TARGET test-cpp-cppadcg-basic PROPERTY CXX_STANDARD 11)
TARGET_LINK_LIBRARIES(test-cpp-cppadcg-basic ${CMAKE_DL_LIBS})
ADD_PINOCCHIO_UNIT_TEST(cppadcg-algo cppadcg)
SET_PROPERTY(TARGET test-cpp-cppadcg-algo PROPERTY CXX_STANDARD 11)
TARGET_LINK_LIBRARIES(test-cpp-cppadcg-algo ${CMAKE_DL_LIBS})
ENDIF(CPPADCG_FOUND AND BUILD_WITH_CODEGEN_SUPPORT)
ENDIF(BUILD_WITH_CODEGEN_SUPPORT)

ENDIF(CPPAD_FOUND AND BUILD_WITH_AUTODIFF_SUPPORT)
ENDIF(BUILD_WITH_AUTODIFF_SUPPORT)

IF(CASADI_FOUND AND BUILD_WITH_CASADI_SUPPORT)
IF(BUILD_WITH_CASADI_SUPPORT)
ADD_PINOCCHIO_UNIT_TEST(casadi-basic casadi)
SET_PROPERTY(TARGET test-cpp-casadi-basic PROPERTY CXX_STANDARD 11)
ADD_PINOCCHIO_UNIT_TEST(casadi-spatial casadi)
Expand All @@ -153,5 +154,5 @@ IF(CASADI_FOUND AND BUILD_WITH_CASADI_SUPPORT)
SET_PROPERTY(TARGET test-cpp-casadi-algo PROPERTY CXX_STANDARD 11)
ADD_PINOCCHIO_UNIT_TEST(casadi-algo-derivatives casadi)
SET_PROPERTY(TARGET test-cpp-casadi-algo-derivatives PROPERTY CXX_STANDARD 11)
ENDIF(CASADI_FOUND AND BUILD_WITH_CASADI_SUPPORT)
ENDIF(BUILD_WITH_CASADI_SUPPORT)

17 changes: 17 additions & 0 deletions unittest/packaging/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 2.6)

project(ExtraLib CXX)
find_package(pinocchio REQUIRED)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)

set(PINOCCHIO_MODEL_DIR "${PROJECT_SOURCE_DIR}/../../models")
add_definitions('-DPINOCCHIO_MODEL_DIR=\"${PINOCCHIO_MODEL_DIR}\"')

add_executable(run_rnea run_rnea.cpp)
target_link_libraries(run_rnea PUBLIC pinocchio::pinocchio)

if(DEFINED PINOCCHIO_WITH_URDF_SUPPORT)
add_executable(load_urdf load_urdf.cpp)
target_link_libraries(load_urdf PUBLIC pinocchio::pinocchio)
endif(DEFINED PINOCCHIO_WITH_URDF_SUPPORT)
Loading

0 comments on commit f3a9ee0

Please sign in to comment.