Skip to content

Commit c265479

Browse files
marchingcubecpp: add package (#8807)
1 parent ef26409 commit c265479

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package("marchingcubecpp")
2+
set_kind("library", {headeronly = true})
3+
set_homepage("https://github.com/aparis69/marchingcubecpp")
4+
set_description("A public domain/MIT header-only marching cube implementation in C++ without anything fancy.")
5+
set_license("MIT")
6+
7+
add_urls("https://github.com/aparis69/marchingcubecpp.git")
8+
9+
add_versions("2023.09.12", "f03a1b3ec29b1d7d865691ca8aea4f1eb2c2873d")
10+
11+
on_install(function (package)
12+
io.replace("MC.h", "#include <cmath>", "#include <cmath>\n#include <cstdint>", {plain = true})
13+
os.cp("*.h", package:installdir("include"))
14+
end)
15+
16+
on_test(function (package)
17+
assert(package:check_cxxsnippets({test = [[
18+
void test() {
19+
// First compute a scalar field
20+
const int n = 100;
21+
MC::MC_FLOAT* field = new MC::MC_FLOAT[n * n * n];
22+
// [...]
23+
24+
// Compute isosurface using marching cube
25+
MC::mcMesh mesh;
26+
MC::marching_cube(field, n, n, n, mesh);
27+
}
28+
]]}, {configs = {languages = "c++14"}, includes = "MC.h"}))
29+
end)

0 commit comments

Comments
 (0)