add docopt and ezc3d (#604)
* add docopt * add ezc3d * update harfbuzz * update libsdl * improve openblas * update catch2pull/599/head^2
parent
8a16ba0009
commit
caac3eedff
6 changed files with 89 additions and 2 deletions
@ -0,0 +1,43 @@ |
||||
package("docopt") |
||||
|
||||
set_homepage("https://github.com/docopt/docopt.cpp") |
||||
set_description("Pythonic command line arguments parser (C++11 port)") |
||||
set_license("BSL-1.0") |
||||
|
||||
add_urls("https://github.com/docopt/docopt.cpp/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/docopt/docopt.cpp.git") |
||||
add_versions("v0.6.3", "28af5a0c482c6d508d22b14d588a3b0bd9ff97135f99c2814a5aa3cbff1d6632") |
||||
|
||||
add_deps("cmake") |
||||
on_load("windows", function (package) |
||||
if package:config("shared") then |
||||
package:add("defines", "DOCOPT_DLL") |
||||
end |
||||
end) |
||||
|
||||
on_install(function (package) |
||||
local rmtarget = package:config("shared") and "docopt_s" or "docopt" |
||||
io.replace("CMakeLists.txt", "install(TARGETS " .. rmtarget .. " EXPORT", "#", {plain = true}) |
||||
import("package.tools.cmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
static const char USAGE[] = |
||||
R"(Naval Fate. |
||||
|
||||
Usage: |
||||
naval_fate (-h | --help) |
||||
naval_fate --version |
||||
|
||||
Options: |
||||
-h --help Show this screen. |
||||
--version Show version. |
||||
)"; |
||||
|
||||
void test(int argc, char *argv[]) { |
||||
std::map<std::string, docopt::value> args |
||||
= docopt::docopt(USAGE, { argv + 1, argv + argc }, true, "Naval Fate 2.0"); |
||||
} |
||||
]]}, {configs = {languages = "c++11"}, includes = "docopt/docopt.h"})) |
||||
end) |
@ -0,0 +1,31 @@ |
||||
package("ezc3d") |
||||
|
||||
set_homepage("https://github.com/pyomeca/ezc3d") |
||||
set_description("Easy to use C3D reader/writer for C++, Python and Matlab") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/pyomeca/ezc3d/archive/refs/tags/Release_$(version).tar.gz") |
||||
add_versions("1.4.5", "01602b2ccfc0edd88089e89d249e10086022f7ed7ef40caa3eb3b048ccfa40aa") |
||||
|
||||
add_deps("cmake") |
||||
add_includedirs("include/ezc3d") |
||||
if not is_plat("windows") then |
||||
add_linkdirs("lib/ezc3d") |
||||
end |
||||
on_install("windows", "linux", "macosx", function (package) |
||||
local configs = {"-DBUILD_EXAMPLE=OFF", "-DBUILD_TESTS=OFF"} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
#include <vector> |
||||
void test() { |
||||
ezc3d::c3d c3d_empty; |
||||
ezc3d::ParametersNS::GroupNS::Parameter t("SCALE"); |
||||
t.set(std::vector<double>(), {0}); |
||||
} |
||||
]]}, {configs = {languages = "c++11"}, includes = {"ezc3d.h", "Parameters.h"}})) |
||||
end) |
Loading…
Reference in new issue