From d68e063c7c9b1e6ba710c1b74071b1bf3ec4b31c Mon Sep 17 00:00:00 2001 From: Martina Gloria <114698424+martinaxgloria@users.noreply.github.com> Date: Thu, 6 Feb 2025 14:18:34 +0100 Subject: [PATCH] Update tests/CMakeLists.txt Co-authored-by: Silvio Traversaro --- tests/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3394f37..4a4536c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,13 @@ find_package(GTest REQUIRED) -find_package(ICUB QUIET) +# Only if the GZ_SIM_YARP_PLUGINS_ENABLE_TESTS_WITH_ICUB_MAIN variable is not defined, +# we look for ICUB, to set its default value +if(NOT DEFINED GZ_SIM_YARP_PLUGINS_ENABLE_TESTS_WITH_ICUB_MAIN) + find_package(ICUB QUIET) +endif() +option(GZ_SIM_YARP_PLUGINS_ENABLE_TESTS_WITH_ICUB_MAIN "Enable tests that require the installation of the icub-main package" ICUB_FOUND) +if (GZ_SIM_YARP_PLUGINS_ENABLE_TESTS_WITH_ICUB_MAIN) + find_package(ICUB REQUIRED) +endif() add_subdirectory(forcetorque) add_subdirectory(imu)