From 34ba6b5fbd331c5a1060d1b2a3ec47d05772d738 Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:58:20 +0800 Subject: [PATCH] fcl: make octomap optional (#3309) --- packages/f/fcl/xmake.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/f/fcl/xmake.lua b/packages/f/fcl/xmake.lua index 25636dc4f..4e5bc195a 100644 --- a/packages/f/fcl/xmake.lua +++ b/packages/f/fcl/xmake.lua @@ -12,13 +12,21 @@ package("fcl") if is_plat("windows") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) end + add_configs("octomap", {description = "Enable OctoMap library support.", default = false, type = "boolean"}) add_deps("cmake") - add_deps("eigen", "libccd", "octomap") + add_deps("eigen", "libccd") + on_load(function (package) + if package:config("octomap") then + package:add("deps", "octomap") + end + end) + on_install("windows", "macosx", "linux", function (package) local configs = {"-DFCL_BUILD_TESTS=OFF"} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) table.insert(configs, "-DFCL_STATIC_LIBRARY=" .. (package:config("shared") and "OFF" or "ON")) + table.insert(configs, "-DFCL_WITH_OCTOMAP=" .. (package:config("octomap") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) end)