xmake.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package("pmp")
  2. set_homepage("http://www.pmp-library.org/")
  3. set_description("The Polygon Mesh Processing Library")
  4. set_license("MIT")
  5. add_urls("https://github.com/pmp-library/pmp-library/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/pmp-library/pmp-library.git")
  7. add_versions("1.2.1", "4c9e6554a986710cec1e19dd67695d8ae65ce02a19100dcf1ba7e17f2f993e3b")
  8. add_configs("utils", {description = "Build utilities.", default = false, type = "boolean"})
  9. add_deps("cmake")
  10. add_deps("eigen", "glfw", "glew", "rply")
  11. on_install("windows", "macosx", "linux", function (package)
  12. local configs = {}
  13. if package:is_plat("linux") and package:config("pic") ~= false then
  14. configs.cxflags = "-fPIC"
  15. end
  16. configs.utils = package:config("utils")
  17. os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
  18. import("package.tools.xmake").install(package, configs)
  19. if package:config("utils") then
  20. package:addenv("PATH", "bin")
  21. end
  22. end)
  23. on_test(function (package)
  24. assert(package:check_cxxsnippets({test = [[
  25. void test() {
  26. pmp::SurfaceMesh mesh;
  27. pmp::Vertex v0, v1, v2, v3;
  28. v0 = mesh.add_vertex(pmp::Point(0, 0, 0));
  29. v1 = mesh.add_vertex(pmp::Point(1, 0, 0));
  30. v2 = mesh.add_vertex(pmp::Point(0, 1, 0));
  31. v3 = mesh.add_vertex(pmp::Point(0, 0, 1));
  32. }
  33. ]]}, {configs = {languages = "c++11"}, includes = "pmp/SurfaceMesh.h"}))
  34. end)