xmake.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package("cli11")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/CLIUtils/CLI11")
  4. set_description("CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface.")
  5. set_license("BSD")
  6. add_urls("https://github.com/CLIUtils/CLI11/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/CLIUtils/CLI11.git")
  8. add_versions("v2.6.1", "377691f3fac2b340f12a2f79f523c780564578ba3d6eaf5238e9f35895d5ba95")
  9. add_versions("v2.5.0", "17e02b4cddc2fa348e5dbdbb582c59a3486fa2b2433e70a0c3bacb871334fd55")
  10. add_versions("v2.4.2", "f2d893a65c3b1324c50d4e682c0cdc021dd0477ae2c048544f39eed6654b699a")
  11. add_versions("v2.4.1", "73b7ec52261ce8fe980a29df6b4ceb66243bb0b779451dbd3d014cfec9fdbb58")
  12. add_versions("v2.3.2", "aac0ab42108131ac5d3344a9db0fdf25c4db652296641955720a4fbe52334e22")
  13. add_versions("v2.2.0", "d60440dc4d43255f872d174e416705f56ba40589f6eb07727f76376fb8378fd6")
  14. add_configs("cmake", {description = "Use cmake build system", default = true, type = "boolean"})
  15. if not is_host("windows") then
  16. add_extsources("pkgconfig::CLI11")
  17. end
  18. if is_plat("windows", "mingw") then
  19. add_syslinks("shell32")
  20. end
  21. on_load(function (package)
  22. if package:config("cmake") then
  23. package:add("deps", "cmake")
  24. end
  25. end)
  26. on_install(function (package)
  27. if package:config("cmake") then
  28. import("package.tools.cmake").install(package, {
  29. "-DBUILD_TESTING=OFF",
  30. "-DCLI11_BUILD_EXAMPLES=OFF",
  31. "-DCLI11_INSTALL=ON",
  32. })
  33. else
  34. os.cp("include", package:installdir())
  35. end
  36. end)
  37. on_test(function (package)
  38. assert(package:check_cxxsnippets({test = [[
  39. CLI::App app{"Test", "test"};
  40. ]]}, {configs = {languages = "cxx11"}, includes = "CLI/CLI.hpp"}))
  41. end)