Skip to content

Commit

Permalink
ceres-solver: add CXSparse to older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Jun 17, 2024
1 parent dfae58c commit 93ee137
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion recipes/ceres-solver/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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":
Expand All @@ -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):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 93ee137

Please sign in to comment.