xmake.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("alembic")
  2. set_homepage("https://alembic.io/")
  3. set_description("Open framework for storing and sharing scene data that includes a C++ library, a file format, and client plugins and applications.")
  4. set_license("BSD-3-Clause")
  5. add_urls("https://github.com/alembic/alembic/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/alembic/alembic.git")
  7. add_versions("1.8.6", "c572ebdea3a5f0ce13774dd1fceb5b5815265cd1b29d142cf8c144b03c131c8c")
  8. add_versions("1.8.5", "180a12f08d391cd89f021f279dbe3b5423b1db751a9898540c8059a45825c2e9")
  9. add_deps("cmake", "imath")
  10. if is_plat("linux") then
  11. add_syslinks("m")
  12. end
  13. on_load("windows", function (package)
  14. if package:config("shared") then
  15. package:add("defines", "ALEMBIC_DLL")
  16. end
  17. end)
  18. on_install("windows", "macosx", "linux", function (package)
  19. local configs = {"-DBUILD_TESTING=OFF"}
  20. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  21. table.insert(configs, "-DALEMBIC_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  22. import("package.tools.cmake").install(package, configs)
  23. end)
  24. on_test(function (package)
  25. assert(package:check_cxxsnippets({test = [[
  26. #include <Alembic/Abc/All.h>
  27. void test() {
  28. Alembic::Abc::OArchive archive;
  29. Alembic::Abc::OObject object = archive.getTop();
  30. }
  31. ]]}, {configs = {languages = "c++14"}}))
  32. end)