From 926b89fc9dd1cb6faee0cdf6813712d62107159b Mon Sep 17 00:00:00 2001 From: star9029 Date: Tue, 5 Nov 2024 19:55:35 +0800 Subject: [PATCH] manif: add package (#5668) * tl_optional: add cmake * manif: add package --- packages/m/manif/xmake.lua | 28 ++++++++++++++++++++++++++++ packages/t/tl_optional/xmake.lua | 7 +++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 packages/m/manif/xmake.lua diff --git a/packages/m/manif/xmake.lua b/packages/m/manif/xmake.lua new file mode 100644 index 00000000000..3a2b34149df --- /dev/null +++ b/packages/m/manif/xmake.lua @@ -0,0 +1,28 @@ +package("manif") + set_kind("library", {headeronly = true}) + set_homepage("https://artivis.github.io/manif") + set_description("A small C++11 header-only library for Lie theory.") + set_license("MIT") + + add_urls("https://github.com/artivis/manif/archive/refs/tags/$(version).tar.gz", + "https://github.com/artivis/manif.git") + + add_versions("0.0.5", "246a781c54a5c57179d48096faca0d108944e120f69d8fd7fb69e3cb4a0a67fb") + + add_deps("cmake") + add_deps("eigen", "tl_optional") + + on_install(function (package) + local configs = {"-DUSE_SYSTEM_WIDE_TL_OPTIONAL=ON"} + io.replace("CMakeLists.txt", "find_package(tl-optional 1.0.0 QUIET)", "find_package(tl-optional)", {plain = true}) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + auto state = manif::SE3d::Identity(); + } + ]]}, {configs = {languages = "c++11"}, includes = {"manif/manif.h"}})) + end) diff --git a/packages/t/tl_optional/xmake.lua b/packages/t/tl_optional/xmake.lua index de8350c14b0..602c0e5c517 100644 --- a/packages/t/tl_optional/xmake.lua +++ b/packages/t/tl_optional/xmake.lua @@ -1,5 +1,4 @@ package("tl_optional") - set_kind("library", {headeronly = true}) set_homepage("https://github.com/TartanLlama/optional") set_description("C++11/14/17 std::optional with functional-style extensions and support for references.") @@ -10,8 +9,12 @@ package("tl_optional") add_versions("v1.1.0", "a336bb10f51945369c1dd6dc6d2a7086602ab9cab52c98a7a6224bfd782bc0c7") + add_deps("cmake") + on_install(function (package) - os.cp("include/tl", package:installdir("include")) + local configs = {"-DOPTIONAL_BUILD_PACKAGE=OFF", "-DBUILD_TESTING=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + import("package.tools.cmake").install(package, configs) end) on_test(function (package)