@@ -124,7 +124,6 @@ function(set_standard_output_directory target)
124124endfunction ()
125125
126126# --- OPTIONS ----------------------------------------
127- option (BUILD_PYTHON_INTERFACE "Build the Python bindings" ON )
128127option (
129128 BUILD_WITH_VERSION_SUFFIX
130129 "Build libraries with version appended to suffix"
@@ -409,17 +408,21 @@ function(create_library)
409408 endforeach ()
410409endfunction ()
411410
412- create_library()
411+ if (BUILD_STANDALONE_PYTHON_INTERFACE)
412+ ADD_PROJECT_DEPENDENCY(${PROJECT_NAME} REQUIRED CONFIG)
413+ else ()
414+ create_library()
413415
414- ADD_HEADER_GROUP(LIB_HEADERS)
415- ADD_SOURCE_GROUP(LIB_SOURCES)
416+ ADD_HEADER_GROUP(LIB_HEADERS)
417+ ADD_SOURCE_GROUP(LIB_SOURCES)
416418
417- install (
418- TARGETS ${PROJECT_NAME}
419- EXPORT ${TARGETS_EXPORT_NAME}
420- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
421- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
422- )
419+ install (
420+ TARGETS ${PROJECT_NAME}
421+ EXPORT ${TARGETS_EXPORT_NAME}
422+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
423+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
424+ )
425+ endif ()
423426
424427if (DOWNLOAD_TRACY)
425428 install (
@@ -434,7 +437,7 @@ if(DOWNLOAD_TRACY)
434437 )
435438endif ()
436439
437- if (BUILD_CROCODDYL_COMPAT)
440+ if (BUILD_CROCODDYL_COMPAT AND NOT BUILD_STANDALONE_PYTHON_INTERFACE )
438441 ADD_PROJECT_DEPENDENCY(crocoddyl 3.0.1 REQUIRED)
439442 add_subdirectory (src/compat/crocoddyl)
440443endif ()
@@ -478,7 +481,11 @@ endif()
478481
479482# create an utility library to avoid recompiling crocoddyl talos arm problem
480483# used in examples and benchmarks
481- if (BUILD_CROCODDYL_COMPAT AND (BUILD_EXAMPLES OR BUILD_BENCHMARKS))
484+ if (
485+ NOT BUILD_STANDALONE_PYTHON_INTERFACE
486+ AND BUILD_CROCODDYL_COMPAT
487+ AND (BUILD_EXAMPLES OR BUILD_BENCHMARKS)
488+ )
482489 add_library (
483490 croc_talos_arm_utils
484491 STATIC
@@ -500,7 +507,10 @@ if(BUILD_CROCODDYL_COMPAT AND (BUILD_EXAMPLES OR BUILD_BENCHMARKS))
500507 set_standard_output_directory(croc_talos_arm_utils)
501508endif ()
502509
503- if (BUILD_BENCHMARKS OR BUILD_TESTING)
510+ if (
511+ NOT BUILD_STANDALONE_PYTHON_INTERFACE
512+ AND (BUILD_BENCHMARKS OR BUILD_TESTING)
513+ )
504514 add_library (
505515 gar_test_utils
506516 STATIC
@@ -510,7 +520,10 @@ if(BUILD_BENCHMARKS OR BUILD_TESTING)
510520 set_standard_output_directory(gar_test_utils)
511521endif ()
512522
513- if (BUILD_EXAMPLES OR BUILD_BENCHMARKS)
523+ if (
524+ NOT BUILD_STANDALONE_PYTHON_INTERFACE
525+ AND (BUILD_EXAMPLES OR BUILD_BENCHMARKS)
526+ )
514527 add_library (
515528 talos_walk_utils
516529 STATIC
@@ -535,7 +548,7 @@ if(BUILD_EXAMPLES)
535548 add_subdirectory (examples)
536549endif ()
537550
538- if (BUILD_BENCHMARKS)
551+ if (BUILD_BENCHMARKS AND NOT BUILD_STANDALONE_PYTHON_INTERFACE )
539552 find_package (benchmark REQUIRED)
540553 add_subdirectory (bench)
541554endif ()
0 commit comments