@@ -124,7 +124,10 @@ option(ENABLE_TEMPLATE_INSTANTIATION "Template instantiation of the main library
124124
125125# --- OPTIONAL DEPENDENCIES -------------------------
126126option (BUILD_WITH_PINOCCHIO_SUPPORT "Build the library with support for Pinocchio" ON )
127- option (BUILD_CROCODDYL_COMPAT "Build the Crocoddyl compatibility module" OFF )
127+ cmake_dependent_option(
128+ BUILD_CROCODDYL_COMPAT "Build the Crocoddyl compatibility module" OFF
129+ BUILD_WITH_PINOCCHIO_SUPPORT OFF
130+ )
128131option (BUILD_WITH_OPENMP_SUPPORT "Build the library with the OpenMP support" ON )
129132option (BUILD_WITH_CHOLMOD_SUPPORT "Build with support for backends enabled by Cholmod" OFF )
130133option (BUILD_BENCHMARKS "Build benchmarks" ON )
@@ -360,15 +363,13 @@ macro(create_ex_or_bench exfile exname)
360363 target_include_directories (${exname} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} )
361364
362365 target_link_libraries (${exname} PUBLIC ${PROJECT_NAME} )
363- target_link_libraries (${exname} PUBLIC example-robot-data::example-robot-data)
364- endmacro ()
365-
366- macro (target_add_example_robot_data target_name)
367- target_link_libraries (${target_name} PRIVATE example-robot-data::example-robot-data)
368366endmacro ()
369367
370368if (BUILD_WITH_PINOCCHIO_SUPPORT AND (BUILD_EXAMPLES OR BUILD_BENCHMARKS))
371369 add_project_private_dependency(example-robot-data 4.0.9 REQUIRED)
370+ macro (target_add_example_robot_data target_name)
371+ target_link_libraries (${target_name} PRIVATE example-robot-data::example-robot-data)
372+ endmacro ()
372373endif ()
373374
374375# create an utility library to avoid recompiling crocoddyl talos arm problem
@@ -392,11 +393,11 @@ if(BUILD_BENCHMARKS OR BUILD_TESTING)
392393 set_standard_output_directory(gar_test_utils)
393394endif ()
394395
395- if (${pinocchio_VERSION} VERSION_GREATER "2.9.0" )
396+ if (BUILD_WITH_PINOCCHIO_SUPPORT AND ${pinocchio_VERSION} VERSION_GREATER "2.9.0" )
396397 set (PINOCCHIO_V3 True )
397398endif ()
398399
399- if (PINOCCHIO_V3)
400+ if (PINOCCHIO_V3 AND (BUILD_EXAMPLES OR BUILD_BENCHMARKS) )
400401 add_library (
401402 talos_walk_utils STATIC ${PROJECT_SOURCE_DIR} /examples/talos-walk-utils.cpp
402403 ${PROJECT_SOURCE_DIR} /examples/talos-walk-utils.hpp
0 commit comments