|
@@ -7,6 +7,8 @@ package("openscenegraph")
|
|
"https://github.com/openscenegraph/OpenSceneGraph.git")
|
|
"https://github.com/openscenegraph/OpenSceneGraph.git")
|
|
add_versions("3.6.5", "aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12")
|
|
add_versions("3.6.5", "aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12")
|
|
|
|
|
|
|
|
+ add_patches("3.6.5", "patches/3.6.5/msvc.patch", "57b2cc3e5017f7932c5d758346ef0ede8be70f3265276fd8e04534367474eb55")
|
|
|
|
+
|
|
add_configs("tools", {description = "Enable to build OSG Applications.", default = false, type = "boolean"})
|
|
add_configs("tools", {description = "Enable to build OSG Applications.", default = false, type = "boolean"})
|
|
|
|
|
|
local configdeps = {fontconfig = "fontconfig",
|
|
local configdeps = {fontconfig = "fontconfig",
|
|
@@ -23,6 +25,18 @@ package("openscenegraph")
|
|
add_configs(config, {description = "Enable the " .. config .. " plugin.", default = false, type = "boolean"})
|
|
add_configs(config, {description = "Enable the " .. config .. " plugin.", default = false, type = "boolean"})
|
|
end
|
|
end
|
|
|
|
|
|
|
|
+ set_policy("platform.longpaths", true)
|
|
|
|
+
|
|
|
|
+ on_check("windows", function (package)
|
|
|
|
+ import("core.tool.toolchain")
|
|
|
|
+
|
|
|
|
+ local msvc = package:toolchain("msvc")
|
|
|
|
+ if msvc and package:is_arch("arm.*") then
|
|
|
|
+ local vs = msvc:config("vs")
|
|
|
|
+ assert(vs and tonumber(vs) >= 2022, "package(openscenegraph/arm): need vs >= 2022")
|
|
|
|
+ end
|
|
|
|
+ end)
|
|
|
|
+
|
|
add_deps("cmake")
|
|
add_deps("cmake")
|
|
add_deps("libjpeg-turbo", "libpng", "giflib", "libtiff")
|
|
add_deps("libjpeg-turbo", "libpng", "giflib", "libtiff")
|
|
if is_plat("linux") then
|
|
if is_plat("linux") then
|
|
@@ -40,12 +54,15 @@ package("openscenegraph")
|
|
end)
|
|
end)
|
|
|
|
|
|
on_install("windows", "linux", "macosx", function (package)
|
|
on_install("windows", "linux", "macosx", function (package)
|
|
- local configs = {"-DBUILD_OSG_EXAMPLES=OFF"}
|
|
|
|
|
|
+ io.replace("CMakeLists.txt", "FIND_PACKAGE(TIFF)", "FIND_PACKAGE(TIFF CONFIG)", {plain = true})
|
|
|
|
+ io.replace("src/osgPlugins/cfg/CMakeLists.txt", "-Wno-deprecated-register", "-Wno-deprecated-register -Wno-register", {plain = true})
|
|
|
|
+ io.replace("src/osgPlugins/tiff/CMakeLists.txt", "TARGET_LIBRARIES_VARS TIFF_LIBRARY", "TARGET_EXTERNAL_LIBRARIES TIFF::tiff", {plain = true})
|
|
|
|
+ local configs = {"-DBUILD_OSG_EXAMPLES=OFF", "-DOSG_MSVC_VERSIONED_DLL=OFF", "-DOSG_AGGRESSIVE_WARNINGS=OFF"}
|
|
local disabled_packages = {"ilmbase", "Inventor", "OpenCascade", "FBX", "GDAL", "GTA", "CURL", "LibVNCServer", "GStreamer", "SDL", "Poppler", "RSVG", "GtkGl", "Asio", "ZeroConf", "LIBLAS"}
|
|
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
|
|
for _, pkg in ipairs(disabled_packages) do
|
|
table.insert(configs, "-DCMAKE_DISABLE_FIND_PACKAGE_" .. pkg .. "=ON")
|
|
table.insert(configs, "-DCMAKE_DISABLE_FIND_PACKAGE_" .. pkg .. "=ON")
|
|
end
|
|
end
|
|
- table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
|
|
|
|
|
|
+ table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
|
|
table.insert(configs, "-DDYNAMIC_OPENSCENEGRAPH=" .. (package:config("shared") and "ON" or "OFF"))
|
|
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, "-DDYNAMIC_OPENTHREADS=" .. (package:config("shared") and "ON" or "OFF"))
|
|
table.insert(configs, "-DBUILD_OSG_APPLICATIONS=" .. (package:config("tools") and "ON" or "OFF"))
|
|
table.insert(configs, "-DBUILD_OSG_APPLICATIONS=" .. (package:config("tools") and "ON" or "OFF"))
|
|
@@ -53,6 +70,10 @@ package("openscenegraph")
|
|
table.insert(configs, "-DCMAKE_DISABLE_FIND_PACKAGE_" .. dep .. "=" .. (package:config(config) and "OFF" or "ON"))
|
|
table.insert(configs, "-DCMAKE_DISABLE_FIND_PACKAGE_" .. dep .. "=" .. (package:config(config) and "OFF" or "ON"))
|
|
end
|
|
end
|
|
import("package.tools.cmake").install(package, configs)
|
|
import("package.tools.cmake").install(package, configs)
|
|
|
|
+ local suffix = package:is_debug() and "d" or ""
|
|
|
|
+ for _, lib in ipairs({"osg", "osgGA", "osgUtil", "osgDB", "osgText", "osgWidget", "osgTerrain", "osgFX", "osgViewer", "osgVolume", "osgManipulator", "osgAnimation", "osgParticle", "osgShadow", "osgPresentation", "osgSim", "OpenThreads"}) do
|
|
|
|
+ package:add("links", lib .. suffix)
|
|
|
|
+ end
|
|
end)
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|
|
on_test(function (package)
|