xmake.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("highfive")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/BlueBrain/HighFive")
  4. set_description("HighFive - Header-only C++ HDF5 interface")
  5. add_urls("https://github.com/BlueBrain/HighFive/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/BlueBrain/HighFive.git")
  7. add_versions("v2.6.1", "b5002c1221cf1821e02fb2ab891b0160bac88b43f56655bd844a472106ca3397")
  8. add_versions("v2.3.1", "41728a1204bdfcdcef8cbc3ddffe5d744c5331434ce3dcef35614b831234fcd7")
  9. add_patches("v2.6.1", path.join(os.scriptdir(), "patches", "fix-find-hdf5.patch"), "6a37e12f1796394d7691b36561829bf220336ec42a736c103509ac93537a36c9")
  10. add_patches("v2.3.1", path.join(os.scriptdir(), "patches", "fix-find-hdf5.patch"), "6a37e12f1796394d7691b36561829bf220336ec42a736c103509ac93537a36c9")
  11. add_deps("cmake")
  12. add_deps("hdf5")
  13. on_install("windows", "macosx", "linux", function (package)
  14. local configs = {"-DHIGHFIVE_UNIT_TESTS=OFF",
  15. "-DHIGHFIVE_EXAMPLES=OFF",
  16. "-DHIGHFIVE_BUILD_DOCS=OFF",
  17. "-DHIGHFIVE_USE_BOOST=OFF"}
  18. import("package.tools.cmake").install(package, configs)
  19. end)
  20. on_test(function (package)
  21. assert(package:check_cxxsnippets({test = [[
  22. #include <highfive/H5File.hpp>
  23. using namespace HighFive;
  24. void test() {
  25. File file("/tmp/new_file.h5", File::ReadWrite | File::Create | File::Truncate);
  26. std::vector<int> data(50, 1);
  27. DataSet dataset = file.createDataSet<int>("/dataset_one", DataSpace::From(data));
  28. dataset.write(data);
  29. }
  30. ]]}, {configs = {languages = "c++17"}}))
  31. end)