Verified Commit dd0571b3 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

cmake: fix linkage to externals CppAD and CppADCG

parent 798ca790
......@@ -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
......
......@@ -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)
......
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