Skip to content

Commit

Permalink
(#9139) ceres-solver: setup options in configure + validate
Browse files Browse the repository at this point in the history
Following up from #8902 (comment)
  • Loading branch information
prince-chrismc authored Jan 31, 2022
1 parent 991e67f commit 3464f4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion recipes/ceres-solver/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ def config_options(self):
def configure(self):
if self.options.shared:
del self.options.fPIC
if self.options.use_gflags:
self.options["gflags"].nothreads = False

def requirements(self):
self.requires("eigen/3.4.0")
if self.options.use_glog:
self.requires("glog/0.5.0")
if self.options.use_gflags:
self.requires("gflags/2.2.2")
self.options["gflags"].nothreads = False
if self.options.use_TBB:
self.requires("tbb/2020.3")

Expand All @@ -97,6 +98,8 @@ def validate(self):
raise ConanInvalidConfiguration("Ceres-solver only links against the release version of glog")
if self.options.use_glog and not self.options.use_gflags: #At this stage we can't check the value of self.options["glog"].with_gflags so we asume it is true because is the default value
raise ConanInvalidConfiguration("To depend on glog built with gflags (Default behavior) set use_gflags=True, otherwise Ceres may fail to link due to missing gflags symbols.")
if self.options.use_gflags and self.options["gflags"].nothreads:
raise ConanInvalidConfiguration("Ceres-solver requires options gflags:nothreads=False") # This could use a source as to why
if tools.Version(self.version) >= "2.0":
# 1.x uses ceres-solver specific FindXXX.cmake modules
self.generators.append("cmake_find_package")
Expand Down

0 comments on commit 3464f4e

Please sign in to comment.