add openscenegraph (#1429)

* update cmake

* add openscenegraph

* fix osg
pull/1431/head
Hoildkv 2 years ago committed by GitHub
parent bae0137abb
commit 980dcd3ffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/c/cmake/xmake.lua
  2. 66
      packages/o/openscenegraph/xmake.lua

@ -16,6 +16,7 @@ package("cmake")
add_versions("3.18.4", "9d27049660474cf134ab46fa0e0db771b263313fcb8ba82ee8b2d1a1a62f8f20")
add_versions("3.21.0", "c1c6f19dfc9c658a48b5aed22806595b2337bb3aedb71ab826552f74f568719f")
add_versions("3.22.1", "9ba46ce69d524f5bcdf98076a6b01f727604fb31cf9005ec03dea1cf16da9514")
add_versions("3.24.1", "71bb8db69826d74c395a3c3bbf8b773dbe9f54a2c7331266ba70da303e9c97a1")
elseif is_host("linux") and os.arch() == "x86_64" then
add_urls("https://cmake.org/files/v$(version)-x86_64.tar.gz", {version = function (version)
return table.concat(table.slice((version):split('%.'), 1, 2), '.') .. "/cmake-" .. version .. (version:ge("3.20") and "-linux" or "-Linux")
@ -28,6 +29,7 @@ package("cmake")
add_versions("3.18.4", "149e0cee002e59e0bb84543cf3cb099f108c08390392605e944daeb6594cbc29")
add_versions("3.21.0", "d54ef6909f519740bc85cec07ff54574cd1e061f9f17357d9ace69f61c6291ce")
add_versions("3.22.1", "73565c72355c6652e9db149249af36bcab44d9d478c5546fd926e69ad6b43640")
add_versions("3.24.1", "827bf068cfaa23a9fb95f990c9f8a7ed8f2caeb3af62b5c0a2fed7a8dd6dde3e")
elseif is_host("windows") then
if os.arch() == "x64" then
add_urls("https://cmake.org/files/v$(version).zip", {excludes = {"*/doc/*"}, version = function (version)
@ -41,8 +43,9 @@ package("cmake")
add_versions("3.18.4", "a932bc0c8ee79f1003204466c525b38a840424d4ae29f9e5fb88959116f2407d")
add_versions("3.21.0", "c7b88c907a753f4ec86e43ddc89f91f70bf1b011859142f7f29e6d51ea4abb3c")
add_versions("3.22.1", "35fbbb7d9ffa491834bbc79cdfefc6c360088a3c9bf55c29d111a5afa04cdca3")
add_versions("3.24.1", "c1b17431a16337d517f7ba78c7067b6f143a12686cb8087f3dd32f3fa45f5aae")
else
add_urls("https://cmake.org/files/v$(version)-win32-x86.zip", {excludes = {"*/doc/*"}, version = function (version)
add_urls("https://cmake.org/files/v$(version).zip", {excludes = {"*/doc/*"}, version = function (version)
return table.concat(table.slice((version):split('%.'), 1, 2), '.') .. "/cmake-" .. version .. (version:ge("3.20") and "-windows-i386" or "-win32-x86")
end})
add_urls("https://github.com/Kitware/CMake/releases/download/v$(version).zip", {excludes = {"*/doc/*"}, version = function (version)
@ -53,12 +56,14 @@ package("cmake")
add_versions("3.18.4", "4c519051853686927f87df99669ada3ff15a3086535a7131892febd7c6e2f122")
add_versions("3.21.0", "11ee86b7f9799724fc16664c63e308bfe3fbc22c9df8ef4955ad4b248f3e680b")
add_versions("3.22.1", "f53494e3b35e5a1177ad55c28763eb5bb45772c1d80778c0f96c45ce4376b6e8")
add_versions("3.24.1", "a0b894e2a814d2353f1e581eb6ca3c878a39c071624495729dbcf9978e1579f2")
end
else
add_urls("https://github.com/Kitware/CMake/releases/download/v$(version)/cmake-$(version).tar.gz")
add_versions("3.18.4", "597c61358e6a92ecbfad42a9b5321ddd801fc7e7eca08441307c9138382d4f77")
add_versions("3.21.0", "4a42d56449a51f4d3809ab4d3b61fd4a96a469e56266e896ce1009b5768bd2ab")
add_versions("3.22.1", "0e998229549d7b3f368703d20e248e7ee1f853910d42704aa87918c213ea82c0")
add_versions("3.24.1", "4931e277a4db1a805f13baa7013a7757a0cbfe5b7932882925c7061d9d1fa82b")
end
if is_plat("mingw") and is_subhost("msys") then

@ -0,0 +1,66 @@
package("openscenegraph")
set_homepage("https://www.openscenegraph.com/")
set_description("The OpenSceneGraph is an open source high performance 3D graphics toolkit.")
add_urls("https://github.com/openscenegraph/OpenSceneGraph/archive/refs/tags/OpenSceneGraph-$(version).tar.gz",
"https://github.com/openscenegraph/OpenSceneGraph.git")
add_versions("3.6.5", "aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12")
add_configs("tools", {description = "Enable to build OSG Applications.", default = false, type = "boolean"})
local configdeps = {fontconfig = "fontconfig",
freetype = "Freetype",
jasper = "Jasper",
openexr = "OpenEXR",
colladadom = "COLLADA",
dcmtk = "DCMTK",
ffmpeg = "FFmpeg",
glib = "GLIB",
libsdl = "SDL2",
nvtt = "NVTT"}
for config, dep in pairs(configdeps) do
add_configs(config, {description = "Enable the " .. config .. " plugin.", default = false, type = "boolean"})
end
add_deps("cmake")
add_deps("libjpeg-turbo", "libpng", "giflib", "libtiff")
if is_plat("linux") then
add_syslinks("pthread")
end
on_load("windows", "linux", "macosx", function (package)
for config, dep in pairs(configdeps) do
if package:config(config) then
package:add("deps", config)
end
end
if package:is_plat("windows") and not package:config("shared") then
package:add("defines", "OSG_LIBRARY_STATIC")
end
end)
on_install("windows", "linux", "macosx", function (package)
local configs = {"-DBUILD_OSG_EXAMPLES=OFF"}
local disabled_packages = {"ilmbase", "Inventor", "OpenCascade", "FBX", "GDAL", "GTA", "CURL", "LibVNCServer", "GStreamer", "SDL", "Poppler", "RSVG", "GtkGl", "Asio", "ZeroConf", "LIBLAS"}
for _, pkg in ipairs(disabled_packages) do
table.insert(configs, "-DCMAKE_DISABLE_FIND_PACKAGE_" .. pkg .. "=ON")
end
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DDYNAMIC_OPENSCENEGRAPH=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DDYNAMIC_OPENTHREADS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DBUILD_OSG_APPLICATIONS=" .. (package:config("tools") and "ON" or "OFF"))
for config, dep in pairs(configdeps) do
table.insert(configs, "-DCMAKE_DISABLE_FIND_PACKAGE_" .. dep .. "=" .. (package:config(config) and "OFF" or "ON"))
end
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test(int argc, char* argv[]) {
bool help = false;
osg::ArgumentParser arguments(&argc, argv);
while(arguments.read("--help")) help = true;
}
]]}, {configs = {languages = "c++11"}, includes = "osg/ArgumentParser"}))
end)
Loading…
Cancel
Save