* add mcut

* fix mcut

* remove arm support
pull/1824/head
Hoildkv 2 years ago committed by GitHub
parent 4e42baa069
commit 972b908aac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 34
      packages/m/mcut/patches/1.1.0/install.patch
  2. 34
      packages/m/mcut/xmake.lua

@ -0,0 +1,34 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a5b1074..5767427 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -297,25 +297,10 @@ endif()
# TODO: package documentation files
-if(MCUT_BUILD_AS_SHARED_LIB)
- #
- # dynamic libs
- #
-
- install(TARGETS ${mpn_shared_lib_name}
- LIBRARY
- DESTINATION lib/mpn/shared
- COMPONENT dynamic_libraries)
-else()
- #
- # static libs
- #
-
- install(TARGETS ${mpn_static_lib_name}
- ARCHIVE
- DESTINATION lib/mpn/static
- COMPONENT static_libraries)
-endif()
+install(TARGETS ${target_name}
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
#
# headers

@ -0,0 +1,34 @@
package("mcut")
set_homepage("https://cutdigital.github.io/mcut.site/")
set_description("Fast & robust mesh boolean library in C++")
set_license("GPL-3.0")
add_urls("https://github.com/cutdigital/mcut/archive/refs/tags/$(version).tar.gz")
add_urls("https://github.com/cutdigital/mcut.git")
add_versions("v1.1.0", "a31efbb4c963a40574ee0bad946d02dc77df873f68d35524363bd71d2ae858bd")
add_patches("1.1.0", path.join(os.scriptdir(), "patches", "1.1.0", "install.patch"), "438f5b76d8ad58253420844248c5da09404cc7ad4a7a19c174e90aacf714d0f0")
add_deps("cmake")
on_load("windows", function (package)
if package:config("shared") then
package:add("defines", "MCUT_SHARED_LIB")
end
end)
on_install("windows|x86", "windows|x64", "macosx", "linux", "mingw", function (package)
local configs = {"-DMCUT_BUILD_TESTS=OFF", "-DMCUT_BUILD_TUTORIALS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPES=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DMCUT_BUILD_AS_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test() {
McContext context = MC_NULL_HANDLE;
mcCreateContext(&context, MC_NULL_HANDLE);
}
]]}, {configs = {languages = "c++11"}, includes = "mcut/mcut.h"}))
end)
Loading…
Cancel
Save