xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. package("libminc")
  2. set_homepage("https://github.com/BIC-MNI/libminc")
  3. set_description("libminc is the core library and API of the MINC toolkit")
  4. set_urls("https://github.com/BIC-MNI/libminc/archive/refs/tags/release-$(version).tar.gz",
  5. "https://github.com/BIC-MNI/libminc.git")
  6. add_versions("2.4.06", "2d8b01e67322507000dbfa3e46fa38e12d5c72eb535b169a33a6c5c53202cf90")
  7. add_patches("2.4.06", "patches/2.4.06/libminc.patch", "80f00f422f9a59cd6627879c1c51d62a6b1bd379049fe3d86a2663bf7c60b0fb")
  8. if is_plat("windows") then
  9. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  10. end
  11. add_deps("cmake", "hdf5", "zlib")
  12. if is_plat("linux") then
  13. add_extsources("apt::libminc-dev")
  14. end
  15. on_install("windows", "linux", "macosx", "bsd", function (package)
  16. local configs = {
  17. "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"),
  18. "-DLIBMINC_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"),
  19. "-DBUILD_TESTING=OFF",
  20. }
  21. import("package.tools.cmake").install(package, configs)
  22. end)
  23. on_test(function (package)
  24. assert(package:has_cfuncs("miopen_volume", {includes = "minc2.h"}))
  25. end)