Skip to content

Commit

Permalink
manif: add package (#5668)
Browse files Browse the repository at this point in the history
* tl_optional: add cmake

* manif: add package
  • Loading branch information
star-hengxing authored Nov 5, 2024
1 parent 1b85028 commit 926b89f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
28 changes: 28 additions & 0 deletions packages/m/manif/xmake.lua
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 5 additions & 2 deletions packages/t/tl_optional/xmake.lua
Original file line number Diff line number Diff line change
@@ -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.")
Expand All @@ -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)
Expand Down

0 comments on commit 926b89f

Please sign in to comment.