|
|
|
@ -6,23 +6,31 @@ package("gmsh") |
|
|
|
|
|
|
|
|
|
add_urls("http://gmsh.info/src/gmsh-$(version)-source.tgz") |
|
|
|
|
add_versions("4.8.4", "760dbdc072eaa3c82d066c5ba3b06eacdd3304eb2a97373fe4ada9509f0b6ace") |
|
|
|
|
add_versions("4.11.1", "c5fe1b7cbd403888a814929f2fd0f5d69e27600222a18c786db5b76e8005b365") |
|
|
|
|
|
|
|
|
|
add_configs("openmp", {description = "Enable OpenMP support.", default = not is_plat("windows"), type = "boolean"}) |
|
|
|
|
|
|
|
|
|
add_deps("cmake") |
|
|
|
|
if is_plat("windows") then |
|
|
|
|
add_syslinks("shell32", "ws2_32", "winmm") |
|
|
|
|
add_syslinks("shell32", "ws2_32", "winmm", "wsock32", "psapi") |
|
|
|
|
end |
|
|
|
|
on_load("windows", function (package) |
|
|
|
|
if package:config("shared") then |
|
|
|
|
on_load("windows", "macosx", "linux", function (package) |
|
|
|
|
if package:is_plat("windows") and package:config("shared") then |
|
|
|
|
package:add("defines", "GMSH_DLL") |
|
|
|
|
end |
|
|
|
|
if package:config("openmp") then |
|
|
|
|
package:add("deps", "openmp") |
|
|
|
|
end |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
on_install("windows", "macosx", "linux", function (package) |
|
|
|
|
io.replace("CMakeLists.txt", "add_definitions(-D_USE_MATH_DEFINES)", "add_definitions(-DWIN32)\nadd_definitions(-D_USE_MATH_DEFINES)", {plain = true}) |
|
|
|
|
local configs = {"-DENABLE_TESTS=OFF", "-DENABLE_GMP=OFF"} |
|
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
|
|
|
|
table.insert(configs, "-DENABLE_BUILD_LIB=" .. (package:config("shared") and "OFF" or "ON")) |
|
|
|
|
table.insert(configs, "-DENABLE_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF")) |
|
|
|
|
table.insert(configs, "-DENABLE_BUILD_DYNAMIC=" .. (package:config("shared") and "ON" or "OFF")) |
|
|
|
|
table.insert(configs, "-DENABLE_OPENMP=" .. (package:config("openmp") and "ON" or "OFF")) |
|
|
|
|
if package:is_plat("windows") then |
|
|
|
|
table.insert(configs, "-DENABLE_MSVC_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) |
|
|
|
|
end |
|
|
|
@ -34,7 +42,9 @@ package("gmsh") |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
on_test(function (package) |
|
|
|
|
os.vrun("gmsh -version") |
|
|
|
|
if not package:is_cross() then |
|
|
|
|
os.vrun("gmsh -version") |
|
|
|
|
end |
|
|
|
|
assert(package:check_cxxsnippets({test = [[ |
|
|
|
|
void test() { |
|
|
|
|
gmsh::initialize(); |
|
|
|
|