add stlab, easyloggingpp and matplotplusplus (#542)
* update spdlog * add easyloggingpp * add stlab * fix easyloggingpp * add matplotplusplus * add cgns * fix matplotplusplus * add nodesoup * fix undefined reference * fix matplotplusplus on vs2017 * ban vs2017 for matplot++pull/543/head
parent
1ca235894b
commit
c5c25d11ca
7 changed files with 187 additions and 11 deletions
@ -0,0 +1,31 @@ |
||||
package("cgns") |
||||
|
||||
set_homepage("http://cgns.github.io/") |
||||
set_description("CFD General Notation System") |
||||
|
||||
add_urls("https://github.com/CGNS/CGNS/archive/refs/tags/$(version).tar.gz") |
||||
add_versions("v4.2.0", "090ec6cb0916d90c16790183fc7c2bd2bd7e9a5e3764b36c8196ba37bf1dc817") |
||||
|
||||
add_configs("hdf5", {description = "Enable HDF5 interface.", default = false, type = "boolean"}) |
||||
|
||||
add_deps("cmake") |
||||
on_load("windows", "macosx", "linux", function (package) |
||||
if package:config("hdf5") then |
||||
package:add("deps", "hdf5") |
||||
end |
||||
end) |
||||
|
||||
on_install("windows", "macosx", "linux", function (package) |
||||
if package:config("shared") then |
||||
io.replace("src/CMakeLists.txt", "install(TARGETS cgns_static", "#", {plain = true}) |
||||
end |
||||
local configs = {"-DCGNS_ENABLE_FORTRAN=OFF"} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
table.insert(configs, "-DCGNS_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) |
||||
table.insert(configs, "-DCGNS_ENABLE_HDF5=" .. (package:config("hdf5") and "ON" or "OFF")) |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("cg_is_cgns", {includes = "cgnslib.h"})) |
||||
end) |
@ -0,0 +1,32 @@ |
||||
package("easyloggingpp") |
||||
|
||||
set_homepage("https://github.com/amrayn/easyloggingpp") |
||||
set_description("Single header C++ logging library.") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/amrayn/easyloggingpp/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/amrayn/easyloggingpp.git") |
||||
add_versions("v9.97.0", "9110638e21ef02428254af8688bf9e766483db8cc2624144aa3c59006907ce22") |
||||
|
||||
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) |
||||
|
||||
on_install(function (package) |
||||
io.writefile("xmake.lua", [[ |
||||
add_rules("mode.debug", "mode.release") |
||||
target("easyloggingpp") |
||||
set_kind("static") |
||||
set_languages("c++11") |
||||
add_files("src/easylogging++.cc") |
||||
add_headerfiles("src/easylogging++.h") |
||||
]]) |
||||
import("package.tools.xmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
INITIALIZE_EASYLOGGINGPP |
||||
void test() { |
||||
LOG(INFO) << "My first info log using default logger"; |
||||
} |
||||
]]}, {configs = {languages = "c++11"}, includes = "easylogging++.h"})) |
||||
end) |
@ -0,0 +1,65 @@ |
||||
package("matplotplusplus") |
||||
|
||||
set_homepage("https://alandefreitas.github.io/matplotplusplus/") |
||||
set_description("A C++ Graphics Library for Data Visualization") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/alandefreitas/matplotplusplus/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/alandefreitas/matplotplus.git") |
||||
add_versions("v1.1.0", "5c3a1bdfee12f5c11fd194361040fe4760f57e334523ac125ec22b2cb03f27bb") |
||||
|
||||
local configdeps = {jpeg = "libjpeg-turbo", |
||||
tiff = "libtiff", |
||||
zlib = "zlib", |
||||
png = "libpng", |
||||
blas = "openblas", |
||||
fftw = "fftw", |
||||
opencv = "opencv"} |
||||
for config, dep in pairs(configdeps) do |
||||
add_configs(config, {description = "Enable " .. config .. " support.", default = (config == "zlib"), type = "boolean"}) |
||||
end |
||||
|
||||
add_deps("cmake") |
||||
add_deps("nodesoup") |
||||
if is_plat("windows") then |
||||
add_syslinks("user32", "shell32", "gdi32") |
||||
end |
||||
on_load("windows", "macosx", "linux", function (package) |
||||
for config, dep in pairs(configdeps) do |
||||
if package:config(config) then |
||||
package:add("deps", dep) |
||||
end |
||||
end |
||||
end) |
||||
|
||||
on_install("windows", "macosx", "linux", function (package) |
||||
if is_plat("windows") then |
||||
local vs = import("core.tool.toolchain").load("msvc"):config("vs") |
||||
if tonumber(vs) < 2019 then |
||||
raise("Your compiler is too old to use this library.") |
||||
end |
||||
end |
||||
local configs = {"-DBUILD_EXAMPLES=OFF", "-DBUILD_TESTS=OFF", "-DBUILD_INSTALLER=ON", "-DBUILD_PACKAGE=OFF", "-DWITH_SYSTEM_NODESOUP=ON"} |
||||
for config, dep in pairs(configdeps) do |
||||
if not package:config(config) then |
||||
table.insert(configs, "-DCMAKE_DISABLE_FIND_PACKAGE_" .. config:upper() .. "=ON") |
||||
end |
||||
end |
||||
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 <cmath> |
||||
#include <vector> |
||||
void test() { |
||||
using namespace matplot; |
||||
std::vector<double> x = linspace(0, 2 * pi); |
||||
std::vector<double> y = transform(x, [](auto x) { return sin(x); }); |
||||
plot(x, y, "-o"); |
||||
show(); |
||||
} |
||||
]]}, {configs = {languages = "c++17"}, includes = "matplot/matplot.h"})) |
||||
end) |
@ -0,0 +1,25 @@ |
||||
package("nodesoup") |
||||
|
||||
set_homepage("https://github.com/olvb/nodesoup") |
||||
set_description("Force-directed graph layout with Fruchterman-Reingold") |
||||
|
||||
add_urls("https://github.com/olvb/nodesoup.git") |
||||
add_versions("2020.09.05", "3158ad082bb0cd1abee75418b12b35522dbca74f") |
||||
|
||||
on_install(function (package) |
||||
io.writefile("xmake.lua", [[ |
||||
add_rules("mode.debug", "mode.release") |
||||
target("nodesoup") |
||||
set_kind("static") |
||||
set_languages("c++14") |
||||
add_files("src/*.cpp") |
||||
add_includedirs("include") |
||||
add_headerfiles("include/nodesoup.hpp") |
||||
add_defines("_USE_MATH_DEFINES") |
||||
]]) |
||||
import("package.tools.xmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cxxtypes("nodesoup::adj_list_t", {configs = {languages = "c++14"}, includes = "nodesoup.hpp"})) |
||||
end) |
@ -0,0 +1,20 @@ |
||||
package("stlab") |
||||
|
||||
set_kind("library", {headeronly = true}) |
||||
set_homepage("https://stlab.cc/") |
||||
set_description("Adobe Source Libraries from Software Technology Lab") |
||||
set_license("BSL-1.0") |
||||
|
||||
add_urls("https://github.com/stlab/libraries/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/stlab/libraries.git") |
||||
add_versions("v1.6.2", "d0369d889c7bf78068d0c4f4b5125d7e9fe9abb0ad7a3be35bf13b6e2c271676") |
||||
|
||||
add_deps("cmake") |
||||
add_deps("boost") |
||||
on_install("windows", "macosx", "linux", function (package) |
||||
import("package.tools.cmake").install(package, {"-Dstlab.testing=OFF", "-Dstlab.coverage=OFF"}) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cxxtypes("stlab::forest<char>", {configs = {languages = "c++17"}, includes = "stlab/forest.hpp"})) |
||||
end) |
Loading…
Reference in new issue