xmake.lua 1.2 KB

1234567891011121314151617181920212223242526
  1. package("qhull")
  2. set_homepage("http://www.qhull.org/")
  3. set_description("Qhull computes the convex hull, Delaunay triangulation, Voronoi diagram, halfspace intersection about a point, furthest-site Delaunay triangulation, and furthest-site Voronoi diagram.")
  4. add_urls("https://github.com/qhull/qhull/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/qhull/qhull.git")
  6. add_versions("2020.2", "59356b229b768e6e2b09a701448bfa222c37b797a84f87f864f97462d8dbc7c5")
  7. add_deps("cmake")
  8. on_install(function (package)
  9. if package:is_plat("windows") and package:config("shared") then
  10. package:add("defines", "qh_dllimport")
  11. end
  12. local configs = {}
  13. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  14. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  15. table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON"))
  16. import("package.tools.cmake").install(package, configs)
  17. end)
  18. on_test(function (package)
  19. assert(package:has_cfuncs("qh_addpoint", {includes = "libqhull/libqhull.h"}))
  20. end)