alembic: support more platform (#5813)

* alembic: support more platform

* disable tools config

* patch mingw
pull/5816/head
star9029 2 days ago committed by GitHub
parent 5ef78d33d7
commit ff961fffbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 64
      packages/a/alembic/xmake.lua

@ -1,30 +1,76 @@
package("alembic") package("alembic")
set_homepage("https://alembic.io/") set_homepage("https://alembic.io/")
set_description("Open framework for storing and sharing scene data that includes a C++ library, a file format, and client plugins and applications.") set_description("Open framework for storing and sharing scene data that includes a C++ library, a file format, and client plugins and applications.")
set_license("BSD-3-Clause") set_license("BSD-3-Clause")
add_urls("https://github.com/alembic/alembic/archive/refs/tags/$(version).tar.gz", add_urls("https://github.com/alembic/alembic/archive/refs/tags/$(version).tar.gz",
"https://github.com/alembic/alembic.git") "https://github.com/alembic/alembic.git")
add_versions("1.8.7", "6de0b97cd14dcfb7b2d0d788c951b6da3c5b336c47322ea881d64f18575c33da") add_versions("1.8.7", "6de0b97cd14dcfb7b2d0d788c951b6da3c5b336c47322ea881d64f18575c33da")
add_versions("1.8.6", "c572ebdea3a5f0ce13774dd1fceb5b5815265cd1b29d142cf8c144b03c131c8c") add_versions("1.8.6", "c572ebdea3a5f0ce13774dd1fceb5b5815265cd1b29d142cf8c144b03c131c8c")
add_versions("1.8.5", "180a12f08d391cd89f021f279dbe3b5423b1db751a9898540c8059a45825c2e9") add_versions("1.8.5", "180a12f08d391cd89f021f279dbe3b5423b1db751a9898540c8059a45825c2e9")
add_deps("cmake", "imath") add_configs("arnold", {description = "Include Arnold stuff", default = false, type = "boolean"})
if is_plat("linux") then add_configs("hdf5", {description = "Include HDF5 stuff", default = false, type = "boolean"})
add_syslinks("m") add_configs("maya", {description = "Include maya stuff", default = false, type = "boolean"})
add_configs("prman", {description = "Include prman stuff", default = false, type = "boolean"})
add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
if is_plat("linux", "bsd") then
add_syslinks("m", "pthread")
end end
on_load("windows", function (package)
if package:config("shared") then add_deps("cmake", "imath")
on_load(function (package)
if package:is_plat("windows") and package:config("shared") then
package:add("defines", "ALEMBIC_DLL") package:add("defines", "ALEMBIC_DLL")
end end
if package:config("tools") then
package:config_set("hdf5", true)
end
if package:config("hdf5") then
package:add("deps", "hdf5", {configs = {zlib = true}})
end
end) end)
on_install("windows", "macosx", "linux", function (package) on_install(function (package)
local configs = {"-DBUILD_TESTING=OFF"} if package:is_plat("windows", "mingw") then
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) io.replace("lib/Alembic/Ogawa/OStream.cpp", "#include <stdexcept>", "#include <stdexcept>\n#include <Windows.h>", {plain = true})
end
local configs = {
"-DBUILD_TESTING=OFF",
"-DUSE_TESTS=OFF",
"-DALEMBIC_DEBUG_WARNINGS_AS_ERRORS=OFF",
}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DALEMBIC_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DALEMBIC_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
if package:is_plat("windows") then
table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''")
end
table.insert(configs, "-DUSE_ARNOLD=" .. (package:config("arnold") and "ON" or "OFF"))
table.insert(configs, "-DUSE_MAYA=" .. (package:config("maya") and "ON" or "OFF"))
table.insert(configs, "-DUSE_PRMAN=" .. (package:config("prman") and "ON" or "OFF"))
table.insert(configs, "-DUSE_BINARIES=" .. (package:config("tools") and "ON" or "OFF"))
local hdf5 = package:dep("hdf5")
if hdf5 then
table.insert(configs, "-DUSE_HDF5=ON")
table.insert(configs, "-DUSE_STATIC_HDF5=" .. (hdf5:config("shared") and "OFF" or "ON"))
else
table.insert(configs, "-DUSE_HDF5=OFF")
end
import("package.tools.cmake").install(package, configs) import("package.tools.cmake").install(package, configs)
if package:is_plat("windows") and package:is_debug() then
local dir = package:installdir(package:config("shared") and "bin" or "lib")
os.vcp(path.join(package:buildir(), "lib/**.pdb"), dir)
os.vcp(path.join(package:buildir(), "bin/**.pdb"), package:installdir("bin"))
end
end) end)
on_test(function (package) on_test(function (package)

Loading…
Cancel
Save