|
@@ -1,42 +1,71 @@
|
|
package("urdfdom")
|
|
package("urdfdom")
|
|
-
|
|
|
|
set_homepage("https://wiki.ros.org/urdf")
|
|
set_homepage("https://wiki.ros.org/urdf")
|
|
set_description("A C++ parser for the Unified Robot Description Format (URDF)")
|
|
set_description("A C++ parser for the Unified Robot Description Format (URDF)")
|
|
set_license("BSD-3-Clause")
|
|
set_license("BSD-3-Clause")
|
|
|
|
|
|
add_urls("https://github.com/ros/urdfdom/archive/refs/tags/$(version).tar.gz",
|
|
add_urls("https://github.com/ros/urdfdom/archive/refs/tags/$(version).tar.gz",
|
|
"https://github.com/ros/urdfdom.git")
|
|
"https://github.com/ros/urdfdom.git")
|
|
|
|
+
|
|
|
|
+ add_versions("5.0.2", "f929a33ec6171a57d4ff7d4c0eff6fb79d4725c279189d4f4c8806c4aa4e71ac")
|
|
add_versions("4.0.1", "46b122c922f44ec32674a56e16fd4b5d068b53265898cbea2c3e1939ecccc62a")
|
|
add_versions("4.0.1", "46b122c922f44ec32674a56e16fd4b5d068b53265898cbea2c3e1939ecccc62a")
|
|
- add_versions("1.0.4", "8f3d56b0cbc4b84436d8baf4c8346cd2ee7ffb257bba5ddd9892c41bf516edc4")
|
|
|
|
add_versions("4.0.0", "9848d106dc88dc0b907d5667c09da3ca53241fbcf17e982d8c234fe3e0d6ddcc")
|
|
add_versions("4.0.0", "9848d106dc88dc0b907d5667c09da3ca53241fbcf17e982d8c234fe3e0d6ddcc")
|
|
|
|
+ add_versions("1.0.4", "8f3d56b0cbc4b84436d8baf4c8346cd2ee7ffb257bba5ddd9892c41bf516edc4")
|
|
|
|
|
|
add_patches("1.0.4", path.join(os.scriptdir(), "patches", "1.0.4", "build.patch"), "1f51148afccef7b9bf079ef4137c12d578fb7a76f7aed6e282ca2ceaf4a188ba")
|
|
add_patches("1.0.4", path.join(os.scriptdir(), "patches", "1.0.4", "build.patch"), "1f51148afccef7b9bf079ef4137c12d578fb7a76f7aed6e282ca2ceaf4a188ba")
|
|
|
|
|
|
- add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true})
|
|
|
|
|
|
+ if is_plat("windows") then
|
|
|
|
+ add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true})
|
|
|
|
+ end
|
|
|
|
|
|
add_deps("cmake")
|
|
add_deps("cmake")
|
|
add_deps("urdfdom-headers", "console-bridge")
|
|
add_deps("urdfdom-headers", "console-bridge")
|
|
- on_load("windows", "linux", "macosx", function (package)
|
|
|
|
- if package:version():ge("4.0.0") then
|
|
|
|
- package:add("deps", "tinyxml2")
|
|
|
|
- else
|
|
|
|
- package:add("deps", "tinyxml")
|
|
|
|
|
|
+
|
|
|
|
+ add_includedirs("include", "include/urdfdom")
|
|
|
|
+
|
|
|
|
+ on_check("android|armeabi-v7a", function (package)
|
|
|
|
+ local ndk = package:toolchain("ndk")
|
|
|
|
+ local ndk_sdkver = ndk:config("ndk_sdkver")
|
|
|
|
+ if tonumber(ndk_sdkver) < 24 then
|
|
|
|
+ raise("package(urdfdom) unsupported this platform")
|
|
end
|
|
end
|
|
end)
|
|
end)
|
|
|
|
|
|
- on_install("windows", "linux", "macosx", function (package)
|
|
|
|
- local configs = {}
|
|
|
|
- table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
|
|
|
|
|
|
+ on_load(function (package)
|
|
|
|
+ local version = package:version()
|
|
|
|
+ if version then
|
|
|
|
+ if version:ge("4.0.0") then
|
|
|
|
+ package:add("deps", "tinyxml2")
|
|
|
|
+ else
|
|
|
|
+ package:add("deps", "tinyxml")
|
|
|
|
+ end
|
|
|
|
+ if version:gt("1.0.4") then
|
|
|
|
+ package:add("deps", "urdfdom-headers")
|
|
|
|
+ else
|
|
|
|
+ package:add("deps", "urdfdom-headers 1.0.5")
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+ if not package:config("shared") then
|
|
|
|
+ package:add("defines", "URDFDOM_STATIC")
|
|
|
|
+ end
|
|
|
|
+ end)
|
|
|
|
+
|
|
|
|
+ on_install("!mingw and !iphoneos", function (package)
|
|
|
|
+ io.replace("urdf_parser/CMakeLists.txt", "SHARED", "", {plain = true})
|
|
|
|
+ io.replace("urdf_parser/include/urdf_parser/urdf_parser.h", "#include <string>", "#include <cstdint>\n#include <string>", {plain = true})
|
|
|
|
+ io.replace("CMakeLists.txt", "find_package(urdfdom_headers 1.0 REQUIRED)", "find_package(urdfdom_headers REQUIRED)", {plain = true})
|
|
|
|
+ io.replace("CMakeLists.txt", "find_package(urdfdom_headers 1.0.3 REQUIRED)", "find_package(urdfdom_headers REQUIRED)", {plain = true})
|
|
|
|
+
|
|
|
|
+ local configs = {"-DBUILD_TESTING=OFF", "-DAPPEND_PROJECT_NAME_TO_INCLUDEDIR=OFF", "-DCMAKE_POLICY_DEFAULT_CMP0057=NEW"}
|
|
|
|
+ table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
|
|
import("package.tools.cmake").install(package, configs)
|
|
import("package.tools.cmake").install(package, configs)
|
|
end)
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|
|
on_test(function (package)
|
|
assert(package:check_cxxsnippets({test = [[
|
|
assert(package:check_cxxsnippets({test = [[
|
|
- #include <string>
|
|
|
|
void test() {
|
|
void test() {
|
|
- std::string easy{"1.0"};
|
|
|
|
- double conv = urdf::strToDouble(easy.c_str());
|
|
|
|
|
|
+ std::string xml_string;
|
|
|
|
+ urdf::parseURDF(xml_string);
|
|
}
|
|
}
|
|
- ]]}, {configs = {languages = "c++11"}, includes = "urdf_model/utils.h"}))
|
|
|
|
|
|
+ ]]}, {configs = {languages = "c++11"}, includes = "urdf_parser/urdf_parser.h"}))
|
|
end)
|
|
end)
|