xmake.lua 1.2 KB

123456789101112131415161718192021222324
  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("windows", "macosx", "linux", "mingw", function (package)
  9. local configs = {}
  10. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  11. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  12. table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON"))
  13. if package:config("pic") ~= false then
  14. table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
  15. end
  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)