Skip to content

Commit

Permalink
split out gui option
Browse files Browse the repository at this point in the history
  • Loading branch information
xq114 committed Nov 11, 2024
1 parent 4c3c602 commit f6e1cd1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/d/dartsim/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ package("dartsim")
add_versions("v6.14.2", "6bbaf452f8182b97bf22adeab6cc7f3dc1cd2733358543131fa130e07c0860fc")

add_configs("dartpy", {description = "Build dartpy interface.", default = true, type = "boolean"})
add_configs("gui", {description = "Build GLUT GUI.", default = false, type = "boolean"})
local configdeps = {bullet3 = "Bullet",
freeglut = "GLUT",
nlopt = "NLOPT",
ode = "ODE",
openscenegraph = "OpenSceneGraph",
Expand All @@ -32,19 +32,25 @@ package("dartsim")
end

add_deps("cmake")
add_deps("assimp", "libccd", "eigen", "fcl", "octomap", "fmt", "pkgconf")
add_deps("assimp", "libccd", "eigen", "fcl", "octomap", "fmt")
on_load("windows|x64", "linux", "macosx", function (package)
for config, dep in pairs(configdeps) do
if package:config(config) then
package:add("deps", config, {configs = {shared = (config == "freeglut")}})
package:add("deps", config)
end
end
if package:config("gui") or package:config("dartpy") then
if package:is_plat("macosx") then
package:add("frameworks", "GLUT")
else
package:add("deps", "freeglut", {configs = {shared = true}})
end
end
if package:config("dartpy") then
package:add("deps", "tinyxml2")
package:add("deps", "urdfdom")
package:add("deps", "openscenegraph")
package:add("deps", "imgui", {configs = {opengl2 = true}})
package:add("deps", "freeglut", {configs = {shared = true}})
package:add("deps", "python 3.x")
package:add("deps", "pybind11")
end
Expand Down Expand Up @@ -82,6 +88,7 @@ package("dartsim")
table.insert(configs, "-DDART_RUNTIME_LIBRARY=" .. (package:config("vs_runtime"):startswith("MT") and "/MT" or "/MD"))
end
table.insert(configs, "-DDART_BUILD_DARTPY=" .. (package:config("dartpy") and "ON" or "OFF"))
table.insert(configs, "-DDART_SKIP_GLUT=" .. ((package:config("gui") or package:config("dartpy")) and "OFF" or "ON"))
table.insert(configs, "-DDART_BUILD_GUI_OSG=" .. (package:dep("openscenegraph") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs, {buildir = os.tmpfile() .. ".dir", packagedeps = {"imgui"}})
local suffix = package:is_debug() and "d" or ""
Expand Down

0 comments on commit f6e1cd1

Please sign in to comment.