xmake.lua 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. package("extra-cmake-modules")
  2. set_homepage("https://invent.kde.org/frameworks/extra-cmake-modules")
  3. set_description("Extra CMake Modules (ECM) extends CMake with additional modules and scripts.")
  4. add_urls("https://invent.kde.org/frameworks/extra-cmake-modules/-/archive/v$(version)/extra-cmake-modules-$(version).tar.gz" , {alias = "gitlab"})
  5. add_urls("https://github.com/KDE/extra-cmake-modules/archive/refs/tags/$(version).tar.gz", {alias = "github"})
  6. add_urls("https://github.com/KDE/extra-cmake-modules.git")
  7. add_versions("github:v6.10.0", "96970136cf38c810f4ef90a33ad4ef9c8977956e1a6a02a179b7abf3a8967b34")
  8. add_versions("gitlab:v6.10.0", "6025709712e075f06c3b9eebfffc50ce31605712d8947c748d9b2241e915f595")
  9. if is_plat("mingw") and is_subhost("msys") then
  10. add_extsources("pacman::extra-cmake-modules")
  11. elseif is_plat("linux") then
  12. add_extsources("pacman::extra-cmake-modules", "apt::extra-cmake-modules")
  13. elseif is_plat("macosx") then
  14. add_extsources("brew::extra-cmake-modules")
  15. end
  16. add_deps("cmake")
  17. on_install(function (package)
  18. local configs = {"-DBUILD_DOC=OFF", "-DBUILD_TESTING=OFF"}
  19. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  20. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  21. import("package.tools.cmake").install(package, configs)
  22. end)
  23. on_test(function (package)
  24. assert(os.isfile(package:installdir("share", "ECM", "cmake", "ECMConfig.cmake")))
  25. end)