Skip to content

Commit

Permalink
(conan-io#15077) Update to h5pp/1.11.0
Browse files Browse the repository at this point in the history
* Update to h5pp/1.11.0

* use hdf5/1.12.1 for h5pp/1.10.0 and older

* made changes suggested by the conan v2 migration linter

* made more changes suggested by the conan v2 migration linter

* Update recipes/h5pp/all/conanfile.py

Co-authored-by: Jordan Williams <jordan@jwillikers.com>

* Update recipes/h5pp/all/conanfile.py

Co-authored-by: Jordan Williams <jordan@jwillikers.com>

* Dummy commit to re-run the pr checks

Co-authored-by: Jordan Williams <jordan@jwillikers.com>
  • Loading branch information
2 people authored and StellaSmith committed Feb 2, 2023
1 parent 9e38202 commit 6c230ad
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
3 changes: 3 additions & 0 deletions recipes/h5pp/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ sources:
"1.10.0":
sha256: 27a3e42ed02d8d9341229d58a517134753e1ea46dab4c40d01bb309098c32f13
url: https://github.com/DavidAce/h5pp/archive/v1.10.0.tar.gz
"1.11.0":
sha256: 1c4171275eb50a26ed9da8055397f03a726896c4c49ad0380b16dcb13574ecff
url: https://github.com/DavidAce/h5pp/archive/v1.11.0.tar.gz
38 changes: 22 additions & 16 deletions recipes/h5pp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from conan import ConanFile
from conan.tools.microsoft import is_msvc
from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
from conan.tools.scm import Version
from conan.tools.files import get
from conan.tools.build import check_min_cppstd
from conan.errors import ConanInvalidConfiguration
import os

required_conan_version = ">=1.45.0"

required_conan_version = ">=1.50.0"

class H5ppConan(ConanFile):
name = "h5pp"
Expand Down Expand Up @@ -39,7 +41,7 @@ def _compilers_minimum_version(self):
}

def config_options(self):
if tools.Version(self.version) < "1.10.0":
if Version(self.version) < "1.10.0":
# These dependencies are always required before h5pp 1.10.0:
# * h5pp < 1.10.0 includes any version of headers indiscriminately (e.g. system headers),
# and can't tell if the the corresponding library will be linked. This makes the,
Expand All @@ -50,32 +52,36 @@ def config_options(self):
del self.options.with_spdlog

def requirements(self):
self.requires("hdf5/1.12.1")
if tools.Version(self.version) < "1.10.0" or self.options.get_safe('with_eigen'):
if Version(self.version) < "1.10.0":
self.requires("hdf5/1.12.1")
else:
self.requires("hdf5/1.13.1")

if Version(self.version) < "1.10.0" or self.options.get_safe('with_eigen'):
self.requires("eigen/3.4.0")
if tools.Version(self.version) < "1.10.0" or self.options.get_safe('with_spdlog'):
self.requires("spdlog/1.10.0")
if Version(self.version) < "1.10.0" or self.options.get_safe('with_spdlog'):
self.requires("spdlog/1.11.0")

def package_id(self):
self.info.header_only()
self.info.clear()

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, 17)
check_min_cppstd(self, 17)
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version:
if tools.Version(self.settings.compiler.version) < minimum_version:
if Version(self.settings.compiler.version) < minimum_version:
raise ConanInvalidConfiguration("h5pp requires C++17, which your compiler does not support.")
else:
self.output.warn("h5pp requires C++17. Your compiler is unknown. Assuming it supports C++17.")

def source(self):
tools.get(**self.conan_data["sources"][self.version],
get(self,**self.conan_data["sources"][self.version],
destination=self._source_subfolder, strip_root=True)

def package(self):
self.copy("LICENSE", src=self._source_subfolder, dst="licenses")
if tools.Version(self.version) < "1.9.0":
if Version(self.version) < "1.9.0":
includedir = os.path.join(self._source_subfolder, "h5pp", "include")
else:
includedir = os.path.join(self._source_subfolder, "include")
Expand All @@ -89,7 +95,7 @@ def package_info(self):
self.cpp_info.components["h5pp_flags"].set_property("cmake_target_name", "h5pp::flags")
self.cpp_info.components["h5pp_deps"].requires = ["hdf5::hdf5"]

if tools.Version(self.version) >= "1.10.0":
if Version(self.version) >= "1.10.0":
if self.options.with_eigen:
self.cpp_info.components["h5pp_deps"].requires.append("eigen::eigen")
self.cpp_info.components["h5pp_flags"].defines.append("H5PP_USE_EIGEN3")
Expand All @@ -101,7 +107,7 @@ def package_info(self):
self.cpp_info.components["h5pp_deps"].requires.append("eigen::eigen")
self.cpp_info.components["h5pp_deps"].requires.append("spdlog::spdlog")

if (self.settings.compiler == "gcc" and tools.Version(self.settings.compiler.version) < "9") or \
if (self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9") or \
(self.settings.compiler == "clang" and self.settings.compiler.get_safe("libcxx") in ["libstdc++", "libstdc++11"]):
self.cpp_info.components["h5pp_flags"].system_libs = ["stdc++fs"]
if is_msvc(self):
Expand Down
2 changes: 2 additions & 0 deletions recipes/h5pp/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ versions:
folder: "all"
"1.10.0":
folder: "all"
"1.11.0":
folder: "all"

0 comments on commit 6c230ad

Please sign in to comment.