xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728
  1. package("manif")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://artivis.github.io/manif")
  4. set_description("A small C++11 header-only library for Lie theory.")
  5. set_license("MIT")
  6. add_urls("https://github.com/artivis/manif/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/artivis/manif.git")
  8. add_versions("0.0.5", "246a781c54a5c57179d48096faca0d108944e120f69d8fd7fb69e3cb4a0a67fb")
  9. add_deps("cmake")
  10. add_deps("eigen", "tl_optional")
  11. on_install(function (package)
  12. local configs = {"-DUSE_SYSTEM_WIDE_TL_OPTIONAL=ON"}
  13. io.replace("CMakeLists.txt", "find_package(tl-optional 1.0.0 QUIET)", "find_package(tl-optional)", {plain = true})
  14. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  15. import("package.tools.cmake").install(package, configs)
  16. end)
  17. on_test(function (package)
  18. assert(package:check_cxxsnippets({test = [[
  19. void test() {
  20. auto state = manif::SE3d::Identity();
  21. }
  22. ]]}, {configs = {languages = "c++11"}, includes = {"manif/manif.h"}}))
  23. end)