xmake.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. package("cdt")
  2. set_homepage("https://artem-ogre.github.io/CDT/")
  3. set_description("Constrained Delaunay Triangulation (C++)")
  4. set_license("MPL-2.0")
  5. add_urls("https://github.com/artem-ogre/CDT/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/artem-ogre/CDT.git")
  7. add_versions("1.4.1", "86df99eb5f02a73eeb8c6ea45765eed0d7f206e8d4d9f6479f77e3c590ae5bb3")
  8. add_deps("cmake")
  9. on_install(function (package)
  10. os.cd("CDT")
  11. local configs = {"-DCDT_USE_AS_COMPILED_LIBRARY=ON"}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. import("package.tools.cmake").install(package, configs)
  15. end)
  16. on_test(function (package)
  17. assert(package:check_cxxsnippets({test = [[
  18. #include <CDT.h>
  19. using namespace CDT;
  20. void test() {
  21. auto cdt = Triangulation<double>{};
  22. cdt.insertVertices({
  23. {0.0, 1e38},
  24. {1.0, 1e38},
  25. });
  26. }
  27. ]]}, {configs = {languages = "cxx17"}}))
  28. end)