From 2577d861bacc5f9be70ba39ea3273940474c135b Mon Sep 17 00:00:00 2001 From: Paul Baksic <30337881+bakpaul@users.noreply.github.com> Date: Fri, 8 Mar 2024 20:31:32 +0100 Subject: [PATCH] [Config] Fix findcxxopt when version is not specified (#4564) * Remove error and send warning when cxxopt is found but version mismatch * [all] Install FindTinyXML2 (#4545) Install FindTinyXML2 for OOT compilation using the binaries * [Visual] Fix cmake config (#4555) Remove the find_package(tinyxml2 REQUIRED) because the link is private * Set link to tinyxml2 to PRIVATE and fix config file * Check if version is specified before checking the version to avoid errors * Set cxx_opts_FOUND when the version is not required --------- Co-authored-by: Hugo --- Sofa/framework/Config/cmake/Modules/Findcxxopts.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sofa/framework/Config/cmake/Modules/Findcxxopts.cmake b/Sofa/framework/Config/cmake/Modules/Findcxxopts.cmake index 3a154e214f2..ad3a0b4e7a2 100644 --- a/Sofa/framework/Config/cmake/Modules/Findcxxopts.cmake +++ b/Sofa/framework/Config/cmake/Modules/Findcxxopts.cmake @@ -48,8 +48,12 @@ if(NOT TARGET cxxopts::cxxopts) endif() if(cxxopts_INCLUDE_DIR) - _cxxopts_check_version() - set(cxxopts_FOUND ${cxxopts_VERSION_OK}) + if(cxxopts_FIND_VERSION) + _cxxopts_check_version() + set(cxxopts_FOUND ${cxxopts_VERSION_OK}) + else() + set(cxxopts_FOUND TRUE) + endif() endif() if(cxxopts_FOUND)