Unverified Commit 47ae2f83 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #1242 from jcarpent/devel

Fix search of CppAD{,CodeGen}
parents a598c40b dd0571b3
......@@ -90,6 +90,7 @@ SET(PINOCCHIO_MODEL_DIR "${PROJECT_SOURCE_DIR}/models")
# ----------------------------------------------------
# --- DEPENDENCIES -----------------------------------
# ----------------------------------------------------
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/find-external/CppAD/" ${CMAKE_MODULE_PATH})
ADD_PROJECT_DEPENDENCY(Eigen3 REQUIRED PKG_CONFIG_REQUIRES "eigen3 >= 3.0.5")
# Variable containing all the cflags definition relative to optional dependencies
......
......@@ -34,13 +34,20 @@ MACRO(ADD_TEST_CFLAGS target flag)
SET_PROPERTY(TARGET ${target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${flag}")
ENDMACRO(ADD_TEST_CFLAGS)
IF(CPPAD_FOUND)
INCLUDE_DIRECTORIES(${cppad_INCLUDE_DIR})
ENDIF(CPPAD_FOUND)
IF(CPPADCG_FOUND)
INCLUDE_DIRECTORIES(${cppadcg_INCLUDE_DIR})
ENDIF(CPPADCG_FOUND)
# timings
#
ADD_BENCH(timings TRUE)
IF(CPPADCG_FOUND)
ADD_BENCH(timings-cg TRUE)
SET_PROPERTY(TARGET timings-cg PROPERTY CXX_STANDARD 11)
TARGET_LINK_LIBRARIES(timings-cg PUBLIC cppadcg::cppadcg)
TARGET_LINK_LIBRARIES(timings-cg PUBLIC ${CMAKE_DL_LIBS})
ENDIF(CPPADCG_FOUND)
......@@ -52,11 +59,10 @@ ADD_BENCH(timings-cholesky TRUE)
ADD_BENCH(timings-derivatives TRUE)
IF(CPPAD_FOUND)
TARGET_LINK_LIBRARIES(timings-derivatives PUBLIC cppad::cppad)
TARGET_LINK_LIBRARIES(timings-derivatives PUBLIC ${cppad_LIBRARY})
ENDIF(CPPAD_FOUND)
IF(CPPADCG_FOUND)
SET_PROPERTY(TARGET timings-derivatives PROPERTY CXX_STANDARD 11)
TARGET_LINK_LIBRARIES(timings-derivatives PUBLIC cppadcg::cppadcg)
ENDIF(CPPADCG_FOUND)
# timings-eigen
......
Subproject commit 9e21ae2222fdb51dccd1320bb7208f73259b0c73
Subproject commit 865044fec87cd6ca80ef1d261ed08642dd28035c
......@@ -3,8 +3,9 @@
#
IF(CPPADCG_FOUND AND BUILD_WITH_CODEGEN_SUPPORT AND BUILD_WITH_URDF_SUPPORT)
INCLUDE_DIRECTORIES(${cppadcg_INCLUDE_DIR})
ADD_PINOCCHIO_CPP_EXAMPLE(codegen-crba)
SET_PROPERTY(TARGET example-cpp-codegen-crba PROPERTY CXX_STANDARD 11)
TARGET_LINK_LIBRARIES(example-cpp-codegen-crba PUBLIC ${CMAKE_DL_LIBS} cppadcg::cppadcg)
TARGET_LINK_LIBRARIES(example-cpp-codegen-crba PUBLIC ${CMAKE_DL_LIBS})
ENDIF(CPPADCG_FOUND AND BUILD_WITH_CODEGEN_SUPPORT AND BUILD_WITH_URDF_SUPPORT)
......@@ -137,14 +137,19 @@ ENDIF(BUILD_ADVANCED_TESTING)
# Automatic differentiation
MACRO(ADD_CPPAD_UNIT_TEST name)
INCLUDE_DIRECTORIES(SYSTEM ${cppad_INCLUDE_DIR})
ADD_PINOCCHIO_UNIT_TEST(${name} cppad)
ADD_DEPENDENCIES(test-cppad test-cpp-${name})
TARGET_LINK_LIBRARIES(test-cpp-${name} PUBLIC ${cppad_LIBRARY})
ENDMACRO()
MACRO(ADD_CPPADCG_UNIT_TEST name)
INCLUDE_DIRECTORIES(SYSTEM ${cppad_INCLUDE_DIR})
INCLUDE_DIRECTORIES(SYSTEM ${cppadcodegen_INCLUDE_DIR})
ADD_PINOCCHIO_UNIT_TEST(${name} cppadcg)
SET_PROPERTY(TARGET test-cpp-${name} PROPERTY CXX_STANDARD 11)
ADD_DEPENDENCIES(test-cppadcg test-cpp-${name})
SET_PROPERTY(TARGET test-cpp-${name} PROPERTY CXX_STANDARD 11)
TARGET_LINK_LIBRARIES(test-cpp-${name} PUBLIC ${cppad_LIBRARY})
ENDMACRO()
IF(BUILD_WITH_AUTODIFF_SUPPORT)
......
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