Skip to content

Commit

Permalink
update options
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotan committed Nov 7, 2024
1 parent e0dde9a commit 4bd6614
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class H5CppConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeToolchain", "CMakeDeps"
options = {
"shared": [True, False],
"&:shared": [True, False],
"fPIC": [True, False],
"with_mpi": [True, False],
"with_boost": [True, False],
"&:with_mpi": [True, False],
"&:with_boost": [True, False],
"install_prefix": [None, "ANY"]
}
default_options = {
Expand All @@ -35,7 +35,7 @@ def config_options(self):
del self.options.with_mpi

def configure(self):
if self.options.get_safe("with_mpi", False):
if self.options.get_safe("&:with_mpi", False):
self.options["hdf5"].parallel = True

def requirements(self):
Expand All @@ -45,14 +45,14 @@ def requirements(self):
self.requires("szip/2.1.1")
self.requires("bzip2/1.0.8")

if self.options.get_safe("with_boost", False):
if self.options.get_safe("&:with_boost", False):
if self.settings.os == "Windows":
self.requires("boost/1.81.0")
elif self.settings.os == "Macos":
self.requires("boost/1.81.0")
else:
self.requires("boost/1.81.0")
if self.options.get_safe("with_mpi", False):
if self.options.get_safe("&:with_mpi", False):
self.requires("openmpi/4.1.0")

def build(self):
Expand All @@ -64,9 +64,9 @@ def build(self):
variables = {
"H5CPP_CONAN": "MANUAL",
"H5CPP_WITH_MPI":
self.options.get_safe("with_mpi", False),
self.options.get_safe("&:with_mpi", False),
"H5CPP_WITH_BOOST":
self.options.get_safe("with_boost", False)}
self.options.get_safe("&:with_boost", False)}
insprefix = self.options.get_safe("install_prefix", None)
if insprefix:
variables["CMAKE_INSTALL_PREFIX"] = insprefix
Expand Down

0 comments on commit 4bd6614

Please sign in to comment.