xmake.lua 1.2 KB

123456789101112131415161718192021222324252627282930
  1. package("verdict")
  2. set_homepage("https://github.com/sandialabs/verdict")
  3. set_description("Compute quality functions of 2 and 3-dimensional regions.")
  4. add_urls("https://github.com/sandialabs/verdict/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/sandialabs/verdict.git")
  6. add_versions("1.4.2", "225c8c5318f4b02e7215cefa61b5dc3f99e05147ad3fefe6ee5a3ee5b828964b")
  7. add_deps("cmake")
  8. on_install(function (package)
  9. local configs = {"-DVERDICT_ENABLE_TESTING=OFF"}
  10. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  11. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  12. import("package.tools.cmake").install(package, configs)
  13. if package:config("shared") then
  14. package:add("defines", "VERDICT_SHARED_LIB")
  15. end
  16. end)
  17. on_test(function (package)
  18. assert(package:check_cxxsnippets({test = [[
  19. #include <verdict.h>
  20. void test() {
  21. double coordinates[3][3];
  22. verdict::hex_edge_ratio(3, coordinates);
  23. }
  24. ]]}, {configs = {languages = "c++11"}}))
  25. end)