2
0

xmake.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("magnum-extras")
  2. set_homepage("https://magnum.graphics/")
  3. set_description("Extras for magnum, Lightweight and modular C++11/C++14 graphics middleware for games and data visualization.")
  4. set_license("MIT")
  5. add_urls("https://github.com/mosra/magnum-extras/archive/refs/tags/$(version).zip",
  6. "https://github.com/mosra/magnum-extras.git")
  7. add_versions("v2020.06", "9a53b503b45580dbaa54f852f65755330f5ace81be9d2a4c4605091d5f58d9bb")
  8. add_configs("ui", {description = "Build the ui library.", default = false, type = "boolean"})
  9. add_configs("player", {description = "Build the magnum-player executable.", default = false, type = "boolean"})
  10. add_configs("ui_gallery", {description = "Build the magnum-ui-gallery executable.", default = false, type = "boolean"})
  11. add_deps("cmake", "magnum")
  12. on_install("windows", "linux", "macosx", function (package)
  13. local configs = {"-DBUILD_TESTS=OFF", "-DLIB_SUFFIX="}
  14. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  15. table.insert(configs, "-DBUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON"))
  16. table.insert(configs, "-DWITH_UI=" .. (package:config("ui") and "ON" or "OFF"))
  17. table.insert(configs, "-DWITH_PLAYER=" .. (package:config("player") and "ON" or "OFF"))
  18. table.insert(configs, "-DWITH_UI_GALLERY=" .. (package:config("ui_gallery") and "ON" or "OFF"))
  19. import("package.tools.cmake").install(package, configs)
  20. end)
  21. on_test(function (package)
  22. assert(package:check_cxxsnippets({test = [[
  23. void test() {
  24. auto year = MAGNUMEXTRAS_VERSION_YEAR;
  25. auto month = MAGNUMEXTRAS_VERSION_MONTH;
  26. }
  27. ]]}, {configs = {languages = "c++14"}, includes = "Magnum/versionExtras.h"}))
  28. end)