From 0a13a26311ccf5a3b4fc2c261dfc6d9a07728cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Genesio=20=28=E4=BA=8C=E3=82=B3=E3=82=B2?= =?UTF-8?q?=E3=83=8D=29?= Date: Thu, 29 Feb 2024 12:07:33 +0100 Subject: [PATCH] ergocub-software: compile ergoCubEmotions by default if OpenCV >= 4.5.2 (#1539) * ergocub-software: compile ergoCubEmotions by default It fixes #1513 * Update cmake/Buildergocub-software.cmake Co-authored-by: Silvio Traversaro * Update cmake/Buildergocub-software.cmake Co-authored-by: Silvio Traversaro * Update cmake/Buildergocub-software.cmake Co-authored-by: Silvio Traversaro * Update Buildergocub-software.cmake * Update Buildergocub-software.cmake * Fix typo --------- Co-authored-by: Silvio Traversaro --- cmake/Buildergocub-software.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/Buildergocub-software.cmake b/cmake/Buildergocub-software.cmake index f31a64bc4..d3f7a5478 100644 --- a/cmake/Buildergocub-software.cmake +++ b/cmake/Buildergocub-software.cmake @@ -6,7 +6,12 @@ include(FindOrBuildPackage) find_or_build_package(YARP QUIET) -set(ergocub-software_OPTIONAL_CMAKE_ARGS "") +find_package(OpenCV QUIET) +if(DEFINED OpenCV_VERSION AND OpenCV_VERSION VERSION_GREATER_EQUAL "4.5.2") + set(COMPILE_ergoCubEmotions ON) +else() + set(COMPILE_ergoCubEmotions OFF) +endif() ycm_ep_helper(ergocub-software TYPE GIT @@ -16,4 +21,7 @@ ycm_ep_helper(ergocub-software DEPENDS YARP COMPONENT core FOLDER src - CMAKE_ARGS ${ergocub-software_OPTIONAL_CMAKE_ARGS}) + DEPENDS YARP + CMAKE_ARGS -DCOMPILE_ergoCubEmotions:BOOL=${COMPILE_ergoCubEmotions}) + +set(ergocub-sofware_CONDA_DEPENDENCIES libopencv)