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 4bd6614 commit c75c185
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cmake-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ jobs:
run: |
pip install --upgrade conan
CONAN_ARGS="--profile .github/workflows/conan/profiles/${{ matrix.profile }} \
-o with_boost=${H5CPP_WITH_BOOST} \
-o with_mpi=${H5CPP_WITH_MPI} \
-o shared=${H5CPP_SHARED} \
-o &:with_boost=${H5CPP_WITH_BOOST} \
-o &:with_mpi=${H5CPP_WITH_MPI} \
-o &:shared=${H5CPP_SHARED} \
-o *:shared=${H5CPP_SHARED}"
conan profile detect
conan remove -c zlib/*
Expand Down
22 changes: 11 additions & 11 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ 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 = {
"&:shared": False,
"shared": False,
"fPIC": True,
"&:with_mpi": False,
"&:with_boost": True,
"with_mpi": False,
"with_boost": True,
"hdf5/*:hl": True,
"hdf5/*:parallel": False,
"hdf5/*:enable_cxx": False,
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 c75c185

Please sign in to comment.