File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66# --- BENCHMARK --------------------------------------
77# ----------------------------------------------------
88add_custom_target (bench )
9- add_project_private_dependency (benchmark REQUIRED )
9+
10+ if (BUILD_BENCHMARK)
11+ add_project_private_dependency (benchmark REQUIRED )
12+ endif ()
1013
1114macro (ADD_PINOCCHIO_BENCH bench_name )
1215 set (options HEADER_ONLY GOOGLE_BENCHMARK)
@@ -16,22 +19,20 @@ macro(ADD_PINOCCHIO_BENCH bench_name)
1619
1720 if (BUILD_BENCHMARK)
1821 add_executable (${bench_name} ${bench_name} .cpp )
19- else ()
20- add_executable (${bench_name} EXCLUDE_FROM_ALL ${bench_name} .cpp )
21- endif ()
2222
23- target_compile_definitions (${bench_name} PRIVATE PINOCCHIO_MODEL_DIR= "${PINOCCHIO_MODEL_DIR} " )
24- if (NOT unit_test_HEADER_ONLY)
25- target_link_libraries (${bench_name} PRIVATE pinocchio_default )
26- else ()
27- target_link_libraries (${bench_name} PRIVATE pinocchio_headers )
28- endif ()
23+ target_compile_definitions (${bench_name} PRIVATE PINOCCHIO_MODEL_DIR= "${PINOCCHIO_MODEL_DIR} " )
24+ if (NOT unit_test_HEADER_ONLY)
25+ target_link_libraries (${bench_name} PRIVATE pinocchio_default )
26+ else ()
27+ target_link_libraries (${bench_name} PRIVATE pinocchio_headers )
28+ endif ()
2929
30- if (unit_test_GOOGLE_BENCHMARK)
31- target_link_libraries (${bench_name} PRIVATE benchmark::benchmark )
32- endif ()
30+ if (unit_test_GOOGLE_BENCHMARK)
31+ target_link_libraries (${bench_name} PRIVATE benchmark::benchmark )
32+ endif ()
3333
34- add_dependencies (bench ${bench_name} )
34+ add_dependencies (bench ${bench_name} )
35+ endif ()
3536endmacro ()
3637
3738# timings
You can’t perform that action at this time.
0 commit comments