|
|
@@ -3,23 +3,36 @@ package("openmvs")
|
|
|
set_description("open Multi-View Stereo reconstruction library")
|
|
|
set_license("AGPL-3.0")
|
|
|
|
|
|
- add_urls("https://github.com/cdcseacave/openMVS/archive/refs/tags/v$(version).tar.gz")
|
|
|
+ add_urls("https://github.com/cdcseacave/openMVS/archive/refs/tags/$(version).tar.gz",
|
|
|
+ "https://github.com/cdcseacave/openMVS.git")
|
|
|
|
|
|
- add_versions("2.3.0", "ac7312fb71dbab18c5b2755ad9ac3caa40ec689f6f369c330ca73c87c1f34258")
|
|
|
+ add_versions("v2.3.0", "ac7312fb71dbab18c5b2755ad9ac3caa40ec689f6f369c330ca73c87c1f34258")
|
|
|
|
|
|
- add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
|
|
|
+ if is_plat("windows") then
|
|
|
+ add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
|
|
|
+ end
|
|
|
|
|
|
add_configs("ceres", {description = "Enable CERES optimization library", default = false, type = "boolean"})
|
|
|
add_configs("cuda", {description = "Enable CUDA library", default = false, type = "boolean"})
|
|
|
add_configs("openmp", {description = "Enable OpenMP library", default = true, type = "boolean"})
|
|
|
add_configs("python", {description = "Enable Python library bindings", default = false, type = "boolean"})
|
|
|
|
|
|
- add_deps("cmake", "eigen", "glew", "opencv", "cgal", "vcglib", "zstd")
|
|
|
+ add_deps("cmake", "cgal", "eigen <5.0", "glew", "opencv", "vcglib", "zstd")
|
|
|
add_deps("boost", {configs = {iostreams = true, container = true, graph=true, program_options = true, serialization = true, thread = true, zlib = true, zstd = true}})
|
|
|
|
|
|
- on_load("windows", function (package)
|
|
|
- package:add("defines", "BOOST_ALL_NO_LIB") -- disable boost auto-linking
|
|
|
- if package:toolchain("msvc") then package:add("cxxflags", "/Zc:__cplusplus") end -- enable msvc __cplusplus
|
|
|
+ if on_check then
|
|
|
+ on_check("linux", function (package)
|
|
|
+ assert(not package:has_tool("cxx", "clang"), "Linux Clang is not supported yet.")
|
|
|
+ end)
|
|
|
+ end
|
|
|
+
|
|
|
+ add_includedirs("include", "include/OpenMVS")
|
|
|
+ add_linkdirs("lib/OpenMVS")
|
|
|
+ add_links("MVS", "Math", "IO", "Common")
|
|
|
+ on_load(function (package)
|
|
|
+ if package:has_tool("cxx", "cl") then
|
|
|
+ package:add("cxxflags", "/Zc:__cplusplus")
|
|
|
+ end
|
|
|
|
|
|
if package:config("ceres") then package:add("deps", "ceres-solver") end
|
|
|
if package:config("cuda") then package:add("deps", "cuda") end
|
|
|
@@ -27,7 +40,7 @@ package("openmvs")
|
|
|
if package:config("python") then package:add("deps", "python") end
|
|
|
end)
|
|
|
|
|
|
- on_install("windows|x64", "windows|x86", function (package)
|
|
|
+ on_install("windows|!arm64", "linux", function (package)
|
|
|
io.replace("CMakeLists.txt", "# Project-wide settings", [[
|
|
|
# Project-wide settings
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
@@ -44,17 +57,11 @@ package("openmvs")
|
|
|
"-DOpenMVS_ENABLE_TESTS=OFF",
|
|
|
}
|
|
|
import("package.tools.cmake").install(package, configs)
|
|
|
-
|
|
|
- package:add("linkdirs", "lib/OpenMVS")
|
|
|
- local libs = os.files(package:installdir("lib/OpenMVS/*.lib"))
|
|
|
- for _, filepath in ipairs(libs) do
|
|
|
- package:add("links", path.basename(filepath))
|
|
|
- end
|
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|
|
|
assert(package:check_cxxsnippets({test = [[
|
|
|
- #include <openMVS/MVS.h>
|
|
|
+ #include "MVS.h"
|
|
|
using namespace MVS;
|
|
|
void test() {
|
|
|
SEACAVE::cListTest<true>(100);
|
|
|
@@ -63,5 +70,5 @@ package("openmvs")
|
|
|
SEACAVE::TestRayTriangleIntersection<float>(1000);
|
|
|
SEACAVE::TestRayTriangleIntersection<double>(1000);
|
|
|
}
|
|
|
- ]]}, {configs = {languages = "c++11"}}))
|
|
|
+ ]]}, {configs = {languages = "c++14"}}))
|
|
|
end)
|