mirror of
https://github.com/microsoft/vcpkg.git
synced 2026-01-18 01:11:23 +01:00
[openmvs] Update to 2.3.0, revise (#48845)
This commit is contained in:
13
ports/openmvs/ambiguous-uint_t.diff
Normal file
13
ports/openmvs/ambiguous-uint_t.diff
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/libs/Common/EventQueue.cpp b/libs/Common/EventQueue.cpp
|
||||
index 82f835b..fccfa41 100644
|
||||
--- a/libs/Common/EventQueue.cpp
|
||||
+++ b/libs/Common/EventQueue.cpp
|
||||
@@ -80,7 +80,7 @@ bool EventQueue::IsEmpty() const
|
||||
return m_events.IsEmpty();
|
||||
}
|
||||
|
||||
-uint_t EventQueue::GetSize() const
|
||||
+SEACAVE::uint_t EventQueue::GetSize() const
|
||||
{
|
||||
Lock l(m_cs);
|
||||
return m_events.GetSize();
|
||||
222
ports/openmvs/cmake.diff
Normal file
222
ports/openmvs/cmake.diff
Normal file
@@ -0,0 +1,222 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 920e4c3..5f7e936 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -87,8 +87,8 @@ if(OpenMVS_USE_OPENMP)
|
||||
#https://github.com/Kitware/CMake/blob/42212f7539040139ecec092547b7d58ef12a4d72/Modules/FindOpenMP.cmake#L252
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" AND (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.0"))
|
||||
SET(OpenMP_LIBS ${OpenMP_libomp_LIBRARY})
|
||||
- LIST(APPEND OpenMVS_EXTRA_LIBS ${OpenMP_LIBS})
|
||||
endif()
|
||||
+ LIST(APPEND OpenMVS_EXTRA_LIBS OpenMP::OpenMP_CXX)
|
||||
else()
|
||||
MESSAGE("-- Can't find OpenMP. Continuing without it.")
|
||||
endif()
|
||||
@@ -109,7 +109,10 @@ if(OpenMVS_USE_OPENGL)
|
||||
endif()
|
||||
|
||||
if(OpenMVS_USE_CUDA)
|
||||
- FIND_PACKAGE(CUDA)
|
||||
+ FIND_PACKAGE(CUDAToolkit REQUIRED)
|
||||
+ set(CUDA_FOUND 1)
|
||||
+ set(CUDA_INCLUDE_DIRS "${CUDAToolkit_INCLUDE_DIRS}")
|
||||
+ set(CUDA_CUDA_LIBRARY CUDA::cuda_driver)
|
||||
if(CUDA_FOUND)
|
||||
ENABLE_LANGUAGE(CUDA)
|
||||
# CUDA-11.x can not be compiled using C++14 standard on Windows
|
||||
@@ -190,15 +193,10 @@ if(OpenMVS_USE_PYTHON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
-FIND_PACKAGE(Boost REQUIRED COMPONENTS iostreams program_options system serialization OPTIONAL_COMPONENTS ${Boost_EXTRA_COMPONENTS})
|
||||
+FIND_PACKAGE(Boost REQUIRED COMPONENTS assert graph iostreams pool serialization throw_exception OPTIONAL_COMPONENTS ${Boost_EXTRA_COMPONENTS})
|
||||
if(Boost_FOUND)
|
||||
LIST(APPEND OpenMVS_EXTRA_INCLUDES ${Boost_INCLUDE_DIRS})
|
||||
- INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
|
||||
- ADD_DEFINITIONS(${Boost_DEFINITIONS})
|
||||
- LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
|
||||
if(NOT MSVC AND DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||
- # work around this missing library link in vcpkg
|
||||
- LIST(APPEND Boost_LIBRARIES zstd)
|
||||
endif()
|
||||
SET(_USE_BOOST TRUE)
|
||||
if(OpenMVS_USE_PYTHON AND Boost_${Boost_EXTRA_COMPONENTS}_FOUND)
|
||||
@@ -206,11 +204,9 @@ if(Boost_FOUND)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
-FIND_PACKAGE(Eigen3 3.4 REQUIRED)
|
||||
+FIND_PACKAGE(Eigen3 3.4...5 CONFIG REQUIRED)
|
||||
+set(EIGEN3_FOUND 1)
|
||||
if(EIGEN3_FOUND)
|
||||
- LIST(APPEND OpenMVS_EXTRA_INCLUDES ${EIGEN3_INCLUDE_DIR})
|
||||
- INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
|
||||
- ADD_DEFINITIONS(${EIGEN3_DEFINITIONS})
|
||||
SET(_USE_EIGEN TRUE)
|
||||
MESSAGE(STATUS "Eigen ${EIGEN3_VERSION} found (include: ${EIGEN3_INCLUDE_DIR})")
|
||||
endif()
|
||||
@@ -282,11 +278,11 @@ INCLUDE(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file("${PROJECT_BINARY_DIR}/OpenMVSConfigVersion.cmake"
|
||||
VERSION ${OpenMVS_VERSION}
|
||||
COMPATIBILITY AnyNewerVersion)
|
||||
-SET(INSTALL_INCLUDE_DIR_IN ${INSTALL_INCLUDE_DIR_PREFIX} ${OpenMVS_EXTRA_INCLUDES})
|
||||
-SET(INSTALL_CMAKE_DIR_IN ${INSTALL_CMAKE_DIR_PREFIX})
|
||||
+SET(INSTALL_INCLUDE_DIR_IN "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}" ${OpenMVS_EXTRA_INCLUDES})
|
||||
+SET(INSTALL_CMAKE_DIR_IN "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}")
|
||||
configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/build/Templates/OpenMVSConfig.cmake.in"
|
||||
"${PROJECT_BINARY_DIR}/OpenMVSConfig.cmake"
|
||||
- INSTALL_DESTINATION ${PROJECT_BINARY_DIR}
|
||||
+ INSTALL_DESTINATION "${INSTALL_CMAKE_DIR}"
|
||||
NO_SET_AND_CHECK_MACRO)
|
||||
# Install the OpenMVSConfig.cmake and OpenMVSConfigVersion.cmake
|
||||
INSTALL(FILES
|
||||
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
|
||||
index 3bb00c6..e54c840 100644
|
||||
--- a/apps/CMakeLists.txt
|
||||
+++ b/apps/CMakeLists.txt
|
||||
@@ -1,3 +1,5 @@
|
||||
+find_package(Boost COMPONENTS program_options)
|
||||
+list(APPEND OpenMVS_EXTRA_LIBS Boost::program_options)
|
||||
# Add applications
|
||||
ADD_SUBDIRECTORY(InterfaceCOLMAP)
|
||||
ADD_SUBDIRECTORY(InterfaceMetashape)
|
||||
diff --git a/build/Templates/OpenMVSConfig.cmake.in b/build/Templates/OpenMVSConfig.cmake.in
|
||||
index 9747b3e..514f5a0 100644
|
||||
--- a/build/Templates/OpenMVSConfig.cmake.in
|
||||
+++ b/build/Templates/OpenMVSConfig.cmake.in
|
||||
@@ -15,8 +15,27 @@ set(OpenMVS_INCLUDE_DIRS "@INSTALL_INCLUDE_DIR_IN@")
|
||||
|
||||
set(OpenMVS_DEFINITIONS "@OpenMVS_DEFINITIONS@")
|
||||
|
||||
+include(CMakeFindDependencyMacro)
|
||||
+find_dependency(Boost COMPONENTS iostreams pool serialization throw_exception)
|
||||
+find_dependency(Eigen3 CONFIG)
|
||||
+find_dependency(OpenCV)
|
||||
+find_dependency(CGAL)
|
||||
+if("@OpenMVS_USE_CERES@")
|
||||
+ find_dependency(Ceres)
|
||||
+endif()
|
||||
+if("@OpenMVS_USE_CUDA@")
|
||||
+ find_dependency(CUDAToolkit)
|
||||
+ list(APPEND OpenMVS_INCLUDE_DIRS ${CUDAToolkit_INCLUDE_DIRS})
|
||||
+endif()
|
||||
+if("@OpenMVS_USE_OPENGL@")
|
||||
+ find_dependency(OpenGL)
|
||||
+endif()
|
||||
+if("@OpenMVS_USE_OPENMP@")
|
||||
+ find_dependency(OpenMP COMPONENTS CXX)
|
||||
+endif()
|
||||
+
|
||||
# These are IMPORTED targets created by OpenMVSTargets.cmake
|
||||
-set(OpenMVS_LIBRARIES MVS)
|
||||
+set(OpenMVS_LIBRARIES OpenMVS::MVS)
|
||||
set(OpenMVS_BINARIES InterfaceCOLMAP DensifyPointCloud ReconstructMesh RefineMesh TextureMesh)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/OpenMVSTargets.cmake")
|
||||
diff --git a/build/Utils.cmake b/build/Utils.cmake
|
||||
index 86d3430..b69fe50 100644
|
||||
--- a/build/Utils.cmake
|
||||
+++ b/build/Utils.cmake
|
||||
@@ -119,6 +119,7 @@ macro(GetOperatingSystemArchitectureBitness)
|
||||
# Detect GNU version:
|
||||
set(CMAKE_FLG_GCC_VERSION_NUM 0)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
+ if(0) # informational, breaking for Android
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
|
||||
OUTPUT_VARIABLE CMAKE_FLG_GCC_VERSION_FULL
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
@@ -144,6 +145,7 @@ macro(GetOperatingSystemArchitectureBitness)
|
||||
set(CMAKE_FLG_GCC_VERSION ${CMAKE_FLG_GCC_VERSION_MAJOR}${CMAKE_FLG_GCC_VERSION_MINOR})
|
||||
math(EXPR CMAKE_FLG_GCC_VERSION_NUM "${CMAKE_FLG_GCC_VERSION_MAJOR}*100 + ${CMAKE_FLG_GCC_VERSION_MINOR}")
|
||||
message(STATUS "Detected version of GNU GCC: ${CMAKE_FLG_GCC_VERSION} (${CMAKE_FLG_GCC_VERSION_NUM})")
|
||||
+ endif()
|
||||
|
||||
if(WIN32)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
|
||||
@@ -174,6 +176,7 @@ macro(ComposePackageLibSuffix)
|
||||
set(PACKAGE_LIB_SUFFIX_DBG "")
|
||||
set(PACKAGE_LIB_SUFFIX_REL "")
|
||||
if(MSVC)
|
||||
+ elseif(0) # do not use subdirs per vc version/config
|
||||
if("${MSVC_VERSION}" STRGREATER "1929")
|
||||
set(PACKAGE_LIB_SUFFIX "/vc17")
|
||||
elseif("${MSVC_VERSION}" STRGREATER "1916")
|
||||
@@ -422,6 +425,7 @@ macro(optimize_default_compiler_settings)
|
||||
endif()
|
||||
else()
|
||||
list(FIND CMAKE_CXX_COMPILE_FEATURES "cxx_std_20" CXX_STD_INDEX)
|
||||
+ set(CXX_STD_INDEX -1) # std::shared_ptr<>::unique() in libs/Common/FastDelegateCPP11.h
|
||||
if(${CXX_STD_INDEX} GREATER -1)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
else()
|
||||
@@ -624,7 +628,7 @@ macro(optimize_default_compiler_settings)
|
||||
|
||||
if(NOT MSVC64)
|
||||
# 64-bit MSVC compiler uses SSE/SSE2 by default
|
||||
- if(ENABLE_SSE)
|
||||
+ if(ENABLE_SSE AND NOT ENABLE_SSE2)
|
||||
set(BUILD_EXTRA_FLAGS "${BUILD_EXTRA_FLAGS} /arch:SSE")
|
||||
endif()
|
||||
if(ENABLE_SSE2)
|
||||
@@ -819,6 +823,7 @@ macro(ConfigLibrary)
|
||||
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
|
||||
# Make relative paths absolute (needed later on)
|
||||
foreach(p LIB BIN INCLUDE CMAKE)
|
||||
+ break() # keep relative paths
|
||||
set(var INSTALL_${p}_DIR)
|
||||
set(varp INSTALL_${p}_DIR_PREFIX)
|
||||
if(IS_ABSOLUTE "${${varp}}")
|
||||
@@ -847,6 +852,10 @@ function(cxx_library_with_type name folder type cxx_flags)
|
||||
if(BUILD_SHARED_LIBS OR PARTIAL_BUILD_SHARED_LIBS)
|
||||
set_target_properties("${name}" PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
+ set(ambiguous_names Common IO Math)
|
||||
+ if(name IN_LIST ambiguous_names)
|
||||
+ set_target_properties("${name}" PROPERTIES OUTPUT_NAME "MVS_${name}")
|
||||
+ endif()
|
||||
endfunction()
|
||||
|
||||
# cxx_executable_with_flags(name cxx_flags libs srcs...)
|
||||
diff --git a/libs/Common/CMakeLists.txt b/libs/Common/CMakeLists.txt
|
||||
index 18899af..258ada0 100644
|
||||
--- a/libs/Common/CMakeLists.txt
|
||||
+++ b/libs/Common/CMakeLists.txt
|
||||
@@ -12,7 +12,18 @@ IF(CMAKE_VERSION VERSION_GREATER_EQUAL 3.16.0)
|
||||
endif()
|
||||
|
||||
# Link its dependencies
|
||||
-TARGET_LINK_LIBRARIES(Common ${Boost_LIBRARIES} ${OpenCV_LIBS})
|
||||
+TARGET_LINK_LIBRARIES(Common
|
||||
+ $<BUILD_INTERFACE:Boost::assert>
|
||||
+ Boost::iostreams
|
||||
+ Boost::pool
|
||||
+ Boost::serialization
|
||||
+ Boost::throw_exception
|
||||
+ ${OpenCV_LIBS}
|
||||
+ Eigen3::Eigen
|
||||
+)
|
||||
+if(BUILD_EXTRA_FLAGS MATCHES "/Zc:__cplusplus")
|
||||
+ target_compile_options(Common PUBLIC "$<$<CXX_COMPILER_ID:MSVC>:-Zc:__cplusplus>")
|
||||
+endif()
|
||||
|
||||
# Install
|
||||
SET_TARGET_PROPERTIES(Common PROPERTIES
|
||||
diff --git a/libs/MVS/CMakeLists.txt b/libs/MVS/CMakeLists.txt
|
||||
index 8533865..2a13923 100644
|
||||
--- a/libs/MVS/CMakeLists.txt
|
||||
+++ b/libs/MVS/CMakeLists.txt
|
||||
@@ -48,7 +48,13 @@ endif()
|
||||
if(_USE_CUDA)
|
||||
SET_TARGET_PROPERTIES(MVS PROPERTIES CUDA_ARCHITECTURES "50;72;75")
|
||||
endif()
|
||||
-TARGET_LINK_LIBRARIES(MVS PRIVATE Common Math IO CGAL::CGAL ${CERES_LIBRARIES} ${CUDA_CUDA_LIBRARY})
|
||||
+TARGET_LINK_LIBRARIES(MVS PRIVATE Math IO CGAL::CGAL ${CERES_LIBRARIES} ${CUDA_CUDA_LIBRARY})
|
||||
+TARGET_LINK_LIBRARIES(MVS PUBLIC Common)
|
||||
+TARGET_LINK_LIBRARIES(MVS PRIVATE $<BUILD_INTERFACE:Boost::graph>)
|
||||
+if(OpenMVS_USE_OPENMP)
|
||||
+ target_link_libraries(MVS PRIVATE "$<INSTALL_INTERFACE:OpenMP::OpenMP_CXX>")
|
||||
+endif()
|
||||
+TARGET_INCLUDE_DIRECTORIES(MVS PUBLIC "$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>")
|
||||
|
||||
if(OpenMVS_USE_PYTHON)
|
||||
# Create the Python wrapper
|
||||
24
ports/openmvs/common-log.diff
Normal file
24
ports/openmvs/common-log.diff
Normal file
@@ -0,0 +1,24 @@
|
||||
diff --git a/libs/Common/Log.cpp b/libs/Common/Log.cpp
|
||||
index da19bd1..d92ae9b 100644
|
||||
--- a/libs/Common/Log.cpp
|
||||
+++ b/libs/Common/Log.cpp
|
||||
@@ -417,7 +417,9 @@ void LogConsole::Open()
|
||||
{
|
||||
if (IsOpen())
|
||||
return;
|
||||
+ #ifndef _USE_COSOLEFILEHANDLES
|
||||
++m_fileIn;
|
||||
+ #endif
|
||||
// register with our log system
|
||||
GET_LOG().RegisterListener(DELEGATEBINDCLASS(Log::ClbkRecordMsg, &LogConsole::Record, this));
|
||||
}
|
||||
@@ -428,7 +430,9 @@ void LogConsole::Close()
|
||||
return;
|
||||
// unregister with our log system
|
||||
GET_LOG().UnregisterListener(DELEGATEBINDCLASS(Log::ClbkRecordMsg, &LogConsole::Record, this));
|
||||
+ #ifndef _USE_COSOLEFILEHANDLES
|
||||
--m_fileIn;
|
||||
+ #endif
|
||||
}
|
||||
|
||||
void LogConsole::Record(const String& msg)
|
||||
117
ports/openmvs/devendor.diff
Normal file
117
ports/openmvs/devendor.diff
Normal file
@@ -0,0 +1,117 @@
|
||||
diff --git a/build/Templates/OpenMVSConfig.cmake.in b/build/Templates/OpenMVSConfig.cmake.in
|
||||
index 514f5a0..4906fc5 100644
|
||||
--- a/build/Templates/OpenMVSConfig.cmake.in
|
||||
+++ b/build/Templates/OpenMVSConfig.cmake.in
|
||||
@@ -20,6 +20,7 @@ find_dependency(Boost COMPONENTS iostreams pool serialization throw_exception)
|
||||
find_dependency(Eigen3 CONFIG)
|
||||
find_dependency(OpenCV)
|
||||
find_dependency(CGAL)
|
||||
+find_dependency(tinyxml2 CONFIG)
|
||||
if("@OpenMVS_USE_CERES@")
|
||||
find_dependency(Ceres)
|
||||
endif()
|
||||
diff --git a/libs/IO/CMakeLists.txt b/libs/IO/CMakeLists.txt
|
||||
index 0f05951..64c674f 100644
|
||||
--- a/libs/IO/CMakeLists.txt
|
||||
+++ b/libs/IO/CMakeLists.txt
|
||||
@@ -27,6 +27,7 @@ endif()
|
||||
# List sources files
|
||||
FILE(GLOB LIBRARY_FILES_C "*.cpp")
|
||||
FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl")
|
||||
+list(FILTER LIBRARY_FILES_C EXCLUDE REGEX "TinyXML2")
|
||||
|
||||
cxx_library_with_type(IO "Libs" "" "${cxx_default}"
|
||||
${LIBRARY_FILES_C} ${LIBRARY_FILES_H}
|
||||
@@ -39,6 +40,12 @@ endif()
|
||||
|
||||
# Link its dependencies
|
||||
TARGET_LINK_LIBRARIES(IO Common ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${EXIV2_LIBS})
|
||||
+find_package(nlohmann_json CONFIG REQUIRED)
|
||||
+target_link_libraries(IO $<BUILD_INTERFACE:nlohmann_json::nlohmann_json>)
|
||||
+find_path(TINYGLTF_INCLUDE_DIR "tiny_gltf.h")
|
||||
+target_include_directories(IO PRIVATE "${TINYGLTF_INCLUDE_DIR}")
|
||||
+find_package(tinyxml2 CONFIG REQUIRED)
|
||||
+target_link_libraries(IO tinyxml2::tinyxml2)
|
||||
|
||||
# Install
|
||||
SET_TARGET_PROPERTIES(IO PROPERTIES
|
||||
diff --git a/libs/IO/TinyXML2.h b/libs/IO/TinyXML2.h
|
||||
index ae237ad..00162df 100644
|
||||
--- a/libs/IO/TinyXML2.h
|
||||
+++ b/libs/IO/TinyXML2.h
|
||||
@@ -21,8 +21,10 @@ must not be misrepresented as being the original software.
|
||||
distribution.
|
||||
*/
|
||||
|
||||
-#ifndef TINYXML2_INCLUDED
|
||||
-#define TINYXML2_INCLUDED
|
||||
+#ifndef TINYXML2_INCLUDED_OPENMVS
|
||||
+#define TINYXML2_INCLUDED_OPENMVS
|
||||
+#include <tinyxml2.h>
|
||||
+#elif 0
|
||||
|
||||
#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__)
|
||||
# include <ctype.h>
|
||||
diff --git a/libs/IO/json.hpp b/libs/IO/json.hpp
|
||||
index b6d30f8..c5380e8 100644
|
||||
--- a/libs/IO/json.hpp
|
||||
+++ b/libs/IO/json.hpp
|
||||
@@ -27,8 +27,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
-#ifndef NLOHMANN_JSON_HPP
|
||||
-#define NLOHMANN_JSON_HPP
|
||||
+#ifndef NLOHMANN_JSON_HPP_OPENMVS
|
||||
+#define NLOHMANN_JSON_HPP_OPENMVS
|
||||
+#include <nlohmann/json.hpp>
|
||||
+#elif 0
|
||||
|
||||
#define NLOHMANN_JSON_VERSION_MAJOR 3
|
||||
#define NLOHMANN_JSON_VERSION_MINOR 5
|
||||
diff --git a/libs/IO/tiny_gltf.h b/libs/IO/tiny_gltf.h
|
||||
index 4718b6c..4cd2e1a 100644
|
||||
--- a/libs/IO/tiny_gltf.h
|
||||
+++ b/libs/IO/tiny_gltf.h
|
||||
@@ -50,8 +50,13 @@
|
||||
// - base64: base64 decode/encode library.
|
||||
// - stb_image: Image loading library.
|
||||
//
|
||||
-#ifndef TINY_GLTF_H_
|
||||
-#define TINY_GLTF_H_
|
||||
+#ifndef TINY_GLTF_H_OPENMVS
|
||||
+#define TINY_GLTF_H_OPENMVS
|
||||
+#include <tiny_gltf.h>
|
||||
+#ifdef TINYGLTF_IMPLEMENTATION
|
||||
+#undef TINYGLTF_IMPLEMENTATION
|
||||
+#endif
|
||||
+#elif 0
|
||||
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
diff --git a/libs/MVS/Mesh.cpp b/libs/MVS/Mesh.cpp
|
||||
index 589ad88..74a7e9e 100644
|
||||
--- a/libs/MVS/Mesh.cpp
|
||||
+++ b/libs/MVS/Mesh.cpp
|
||||
@@ -1763,14 +1763,17 @@ bool Mesh::SaveGLTF(const String& fileName, bool bBinary) const
|
||||
// setup GLTF
|
||||
struct Tools {
|
||||
static bool WriteImageData(const std::string *basepath, const std::string *filename,
|
||||
- tinygltf::Image *image, bool embedImages, void *) {
|
||||
+ // tinygltf 2.5...2.9: const image + out_uri, fs/uri callbacks.
|
||||
+ const tinygltf::Image *image, bool embedImages,
|
||||
+ const tinygltf::FsCallbacks *, const tinygltf::URICallbacks *,
|
||||
+ std::string *out_uri, void *) {
|
||||
ASSERT(!embedImages);
|
||||
- image->uri = Util::isFullPath(filename->c_str()) ?
|
||||
+ *out_uri = Util::isFullPath(filename->c_str()) ?
|
||||
Util::getRelativePath(*basepath, *filename) : String(*filename);
|
||||
String basePath(*basepath);
|
||||
return cv::imwrite(
|
||||
- Util::ensureFolderSlash(basePath) + image->uri,
|
||||
- cv::Mat(image->height, image->width, CV_8UC3, image->image.data()));
|
||||
+ Util::ensureFolderSlash(basePath) + *out_uri,
|
||||
+ cv::Mat(image->height, image->width, CV_8UC3, const_cast<tinygltf::Image*>(image)->image.data()));
|
||||
}
|
||||
};
|
||||
tinygltf::TinyGLTF gltf;
|
||||
@@ -1,166 +0,0 @@
|
||||
diff --git a/build/Templates/OpenMVSConfig.cmake.in b/build/Templates/OpenMVSConfig.cmake.in
|
||||
index 9747b3e..ed2347e 100644
|
||||
--- a/build/Templates/OpenMVSConfig.cmake.in
|
||||
+++ b/build/Templates/OpenMVSConfig.cmake.in
|
||||
@@ -15,9 +15,64 @@ set(OpenMVS_INCLUDE_DIRS "@INSTALL_INCLUDE_DIR_IN@")
|
||||
|
||||
set(OpenMVS_DEFINITIONS "@OpenMVS_DEFINITIONS@")
|
||||
|
||||
+list(APPEND CMAKE_MODULE_PATH "${OpenMVS_CMAKE_DIR}")
|
||||
+
|
||||
+if (MSVC)
|
||||
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GL")
|
||||
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
|
||||
+ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
|
||||
+ set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG")
|
||||
+endif()
|
||||
+
|
||||
+set(CMAKE_CXX_STANDARD 14)
|
||||
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
+
|
||||
+include(CMakeFindDependencyMacro)
|
||||
+
|
||||
+if(@OpenMVS_USE_OPENMP@)
|
||||
+ find_dependency(OpenMP)
|
||||
+ add_definitions(-D_USE_OPENMP)
|
||||
+endif()
|
||||
+
|
||||
+if(@OpenMVS_USE_OPENGL@)
|
||||
+ find_dependency(OpenGL)
|
||||
+ add_definitions(${OpenGL_DEFINITIONS} -D_USE_OPENGL)
|
||||
+endif()
|
||||
+
|
||||
+if(@OpenMVS_USE_CUDA@)
|
||||
+ find_dependency(CUDA)
|
||||
+ add_definitions(-D_USE_CUDA)
|
||||
+ include_directories(${CUDA_INCLUDE_DIRS})
|
||||
+endif()
|
||||
+
|
||||
+if(@OpenMVS_USE_BREAKPAD@)
|
||||
+ find_dependency(BREAKPAD)
|
||||
+ add_definitions(${BREAKPAD_DEFINITIONS} -D_USE_BREAKPAD)
|
||||
+endif()
|
||||
+
|
||||
+find_dependency(Boost COMPONENTS iostreams program_options system serialization)
|
||||
+add_definitions(${Boost_DEFINITIONS} -D_USE_BOOST)
|
||||
+include_directories(${Boost_INCLUDE_DIRS})
|
||||
+find_dependency(Eigen3)
|
||||
+add_definitions(${EIGEN3_DEFINITIONS} -D_USE_EIGEN)
|
||||
+include_directories(${EIGEN3_INCLUDE_DIRS})
|
||||
+find_dependency(OpenCV)
|
||||
+add_definitions(${OpenCV_DEFINITIONS})
|
||||
+find_dependency(CGAL)
|
||||
+add_definitions(${CGAL_DEFINITIONS})
|
||||
+
|
||||
+if(@OpenMVS_USE_CERES@)
|
||||
+ find_dependency(Ceres)
|
||||
+ add_definitions(${CERES_DEFINITIONS})
|
||||
+endif()
|
||||
+
|
||||
+add_definitions(@OpenMVS_DEFINITIONS@)
|
||||
+
|
||||
+# Our library dependencies (contains definitions for IMPORTED targets)
|
||||
+if(NOT TARGET MVS AND NOT OpenMVS_BINARY_DIR)
|
||||
+ include("${OpenMVS_CMAKE_DIR}/OpenMVSTargets.cmake")
|
||||
+endif()
|
||||
+
|
||||
# These are IMPORTED targets created by OpenMVSTargets.cmake
|
||||
set(OpenMVS_LIBRARIES MVS)
|
||||
-set(OpenMVS_BINARIES InterfaceCOLMAP DensifyPointCloud ReconstructMesh RefineMesh TextureMesh)
|
||||
-
|
||||
-include("${CMAKE_CURRENT_LIST_DIR}/OpenMVSTargets.cmake")
|
||||
-check_required_components("OpenMVS")
|
||||
+set(OpenMVS_BINARIES InterfaceCOLMAP InterfaceMetashape InterfaceMVSNet DensifyPointCloud ReconstructMesh RefineMesh TextureMesh TransformScene Viewer)
|
||||
diff --git a/build/Utils.cmake b/build/Utils.cmake
|
||||
index 0cb2d8e1..62e1661f 100644
|
||||
--- a/build/Utils.cmake
|
||||
+++ b/build/Utils.cmake
|
||||
@@ -173,32 +173,6 @@ macro(ComposePackageLibSuffix)
|
||||
set(PACKAGE_LIB_SUFFIX "")
|
||||
set(PACKAGE_LIB_SUFFIX_DBG "")
|
||||
set(PACKAGE_LIB_SUFFIX_REL "")
|
||||
- if(MSVC)
|
||||
- if("${MSVC_VERSION}" STRGREATER "1929")
|
||||
- set(PACKAGE_LIB_SUFFIX "/vc17")
|
||||
- elseif("${MSVC_VERSION}" STRGREATER "1916")
|
||||
- set(PACKAGE_LIB_SUFFIX "/vc16")
|
||||
- elseif("${MSVC_VERSION}" STRGREATER "1900")
|
||||
- set(PACKAGE_LIB_SUFFIX "/vc15")
|
||||
- elseif("${MSVC_VERSION}" STREQUAL "1900")
|
||||
- set(PACKAGE_LIB_SUFFIX "/vc14")
|
||||
- elseif("${MSVC_VERSION}" STREQUAL "1800")
|
||||
- set(PACKAGE_LIB_SUFFIX "/vc12")
|
||||
- elseif("${MSVC_VERSION}" STREQUAL "1700")
|
||||
- set(PACKAGE_LIB_SUFFIX "/vc11")
|
||||
- elseif("${MSVC_VERSION}" STREQUAL "1600")
|
||||
- set(PACKAGE_LIB_SUFFIX "/vc10")
|
||||
- elseif("${MSVC_VERSION}" STREQUAL "1500")
|
||||
- set(PACKAGE_LIB_SUFFIX "/vc9")
|
||||
- endif()
|
||||
- if("${SYSTEM_BITNESS}" STREQUAL "64")
|
||||
- set(PACKAGE_LIB_SUFFIX "${PACKAGE_LIB_SUFFIX}/x64")
|
||||
- else()
|
||||
- set(PACKAGE_LIB_SUFFIX "${PACKAGE_LIB_SUFFIX}/x86")
|
||||
- endif()
|
||||
- set(PACKAGE_LIB_SUFFIX_DBG "${PACKAGE_LIB_SUFFIX}/Debug")
|
||||
- set(PACKAGE_LIB_SUFFIX_REL "${PACKAGE_LIB_SUFFIX}/Release")
|
||||
- endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
@@ -805,12 +779,8 @@ macro(ConfigLibrary)
|
||||
# Offer the user the choice of overriding the installation directories
|
||||
set(INSTALL_LIB_DIR "lib" CACHE PATH "Installation directory for libraries")
|
||||
set(INSTALL_BIN_DIR "bin" CACHE PATH "Installation directory for executables")
|
||||
- set(INSTALL_INCLUDE_DIR "include" CACHE PATH "Installation directory for header files")
|
||||
- if(WIN32 AND NOT CYGWIN)
|
||||
- set(DEF_INSTALL_CMAKE_DIR "CMake")
|
||||
- else()
|
||||
- set(DEF_INSTALL_CMAKE_DIR "lib/cmake")
|
||||
- endif()
|
||||
+ set(INSTALL_INCLUDE_DIR "include/openmvs" CACHE PATH "Installation directory for header files")
|
||||
+ set(DEF_INSTALL_CMAKE_DIR "share/openmvs")
|
||||
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
|
||||
# Make relative paths absolute (needed later on)
|
||||
foreach(p LIB BIN INCLUDE CMAKE)
|
||||
@@ -821,7 +791,7 @@ macro(ConfigLibrary)
|
||||
else()
|
||||
set(${varp} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
endif()
|
||||
- set(${var} "${${varp}}/${PROJECT_NAME}")
|
||||
+ set(${var} "${${varp}}")
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
|
||||
diff --git a/libs/Common/Strings.h b/libs/Common/MVSStrings.h
|
||||
similarity index 100%
|
||||
rename from libs/Common/Strings.h
|
||||
rename to libs/Common/MVSStrings.h
|
||||
diff --git a/libs/Common/Types.h b/libs/Common/Types.h
|
||||
index d5dcb27e..04fbfe2f 100644
|
||||
--- a/libs/Common/Types.h
|
||||
+++ b/libs/Common/Types.h
|
||||
@@ -385,7 +385,7 @@ typedef TAliasCast<double,int32_t> CastD2I;
|
||||
|
||||
// I N C L U D E S /////////////////////////////////////////////////
|
||||
|
||||
-#include "Strings.h"
|
||||
+#include "MVSStrings.h"
|
||||
#include "AutoPtr.h"
|
||||
#include "List.h"
|
||||
#include "Thread.h"
|
||||
|
||||
diff --git a/apps/InterfaceMetashape/InterfaceMetashape.cpp b/apps/InterfaceMetashape/InterfaceMetashape.cpp
|
||||
index 4886973a..c2ab8f98 100644
|
||||
--- a/apps/InterfaceMetashape/InterfaceMetashape.cpp
|
||||
+++ b/apps/InterfaceMetashape/InterfaceMetashape.cpp
|
||||
@@ -627,7 +627,7 @@ bool ParseSceneXML(Scene& scene, PlatformDistCoeffs& pltDistCoeffs, size_t& nCam
|
||||
}
|
||||
const size_t nLen(pStream->getSize());
|
||||
String str; str.resize(nLen);
|
||||
- pStream->read(&str[0], nLen);
|
||||
+ pStream->read(str.data(), nLen);
|
||||
doc.Parse(str.c_str(), nLen);
|
||||
}
|
||||
if (doc.ErrorID() != tinyxml2::XML_SUCCESS) {
|
||||
@@ -1,23 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 03225b8..e343aba 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -184,14 +184,12 @@ if(Boost_FOUND)
|
||||
SET(_USE_BOOST TRUE)
|
||||
endif()
|
||||
|
||||
-FIND_PACKAGE(Eigen3 REQUIRED)
|
||||
-if(EIGEN3_FOUND)
|
||||
- LIST(APPEND OpenMVS_EXTRA_INCLUDES ${EIGEN3_INCLUDE_DIR})
|
||||
- INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
|
||||
+FIND_PACKAGE(Eigen3 CONFIG REQUIRED)
|
||||
+if(Eigen3_FOUND)
|
||||
LIST(APPEND OpenMVS_DEFINITIONS -D_USE_EIGEN)
|
||||
- ADD_DEFINITIONS(${EIGEN3_DEFINITIONS})
|
||||
+ LINK_LIBRARIES(Eigen3::Eigen)
|
||||
SET(_USE_EIGEN TRUE)
|
||||
- MESSAGE(STATUS "Eigen ${EIGEN3_VERSION} found (include: ${EIGEN3_INCLUDE_DIR})")
|
||||
+ MESSAGE(STATUS "Eigen ${Eigen3_VERSION} found")
|
||||
endif()
|
||||
|
||||
FIND_PACKAGE(OpenCV REQUIRED)
|
||||
@@ -1,12 +0,0 @@
|
||||
diff --git a/libs/Common/CMakeLists.txt b/libs/Common/CMakeLists.txt
|
||||
index 18899af..1dd2c8d 100644
|
||||
--- a/libs/Common/CMakeLists.txt
|
||||
+++ b/libs/Common/CMakeLists.txt
|
||||
@@ -16,6 +16,7 @@ TARGET_LINK_LIBRARIES(Common ${Boost_LIBRARIES} ${OpenCV_LIBS})
|
||||
|
||||
# Install
|
||||
SET_TARGET_PROPERTIES(Common PROPERTIES
|
||||
+ OUTPUT_NAME "OpenMVS_Common"
|
||||
PUBLIC_HEADER "${LIBRARY_FILES_H}")
|
||||
INSTALL(TARGETS Common
|
||||
EXPORT OpenMVSTargets
|
||||
@@ -1,19 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 39ec359ac3..03225b8940 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -177,10 +177,10 @@ if(Boost_FOUND)
|
||||
LIST(APPEND OpenMVS_DEFINITIONS -D_USE_BOOST)
|
||||
ADD_DEFINITIONS(${Boost_DEFINITIONS})
|
||||
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
|
||||
- if(NOT MSVC AND DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||
- # work around this missing library link in vcpkg
|
||||
- LIST(APPEND Boost_LIBRARIES zstd)
|
||||
- endif()
|
||||
+ LINK_LIBRARIES(${Boost_LIBRARIES})
|
||||
+ find_package(zstd CONFIG REQUIRED)
|
||||
+ LINK_LIBRARIES($<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>)
|
||||
+
|
||||
SET(_USE_BOOST TRUE)
|
||||
endif()
|
||||
|
||||
13
ports/openmvs/interface-metashape.diff
Normal file
13
ports/openmvs/interface-metashape.diff
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/apps/InterfaceMetashape/InterfaceMetashape.cpp b/apps/InterfaceMetashape/InterfaceMetashape.cpp
|
||||
index 03a80ce..5df6a21 100644
|
||||
--- a/apps/InterfaceMetashape/InterfaceMetashape.cpp
|
||||
+++ b/apps/InterfaceMetashape/InterfaceMetashape.cpp
|
||||
@@ -625,7 +625,7 @@ bool ParseSceneXML(Scene& scene, PlatformDistCoeffs& pltDistCoeffs, size_t& nCam
|
||||
}
|
||||
const size_t nLen(pStream->getSize());
|
||||
String str; str.resize(nLen);
|
||||
- pStream->read(&str[0], nLen);
|
||||
+ pStream->read(str.data(), nLen);
|
||||
doc.Parse(str.c_str(), nLen);
|
||||
}
|
||||
if (doc.ErrorID() != tinyxml2::XML_SUCCESS) {
|
||||
12
ports/openmvs/missing-include.diff
Normal file
12
ports/openmvs/missing-include.diff
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/libs/Common/Types.h b/libs/Common/Types.h
|
||||
index 1ae23ce..38bd9f7 100644
|
||||
--- a/libs/Common/Types.h
|
||||
+++ b/libs/Common/Types.h
|
||||
@@ -33,6 +33,7 @@
|
||||
#else
|
||||
#include <cstdint>
|
||||
#endif
|
||||
+#include <bitset>
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
#include <initializer_list>
|
||||
@@ -1,17 +1,18 @@
|
||||
diff --git a/MvgMvsPipeline.py b/MvgMvsPipeline.py.in
|
||||
index 53a4a5cc..97735396 100644
|
||||
--- a/MvgMvsPipeline.py
|
||||
+++ b/MvgMvsPipeline.py.in
|
||||
@@ -109,14 +109,14 @@ def find(afile):
|
||||
return d
|
||||
diff --git a/scripts/python/MvgMvsPipeline.py b/scripts/python/MvgMvsPipeline.py
|
||||
index fd380eb..1b8fcbc 100644
|
||||
--- a/scripts/python/MvgMvsPipeline.py
|
||||
+++ b/scripts/python/MvgMvsPipeline.py
|
||||
@@ -118,14 +118,15 @@ def find(afile):
|
||||
return None
|
||||
|
||||
-
|
||||
|
||||
+current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
# Try to find openMVG and openMVS binaries in PATH
|
||||
# Try to find openMVG, COLMAP, and openMVS binaries in PATH
|
||||
-OPENMVG_BIN = whereis("openMVG_main_SfMInit_ImageListing")
|
||||
-COLMAP_BIN = whereis("colmap")
|
||||
-OPENMVS_BIN = whereis("ReconstructMesh")
|
||||
+OPENMVG_BIN = os.path.join(current_dir, '..', 'openmvg')
|
||||
+COLMAP_BIN = os.path.join(current_dir, '..', 'colmap')
|
||||
+OPENMVS_BIN = current_dir
|
||||
|
||||
# Try to find openMVG camera sensor database
|
||||
@@ -20,13 +21,12 @@ index 53a4a5cc..97735396 100644
|
||||
+CAMERA_SENSOR_DB_FILE = os.path.join(OPENMVG_BIN, 'sensor_width_camera_database.txt')
|
||||
+CAMERA_SENSOR_DB_DIRECTORY = OPENMVS_BIN
|
||||
|
||||
# Ask user for openMVG and openMVS directories if not found
|
||||
# Ask user for openMVG, COLMAP, and openMVS directories if not found
|
||||
if not OPENMVG_BIN:
|
||||
|
||||
diff --git a/MvgOptimizeSfM.py b/MvgOptimizeSfM.py.in
|
||||
index 930d6805..6eb672c1 100644
|
||||
--- a/MvgOptimizeSfM.py
|
||||
+++ b/MvgOptimizeSfM.py.in
|
||||
diff --git a/scripts/python/MvgOptimizeSfM.py b/scripts/python/MvgOptimizeSfM.py
|
||||
index 930d680..6eb672c 100644
|
||||
--- a/scripts/python/MvgOptimizeSfM.py
|
||||
+++ b/scripts/python/MvgOptimizeSfM.py
|
||||
@@ -56,9 +56,10 @@ def launch(cmdline):
|
||||
sys.exit('\r\nProcess canceled by user, all files remains')
|
||||
|
||||
|
||||
@@ -1,88 +1,111 @@
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) # needs fixes
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO cdcseacave/openMVS
|
||||
REF "v${VERSION}"
|
||||
SHA512 95d83c6694b63b6fd27657c4c5e22ddbc078d26b7324b8f17952a6c7e4547028698aa155077c0cfb916d3497ca31c365e0cbcd81f3cbe959ef40a7ee2e5cd300
|
||||
SHA512 c8af808393836d0ac508cf4f1d123cf297b451927fe4ad95dd27e041099818cd6d077f95b03e34cd9fe92bf0277cce8e9386311531093d6469b8e07f08b15aba
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-build.patch
|
||||
ambiguous-uint_t.diff
|
||||
cmake.diff
|
||||
common-log.diff
|
||||
devendor.diff
|
||||
interface-metashape.diff
|
||||
missing-include.diff
|
||||
no-absolute-paths.patch
|
||||
fix-static-build.patch
|
||||
fix-lib-name-conflict.patch
|
||||
fix-eigen3.patch
|
||||
)
|
||||
file(REMOVE "${SOURCE_PATH}/build/Modules/FindEigen3.cmake")
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
cuda OpenMVS_USE_CUDA
|
||||
openmp OpenMVS_USE_OPENMP
|
||||
nonfree OpenMVS_USE_NONFREE
|
||||
ceres OpenMVS_USE_CERES
|
||||
ceres OpenMVS_USE_CERES
|
||||
ceres VCPKG_LOCK_FIND_PACKAGE_Ceres
|
||||
cuda OpenMVS_USE_CUDA
|
||||
cuda VCPKG_LOCK_FIND_PACKAGE_CUDA
|
||||
opengl OpenMVS_USE_OPENGL
|
||||
opengl VCPKG_LOCK_FIND_PACKAGE_OpenGL
|
||||
openmp OpenMVS_USE_OPENMP
|
||||
openmp VCPKG_LOCK_FIND_PACKAGE_OpenMP
|
||||
tools OpenMVS_BUILD_TOOLS
|
||||
viewer VCPKG_LOCK_FIND_PACKAGE_GLEW
|
||||
viewer VCPKG_LOCK_FIND_PACKAGE_GLFW
|
||||
)
|
||||
|
||||
file(REMOVE "${SOURCE_PATH}/build/Modules/FindCERES.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/build/Modules/FindCGAL.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/build/Modules/FindEIGEN.cmake")
|
||||
if("cuda" IN_LIST FEATURES)
|
||||
vcpkg_find_cuda(OUT_CUDA_TOOLKIT_ROOT cuda_toolkit_root)
|
||||
list(APPEND FEATURE_OPTIONS
|
||||
"-DCMAKE_CUDA_COMPILER=${NVCC}"
|
||||
"-DCUDAToolkit_ROOT=${cuda_toolkit_root}"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(USE_SSE OFF)
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
set(USE_SSE ON)
|
||||
else()
|
||||
set(USE_SSE OFF)
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS ${FEATURE_OPTIONS}
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${FEATURE_OPTIONS}
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW # MSVC runtime, needed for CUDA
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0167=NEW # Boost
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0177=NEW # install() DESTINATION
|
||||
-DINSTALL_CMAKE_DIR:STRING=share/openmvs
|
||||
-DINSTALL_INCLUDE_DIR:STRING=include/openmvs
|
||||
-DOpenMVS_ENABLE_TESTS=OFF
|
||||
-DOpenMVS_USE_BREAKPAD=OFF
|
||||
-DOpenMVS_USE_FAST_CBRT=ON
|
||||
-DOpenMVS_USE_FAST_FLOAT2INT=ON
|
||||
-DOpenMVS_USE_FAST_INVSQRT=OFF
|
||||
-DOpenMVS_USE_FAST_CBRT=ON
|
||||
-DOpenMVS_USE_SSE=ON
|
||||
-DOpenMVS_USE_OPENGL=ON
|
||||
-DOpenMVS_USE_BREAKPAD=OFF
|
||||
-DOpenMVS_ENABLE_TESTS=OFF
|
||||
-DOpenMVS_USE_PYTHON=OFF
|
||||
-DOpenMVS_USE_SSE=${USE_SSE}
|
||||
OPTIONS_RELEASE
|
||||
-DOpenMVS_BUILD_TOOLS=ON
|
||||
-DVCPKG_LOCK_FIND_PACKAGE_JPEG=ON
|
||||
-DVCPKG_LOCK_FIND_PACKAGE_OpenGL=ON
|
||||
-DVCPKG_LOCK_FIND_PACKAGE_PNG=ON
|
||||
-DVCPKG_LOCK_FIND_PACKAGE_TIFF=ON
|
||||
OPTIONS_DEBUG
|
||||
-DOpenMVS_BUILD_TOOLS=OFF
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
# subject to features
|
||||
VCPKG_LOCK_FIND_PACKAGE_Ceres
|
||||
VCPKG_LOCK_FIND_PACKAGE_CUDA
|
||||
VCPKG_LOCK_FIND_PACKAGE_GLEW
|
||||
VCPKG_LOCK_FIND_PACKAGE_GLFW
|
||||
VCPKG_LOCK_FIND_PACKAGE_OpenGL
|
||||
VCPKG_LOCK_FIND_PACKAGE_OpenMP
|
||||
VCPKG_LOCK_FIND_PACKAGE_OpenMVG
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
vcpkg_cmake_config_fixup()
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/share/${PORT}/OpenMVSTargets-release.cmake TARGETS_CMAKE)
|
||||
string(REPLACE "bin/InterfaceCOLMAP" "tools/${PORT}/InterfaceCOLMAP" TARGETS_CMAKE "${TARGETS_CMAKE}")
|
||||
string(REPLACE "bin/InterfaceMetashape" "tools/${PORT}/InterfaceMetashape" TARGETS_CMAKE "${TARGETS_CMAKE}")
|
||||
string(REPLACE "bin/InterfaceMVSNet" "tools/${PORT}/InterfaceMVSNet" TARGETS_CMAKE "${TARGETS_CMAKE}")
|
||||
string(REPLACE "bin/DensifyPointCloud" "tools/${PORT}/DensifyPointCloud" TARGETS_CMAKE "${TARGETS_CMAKE}")
|
||||
string(REPLACE "bin/ReconstructMesh" "tools/${PORT}/ReconstructMesh" TARGETS_CMAKE "${TARGETS_CMAKE}")
|
||||
string(REPLACE "bin/RefineMesh" "tools/${PORT}/RefineMesh" TARGETS_CMAKE "${TARGETS_CMAKE}")
|
||||
string(REPLACE "bin/TextureMesh" "tools/${PORT}/TextureMesh" TARGETS_CMAKE "${TARGETS_CMAKE}")
|
||||
string(REPLACE "bin/TransformScene" "tools/${PORT}/TransformScene" TARGETS_CMAKE "${TARGETS_CMAKE}")
|
||||
string(REPLACE "bin/Viewer" "tools/${PORT}/Viewer" TARGETS_CMAKE "${TARGETS_CMAKE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/OpenMVSTargets-release.cmake "${TARGETS_CMAKE}")
|
||||
|
||||
vcpkg_copy_tools(AUTO_CLEAN TOOL_NAMES
|
||||
DensifyPointCloud
|
||||
InterfaceCOLMAP
|
||||
InterfaceMetashape
|
||||
InterfaceMVSNet
|
||||
ReconstructMesh
|
||||
RefineMesh
|
||||
TextureMesh
|
||||
TransformScene
|
||||
Viewer
|
||||
)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
set(OPENMVG_TOOLS_PATH "${CURRENT_INSTALLED_DIR}/tools/openmvg")
|
||||
set(OPENMVS_TOOLS_PATH "${CURRENT_INSTALLED_DIR}/tools/${PORT}")
|
||||
set(SENSOR_WIDTH_CAMERA_DATABASE_TXT_PATH "${OPENMVG_TOOLS_PATH}/sensor_width_camera_database.txt")
|
||||
configure_file("${SOURCE_PATH}/MvgMvsPipeline.py.in" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/MvgMvsPipeline.py" @ONLY)
|
||||
configure_file("${SOURCE_PATH}/MvgOptimizeSfM.py.in" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/MvgOptimizeSfM.py" @ONLY)
|
||||
file(INSTALL "${SOURCE_PATH}/build/Modules/FindVCG.cmake" DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
||||
if("tools" IN_LIST FEATURES)
|
||||
vcpkg_copy_tools(AUTO_CLEAN TOOL_NAMES
|
||||
DensifyPointCloud
|
||||
InterfaceCOLMAP
|
||||
InterfaceMetashape
|
||||
InterfaceMVSNet
|
||||
InterfacePolycam
|
||||
ReconstructMesh
|
||||
RefineMesh
|
||||
TextureMesh
|
||||
TransformScene
|
||||
)
|
||||
if("viewer" IN_LIST FEATURES)
|
||||
vcpkg_copy_tools(AUTO_CLEAN TOOL_NAMES Viewer)
|
||||
endif()
|
||||
file(INSTALL
|
||||
"${SOURCE_PATH}/scripts/python/MvgMvsPipeline.py"
|
||||
"${SOURCE_PATH}/scripts/python/MvgOptimizeSfM.py"
|
||||
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}"
|
||||
)
|
||||
endif()
|
||||
|
||||
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
|
||||
4
ports/openmvs/usage
Normal file
4
ports/openmvs/usage
Normal file
@@ -0,0 +1,4 @@
|
||||
openmvs provides CMake targets:
|
||||
|
||||
find_package(OpenMVS CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE OpenMVS::MVS)
|
||||
@@ -1,14 +1,15 @@
|
||||
{
|
||||
"name": "openmvs",
|
||||
"version": "2.1.0",
|
||||
"port-version": 8,
|
||||
"version": "2.3.0",
|
||||
"description": "OpenMVS: open Multi-View Stereo reconstruction library",
|
||||
"homepage": "https://cdcseacave.github.io/openMVS",
|
||||
"homepage": "https://cdcseacave.github.io/",
|
||||
"license": "AGPL-3.0-only",
|
||||
"supports": "!xbox",
|
||||
"dependencies": [
|
||||
"boost-assert",
|
||||
"boost-graph",
|
||||
"boost-iostreams",
|
||||
"boost-program-options",
|
||||
"boost-pool",
|
||||
"boost-serialization",
|
||||
"boost-system",
|
||||
"boost-throw-exception",
|
||||
@@ -17,14 +18,22 @@
|
||||
"default-features": false
|
||||
},
|
||||
"eigen3",
|
||||
"glew",
|
||||
"glfw3",
|
||||
"libjpeg-turbo",
|
||||
"libpng",
|
||||
"opencv",
|
||||
"nlohmann-json",
|
||||
{
|
||||
"name": "opencv",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"highgui"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tiff",
|
||||
"default-features": false
|
||||
},
|
||||
"tinygltf",
|
||||
"tinyxml2",
|
||||
"vcglib",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
@@ -36,9 +45,6 @@
|
||||
},
|
||||
"zlib"
|
||||
],
|
||||
"default-features": [
|
||||
"nonfree"
|
||||
],
|
||||
"features": {
|
||||
"ceres": {
|
||||
"description": "CERES support for openmvs",
|
||||
@@ -52,11 +58,34 @@
|
||||
"cuda"
|
||||
]
|
||||
},
|
||||
"nonfree": {
|
||||
"description": "nonfree support for openmvs"
|
||||
"opengl": {
|
||||
"description": "OpenGL support for openmvs",
|
||||
"dependencies": [
|
||||
"opengl"
|
||||
]
|
||||
},
|
||||
"openmp": {
|
||||
"description": "OpenMP support for openmvs"
|
||||
},
|
||||
"tools": {
|
||||
"description": "Install tools",
|
||||
"dependencies": [
|
||||
"boost-program-options"
|
||||
]
|
||||
},
|
||||
"viewer": {
|
||||
"description": "Install Viewer tool",
|
||||
"dependencies": [
|
||||
"glew",
|
||||
"glfw3",
|
||||
{
|
||||
"name": "openmvs",
|
||||
"features": [
|
||||
"opengl",
|
||||
"tools"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,10 +186,9 @@ openmesh(uwp)=fail
|
||||
openmpi:arm-neon-android=fail
|
||||
openmpi:arm64-android=fail
|
||||
openmpi:x64-android=fail
|
||||
openmvs:arm64-windows = fail
|
||||
openmvs:arm64-windows-static-md = fail
|
||||
openslide(windows & native)=fail # g_auto* using __attribute__((cleanup))
|
||||
# Incorrect use of arm64 intrinsics in <wchar.h> in VS 2022 17.13 broke these with -Zc:arm64-aliased-neon-types-
|
||||
openmvs(arm & windows & !uwp)=fail # intrinsics
|
||||
openslide(windows & native)=fail # g_auto* using __attribute__((cleanup))
|
||||
openvino:arm64-windows-static-md=fail
|
||||
openvino:arm64-windows=fail
|
||||
openvr:x64-windows-static=fail
|
||||
@@ -1736,10 +1735,8 @@ opencv4[ovis](android)=feature-fails
|
||||
openmvg[core](arm & windows & !uwp) = combination-fails # nmmintrin.h(17): fatal error C1189: #error: This header is specific to X86, X64, ARM64, and ARM64EC targets. See https://github.com/microsoft/vcpkg/issues/33746
|
||||
openmvg[opencv](arm & windows & !uwp) = feature-fails
|
||||
openmvg[openmp](arm & windows & !uwp) = feature-fails
|
||||
openmvg[software]:x64-windows-static = feature-fails
|
||||
openmvg[software]:x64-windows-static-md = feature-fails
|
||||
openmvs[cuda]:x64-linux = feature-fails
|
||||
openmvs[cuda]:x64-windows-static = feature-fails
|
||||
openmvs[opengl](android) = feature-fails
|
||||
openmvs[openmp](osx) = feature-fails # openmp setup needed
|
||||
openscap[python](!windows) = feature-fails # CI image lacks swig
|
||||
opentelemetry-cpp[otlp](uwp) = feature-fails # --grpc_out: protoc-gen-grpc: The system cannot find the file specified. See https://github.com/microsoft/vcpkg/issues/34847
|
||||
osgearth[tools](osx) = feature-fails # Undefined _NSSearchPathForDirectoriesInDomains
|
||||
|
||||
17
scripts/test_ports/vcpkg-ci-openmvs/portfile.cmake
Normal file
17
scripts/test_ports/vcpkg-ci-openmvs/portfile.cmake
Normal file
@@ -0,0 +1,17 @@
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO cdcseacave/openMVS
|
||||
REF "v2.3.0"
|
||||
SHA512 c8af808393836d0ac508cf4f1d123cf297b451927fe4ad95dd27e041099818cd6d077f95b03e34cd9fe92bf0277cce8e9386311531093d6469b8e07f08b15aba
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
standalone.diff
|
||||
)
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/libs")
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}/apps/Tests"
|
||||
)
|
||||
vcpkg_cmake_build()
|
||||
44
scripts/test_ports/vcpkg-ci-openmvs/standalone.diff
Normal file
44
scripts/test_ports/vcpkg-ci-openmvs/standalone.diff
Normal file
@@ -0,0 +1,44 @@
|
||||
diff --git a/apps/Tests/CMakeLists.txt b/apps/Tests/CMakeLists.txt
|
||||
index 192178b..d8356be 100644
|
||||
--- a/apps/Tests/CMakeLists.txt
|
||||
+++ b/apps/Tests/CMakeLists.txt
|
||||
@@ -1,3 +1,5 @@
|
||||
+cmake_minimum_required(VERSION 3.30)
|
||||
+project(OpenMVS-Test)
|
||||
if(MSVC)
|
||||
FILE(GLOB LIBRARY_FILES_C "*.cpp" "*.rc")
|
||||
else()
|
||||
@@ -7,6 +9,18 @@ FILE(GLOB LIBRARY_FILES_H "*.h" "*.inl")
|
||||
|
||||
ADD_DEFINITIONS(-D_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/data/")
|
||||
|
||||
+find_package(OpenMVS CONFIG REQUIRED)
|
||||
+
|
||||
+add_executable(OpenMVS-Test-Target ${LIBRARY_FILES_C})
|
||||
+target_link_libraries(OpenMVS-Test-Target PRIVATE OpenMVS::MVS)
|
||||
+
|
||||
+add_executable(OpenMVS-Test-Vars ${LIBRARY_FILES_C})
|
||||
+target_compile_definitions(OpenMVS-Test-Vars PRIVATE ${OpenMVS_DEFINITIONS})
|
||||
+target_include_directories(OpenMVS-Test-Vars PRIVATE ${OpenMVS_INCLUDE_DIRS})
|
||||
+target_link_libraries(OpenMVS-Test-Vars PRIVATE ${OpenMVS_LIBRARIES})
|
||||
+
|
||||
+return()
|
||||
+
|
||||
cxx_executable_with_flags(Tests "Apps" "${cxx_default}" "MVS;${OpenMVS_EXTRA_LIBS}" ${LIBRARY_FILES_C} ${LIBRARY_FILES_H})
|
||||
|
||||
# Install
|
||||
diff --git a/apps/Tests/Tests.cpp b/apps/Tests/Tests.cpp
|
||||
index f0f8365..97255ab 100644
|
||||
--- a/apps/Tests/Tests.cpp
|
||||
+++ b/apps/Tests/Tests.cpp
|
||||
@@ -29,8 +29,8 @@
|
||||
* containing it.
|
||||
*/
|
||||
|
||||
-#include "../../libs/MVS/Common.h"
|
||||
-#include "../../libs/MVS/Scene.h"
|
||||
+#include <MVS/Common.h>
|
||||
+#include <MVS/Scene.h>
|
||||
|
||||
using namespace MVS;
|
||||
|
||||
81
scripts/test_ports/vcpkg-ci-openmvs/vcpkg.json
Normal file
81
scripts/test_ports/vcpkg-ci-openmvs/vcpkg.json
Normal file
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"name": "vcpkg-ci-openmvs",
|
||||
"version-string": "ci",
|
||||
"description": "Port to validate openmvs",
|
||||
"homepage": "https://github.com/microsoft/vcpkg",
|
||||
"license": "MIT",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "openmvs",
|
||||
"default-features": false
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
{
|
||||
"name": "ceres",
|
||||
"platform": "osx"
|
||||
},
|
||||
{
|
||||
"name": "cuda",
|
||||
"platform": "x64 & windows & !staticcrt"
|
||||
},
|
||||
{
|
||||
"name": "opengl",
|
||||
"platform": "x64 & !android"
|
||||
},
|
||||
{
|
||||
"name": "openmp",
|
||||
"platform": "linux"
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"ceres": {
|
||||
"description": "CERES support for openmvs",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "openmvs",
|
||||
"features": [
|
||||
"ceres"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"cuda": {
|
||||
"description": "CUDA support for openmvs",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "openmvs",
|
||||
"features": [
|
||||
"cuda"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"opengl": {
|
||||
"description": "OpenGL support for openmvs",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "openmvs",
|
||||
"features": [
|
||||
"opengl"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"openmp": {
|
||||
"description": "OpenMP support for openmvs",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "openmvs",
|
||||
"features": [
|
||||
"openmp"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7225,8 +7225,8 @@
|
||||
"port-version": 4
|
||||
},
|
||||
"openmvs": {
|
||||
"baseline": "2.1.0",
|
||||
"port-version": 8
|
||||
"baseline": "2.3.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"openni2": {
|
||||
"baseline": "2.2.0.33",
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "2cdb6db57a426994e723f049d146eae722cee74d",
|
||||
"version": "2.3.0",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "180701ef9b2ef5a070917ab46687231efef250a2",
|
||||
"version": "2.1.0",
|
||||
|
||||
Reference in New Issue
Block a user