From 93ee137d0f090ed96cb1fc698e3e1b85196427ab Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 17 Jun 2024 10:31:54 +0300 Subject: [PATCH] ceres-solver: add CXSparse to older versions --- recipes/ceres-solver/all/conanfile.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes/ceres-solver/all/conanfile.py b/recipes/ceres-solver/all/conanfile.py index 45178db860efa..51abf39a9358b 100644 --- a/recipes/ceres-solver/all/conanfile.py +++ b/recipes/ceres-solver/all/conanfile.py @@ -147,6 +147,8 @@ def requirements(self): if self.options.get_safe("use_suitesparse"): self.requires("suitesparse-cholmod/5.2.1") self.requires("suitesparse-spqr/4.3.3") + if Version(self.version) < "2.2.0": + self.requires("suitesparse-cxsparse/4.4.0") if self.options.get_safe("use_lapack"): self.requires("openblas/0.3.27") if self._require_metis: @@ -217,7 +219,7 @@ def generate(self): tc.variables["ACCELERATESPARSE"] = self.options.get_safe("use_accelerate", False) if ceres_version < "2.2.0": - tc.variables["CXSPARSE"] = False + tc.variables["CXSPARSE"] = self.options.get_safe("use_suitesparse", False) tc.variables["MSVC_USE_STATIC_CRT"] = is_msvc_static_runtime(self) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" if ceres_version < "2.1.0": @@ -233,6 +235,7 @@ def generate(self): deps.set_property("openblas", "cmake_file_name", "LAPACK") deps.set_property("metis", "cmake_file_name", "METIS") deps.set_property("metis", "cmake_target_name", "METIS::METIS") + deps.set_property("suitesparse-cxsparse", "cmake_target_name", "CXSparse::CXSparse") deps.generate() def _patch_sources(self): @@ -297,6 +300,8 @@ def package_info(self): if self.options.get_safe("use_suitesparse"): requires.append("suitesparse-cholmod::suitesparse-cholmod") requires.append("suitesparse-spqr::suitesparse-spqr") + if Version(self.version) < "2.2.0": + requires.append("suitesparse-cxsparse::suitesparse-cxsparse") if self.options.get_safe("use_lapack"): requires.append("openblas::openblas") if self._require_metis: