vcpkg/ports/openmvg/build_fixes.patch
Stefano Sinigardi eb044d1eb5
[OpenCV] bump to 4.5.1 and to 3.4.13 (#15859)
* [OpenCV] bump to 4.5.1 and to 3.4.13

* [OpenCV] fix patches

* [OpenCV] fix hdf5 integration

* [OpenCV] devendor quirc

* fix quirc for downstream ports

* [quirc] fix target export

* update version refs

* [OpenMVG] fix regressions with new opencv

* update version refs

* fix quirc mismatch

* update version refs
2021-01-28 19:23:57 -08:00

737 lines
27 KiB
Diff

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9cfd06c..8859469 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,6 +14,7 @@ if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds not allowed.")
endif()
+if(0)
# ==============================================================================
# OpenMVG build options
# ==============================================================================
@@ -31,7 +32,7 @@ option(OpenMVG_USE_OPENMP "Enable OpenMP parallelization" ON)
# and openMVG simultaneously
# ==============================================================================
option(OpenMVG_USE_OPENCV "Build or not opencv+openMVG samples programs" OFF)
-
+endif()
# ==============================================================================
# Since OpenCV 3, SIFT is no longer in the default modules. See
# https://github.com/itseez/opencv_contrib for more informations.
@@ -85,6 +86,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
register_definitions(-DOPENMVG_STD_UNORDERED_MAP)
endif()
+if(0)
# ==============================================================================
# Check that submodule have been initialized and updated
# ==============================================================================
@@ -93,6 +95,7 @@ if (NOT EXISTS ${PROJECT_SOURCE_DIR}/dependencies/cereal/include)
"\n submodule(s) are missing, please update your repository:\n"
" > git submodule update -i\n")
endif()
+endif()
# ==============================================================================
# Additional cmake find modules
@@ -128,7 +131,6 @@ if (OpenMVG_USE_OPENMP)
find_package(OpenMP)
if (OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
- option(OpenMVG_USE_OPENMP "Use OpenMP for parallelization" ON)
register_definitions(-DOPENMVG_USE_OPENMP)
if (NOT MSVC)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
@@ -139,11 +141,6 @@ if (OpenMVG_USE_OPENMP)
endif()
endif (NOT MSVC)
endif (OPENMP_FOUND)
-else (OpenMVG_USE_OPENMP)
- option(OpenMVG_USE_OPENMP "Use OpenMP for parallelization" OFF)
- include(UpdateCacheVariable)
- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OPENMP OFF)
- remove_definitions(-DOPENMVG_USE_OPENMP)
endif (OpenMVG_USE_OPENMP)
# ==============================================================================
@@ -160,10 +157,10 @@ endif()
# ==============================================================================
# IMAGE IO detection
# ==============================================================================
-find_package(JPEG QUIET)
-find_package(PNG QUIET)
-find_package(TIFF QUIET)
-
+find_package(JPEG REQUIRED)
+find_package(PNG REQUIRED)
+find_package(TIFF REQUIRED)
+find_package(vlfeat REQUIRED)
# Folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@@ -182,6 +179,7 @@ if (OpenMVG_BUILD_OPENGL_EXAMPLES)
set_property(TARGET glfw PROPERTY FOLDER OpenMVG/3rdParty/glfw)
endif (OpenMVG_BUILD_OPENGL_EXAMPLES)
+if(0)
# Dependencies install rules
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/
@@ -189,7 +187,7 @@ install(
COMPONENT headers
FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h"
)
-
+endif()
# ==============================================================================
# --END-- SUBMODULE CONFIGURATION
# ==============================================================================
@@ -225,6 +223,7 @@ ENDMACRO(UNIT_TEST)
# - external by default
# - internal if cereal not found
# ==============================================================================
+if(0)
find_package(cereal QUIET CONFIG)
if (NOT TARGET cereal)
add_library(cereal INTERFACE)
@@ -237,6 +236,10 @@ if (NOT TARGET cereal)
set(OpenMVG_USE_INTERNAL_CEREAL ON)
endif()
+endif()
+
+find_package(cereal REQUIRED CONFIG)
+get_target_property(CEREAL_INCLUDE_DIRS cereal INTERFACE_INCLUDE_DIRECTORIES)
# ==============================================================================
# Eigen
@@ -245,6 +248,7 @@ endif()
# - external if EIGEN_INCLUDE_DIR_HINTS is defined
# - internal if Eigen not found
# ==============================================================================
+if(0)
find_package(Eigen3 QUIET)
if (NOT Eigen3_FOUND)
set(EIGEN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/eigen)
@@ -253,13 +257,17 @@ if (NOT Eigen3_FOUND)
else()
set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
endif()
+endif()
+find_package(Eigen3 REQUIRED)
+set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
# ==============================================================================
# Ceres
# ==============================================================================
# - external by default if CERES_DIR_HINTS or find_package found a valid Ceres
# - internal if ceres not found (ceres-solver+cxsparse+miniglog)
# ==============================================================================
+if(0)
find_package(Ceres QUIET HINTS ${CERES_DIR_HINTS})
if (NOT Ceres_FOUND)
set(OpenMVG_USE_INTERNAL_CERES ON)
@@ -271,13 +279,16 @@ if (NOT Ceres_FOUND)
STRING(REGEX REPLACE "version ([0-9.]+).*" "\\1" CERES_VERSION ${CERES_CONFIG})
set(CERES_LIBRARIES openMVG_ceres)
endif()
+endif()
+find_package(Ceres REQUIRED)
# ==============================================================================
# Flann
# ==============================================================================
# - internal by default (flann),
# - external if FLANN_INCLUDE_DIR_HINTS and a valid Flann setup is found
# ==============================================================================
+if(0)
if (NOT DEFINED FLANN_INCLUDE_DIR_HINTS)
set(FLANN_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp)
set(OpenMVG_USE_INTERNAL_FLANN ON)
@@ -286,13 +297,16 @@ find_package(Flann QUIET)
if (NOT FLANN_FOUND OR OpenMVG_USE_INTERNAL_FLANN)
set(FLANN_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/flann/src/cpp)
endif()
+endif()
+find_package(flann REQUIRED)
# ==============================================================================
# CoinUtils
# ==============================================================================
# - internal by default (CoinUtils),
# - external if COINUTILS_INCLUDE_DIR_HINTS and a valid CoinUtils setup is found
# ==============================================================================
+if(0)
if (NOT DEFINED COINUTILS_INCLUDE_DIR_HINTS)
set(COINUTILS_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/CoinUtils/src/)
set(OpenMVG_USE_INTERNAL_COINUTILS ON)
@@ -302,13 +316,16 @@ if (NOT DEFINED COINUTILS_INCLUDE_DIR_HINTS)
else()
find_package(CoinUtils QUIET)
endif()
+endif()
+find_package(CoinUtils REQUIRED)
## ==============================================================================
## Clp
## ==============================================================================
## - internal by default (Clp),
## - external if CLP_INCLUDE_DIR_HINTS and a valid Clp setup is found
## ==============================================================================
+if(0)
if (NOT DEFINED CLP_INCLUDE_DIR_HINTS)
set(CLP_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/Clp/src/)
set(OpenMVG_USE_INTERNAL_CLP ON)
@@ -320,6 +337,9 @@ if (NOT DEFINED CLP_INCLUDE_DIR_HINTS)
else()
find_package(Clp QUIET)
endif()
+endif()
+
+find_package(Clp REQUIRED)
# ==============================================================================
# Osi
@@ -327,6 +347,7 @@ endif()
# - internal by default (Osi),
# - external if OSI_INCLUDE_DIR_HINTS and a valid Osi setup is found
# ==============================================================================
+if(0)
if (NOT DEFINED OSI_INCLUDE_DIR_HINTS)
set(OSI_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/osi_clp/Osi/src/)
set(OpenMVG_USE_INTERNAL_OSI ON)
@@ -336,6 +357,9 @@ if (NOT DEFINED OSI_INCLUDE_DIR_HINTS)
else()
find_package(Osi QUIET)
endif()
+endif()
+
+find_package(Osi REQUIRED)
# ==============================================================================
# Internal CLP/OSI/COINUTILS libraries:
@@ -354,6 +378,7 @@ endif()
# - internal by default (Lemon),
# - external if LEMON_INCLUDE_DIR_HINTS and a valid Lemon setup is found
# ==============================================================================
+if(0)
if (NOT DEFINED LEMON_INCLUDE_DIR_HINTS)
set(LEMON_INCLUDE_DIR_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lemon)
set(OpenMVG_USE_INTERNAL_LEMON ON)
@@ -365,6 +390,9 @@ if (NOT LEMON_FOUND OR OpenMVG_USE_INTERNAL_LEMON)
${PROJECT_BINARY_DIR}/third_party/lemon)
set(LEMON_LIBRARY openMVG_lemon)
endif()
+endif()
+
+find_package(LEMON REQUIRED)
# ==============================================================================
# OpenCV
@@ -372,20 +400,13 @@ endif()
# - only external and enabled only if OpenMVG_USE_OPENCV is set to ON
# ==============================================================================
if (OpenMVG_USE_OPENCV)
- find_package( OpenCV QUIET )
- if (NOT OpenCV_FOUND OR OpenCV_VERSION VERSION_LESS "3.0.0")
- message(STATUS "OpenCV was not found (note that OpenCV version >= 3.0.0 is required). -> Disabling OpenCV support.")
- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OPENCV OFF)
- UPDATE_CACHE_VARIABLE(OpenMVG_USE_OCVSIFT OFF)
- endif()
+ find_package( OpenCV REQUIRED )
endif()
-
# ==============================================================================
# Third-party libraries:
# ==============================================================================
add_subdirectory(third_party)
-add_subdirectory(testing)
# ==============================================================================
# openMVG modules
@@ -472,67 +493,67 @@ message("** Use OpenCV SIFT features: " ${OpenMVG_USE_OCVSIFT})
message("\n")
-if (DEFINED OpenMVG_USE_INTERNAL_CEREAL)
+if (OpenMVG_USE_INTERNAL_CEREAL)
message(STATUS "CEREAL: (internal)")
else()
message(STATUS "CEREAL: (external)")
endif()
-if (DEFINED OpenMVG_USE_INTERNAL_EIGEN)
+if (OpenMVG_USE_INTERNAL_EIGEN)
message(STATUS "EIGEN: " ${EIGEN_VERSION} " (internal)")
else()
message(STATUS "EIGEN: " ${EIGEN_VERSION} " (external)")
endif()
-if (DEFINED OpenMVG_USE_INTERNAL_CERES)
+if (OpenMVG_USE_INTERNAL_CERES)
message(STATUS "CERES: " ${CERES_VERSION} " (internal)")
else()
message(STATUS "CERES: " ${CERES_VERSION} " (external)")
endif()
-if (DEFINED OpenMVG_USE_INTERNAL_FLANN)
+if (OpenMVG_USE_INTERNAL_FLANN)
message(STATUS "FLANN: " ${FLANN_VERSION} " (internal)")
else()
message(STATUS "FLANN: " ${FLANN_VERSION} " (external)")
endif()
-if (DEFINED OpenMVG_USE_INTERNAL_TIFF)
+if (OpenMVG_USE_INTERNAL_TIFF)
message(STATUS "LIBTIFF: " ${TIFF_VERSION_STRING} " (internal)")
else()
message(STATUS "LIBTIFF: " ${TIFF_VERSION_STRING} " (external)")
endif()
-if (DEFINED OpenMVG_USE_INTERNAL_PNG)
+if (OpenMVG_USE_INTERNAL_PNG)
message(STATUS "LIBPNG: " ${PNG_VERSION_STRING} " (internal)")
else()
message(STATUS "LIBPNG: " ${PNG_VERSION_STRING} " (external)")
endif()
-if (DEFINED OpenMVG_USE_INTERNAL_JPEG)
+if (OpenMVG_USE_INTERNAL_JPEG)
message(STATUS "LIBJPEG (internal)")
else()
message(STATUS "LIBJPEG (external)")
endif()
-if (DEFINED OpenMVG_USE_INTERNAL_CLP)
+if (OpenMVG_USE_INTERNAL_CLP)
message(STATUS "CLP: " ${CLP_VERSION} " (internal)")
else()
message(STATUS "CLP: " ${CLP_VERSION} " (external)")
endif()
-if (DEFINED OpenMVG_USE_INTERNAL_COINUTILS)
+if (OpenMVG_USE_INTERNAL_COINUTILS)
message(STATUS "COINUTILS: " ${COINUTILS_VERSION} " (internal)")
else()
message(STATUS "COINUTILS: " ${COINUTILS_VERSION} " (external)")
endif()
-if (DEFINED OpenMVG_USE_INTERNAL_OSI)
+if (OpenMVG_USE_INTERNAL_OSI)
message(STATUS "OSI: " ${OSI_VERSION} " (internal)")
else()
message(STATUS "OSI: " ${OSI_VERSION} " (external)")
endif()
-if (DEFINED OpenMVG_USE_INTERNAL_LEMON)
+if (OpenMVG_USE_INTERNAL_LEMON)
message(STATUS "LEMON: " ${LEMON_VERSION} " (internal)")
else()
message(STATUS "LEMON: " ${LEMON_VERSION} " (external)")
diff --git a/src/cmakeFindModules/FindClp.cmake b/src/cmakeFindModules/FindClp.cmake
index 8a69c23..6a81580 100644
--- a/src/cmakeFindModules/FindClp.cmake
+++ b/src/cmakeFindModules/FindClp.cmake
@@ -51,9 +51,8 @@ IF(EXISTS "${CLP_DIR}" AND NOT "${CLP_DIR}" STREQUAL "")
SET(CLP_INCLUDE_DIR ${CLP_DIR})
FIND_LIBRARY(CLP_LIBRARY NAMES Clp)
- FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver)
- FIND_LIBRARY(OSICLP_LIBRARY NAMES OsiClp)
-
+ FIND_LIBRARY(CLPSOLVER_LIBRARY NAMES ClpSolver Clp)
+ FIND_LIBRARY(OSICLP_LIBRARY NAMES OsiClp Clp)
# locate Clp libraries
IF(DEFINED CLP_LIBRARY AND DEFINED CLPSOLVER_LIBRARY AND DEFINED OSICLP_LIBRARY)
SET(CLP_LIBRARIES ${CLP_LIBRARY} ${CLPSOLVER_LIBRARY} ${OSICLP_LIBRARY})
diff --git a/src/cmakeFindModules/OpenMVGConfig.cmake.in b/src/cmakeFindModules/OpenMVGConfig.cmake.in
index e7dfbfd..c01910d 100644
--- a/src/cmakeFindModules/OpenMVGConfig.cmake.in
+++ b/src/cmakeFindModules/OpenMVGConfig.cmake.in
@@ -19,7 +19,7 @@
# OPENMVG_VERSION: Version of OpenMVG found.
#
-# Called if we failed to find OpenMVG or any of it's required dependencies,
+# Called if we failed to find OpenMVG or any of its required dependencies,
# unsets all public (designed to be used externally) variables and reports
# error message at priority depending upon [REQUIRED/QUIET/<NONE>] argument.
macro(OPENMVG_REPORT_NOT_FOUND REASON_MSG)
@@ -59,9 +59,19 @@ set(CALLERS_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
# script.
set(CMAKE_MODULE_PATH ${CURRENT_CONFIG_INSTALL_DIR})
+include(CMakeFindDependencyMacro)
+find_dependency(CoinUtils)
+find_dependency(Clp)
+find_dependency(Osi)
+find_dependency(flann)
+find_dependency(Threads)
+find_dependency(cereal)
+find_dependency(Ceres)
+find_dependency(vlfeat)
+
# Build the absolute root install directory as a relative path
get_filename_component(CURRENT_ROOT_INSTALL_DIR
- ${CMAKE_MODULE_PATH}/../../../ ABSOLUTE)
+ ${CMAKE_MODULE_PATH}/../../ ABSOLUTE)
if (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR})
OPENMVG_REPORT_NOT_FOUND(
"OpenMVG install root: ${CURRENT_ROOT_INSTALL_DIR}, "
diff --git a/src/nonFree/sift/CMakeLists.txt b/src/nonFree/sift/CMakeLists.txt
index 402a2d8..60ddc11 100644
--- a/src/nonFree/sift/CMakeLists.txt
+++ b/src/nonFree/sift/CMakeLists.txt
@@ -1,36 +1,36 @@
-# libs should be static
-set(BUILD_SHARED_LIBS OFF)
-
-# use PIC code for link into shared lib
-if(UNIX)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
-endif(UNIX)
-
-if(NOT USE_SSE2)
- add_definitions(-DVL_DISABLE_SSE2)
-endif()
-
-add_definitions(-DVL_DISABLE_THREADS)
-
-include_directories(./vl)
-set(FEATS
- vl/generic.c
- vl/imopv_sse2.c
- vl/sift.c
- vl/imopv.c
- vl/mathop_sse2.c
- vl/sift.c
- vl/host.c
- vl/mathop.c
- vl/random.c)
-set_source_files_properties(${FEATS} PROPERTIES LANGUAGE C)
-add_library(vlsift ${FEATS})
-install(TARGETS vlsift DESTINATION lib EXPORT openMVG-targets)
-set_property(TARGET vlsift PROPERTY FOLDER OpenMVG/nonFree)
+## libs should be static
+#set(BUILD_SHARED_LIBS OFF)
+#
+## use PIC code for link into shared lib
+#if(UNIX)
+# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+#endif(UNIX)
+#
+#if(NOT USE_SSE2)
+# add_definitions(-DVL_DISABLE_SSE2)
+#endif()
+#
+#add_definitions(-DVL_DISABLE_THREADS)
+#
+#include_directories(./vl)
+#set(FEATS
+# vl/generic.c
+# vl/imopv_sse2.c
+# vl/sift.c
+# vl/imopv.c
+# vl/mathop_sse2.c
+# vl/sift.c
+# vl/host.c
+# vl/mathop.c
+# vl/random.c)
+#set_source_files_properties(${FEATS} PROPERTIES LANGUAGE C)
+#add_library(vlsift ${FEATS})
+#install(TARGETS vlsift DESTINATION lib EXPORT openMVG-targets)
+#set_property(TARGET vlsift PROPERTY FOLDER OpenMVG/nonFree)
install(
DIRECTORY .
DESTINATION include/openMVG_dependencies/nonFree/sift
COMPONENT headers
- FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h"
+ FILES_MATCHING PATTERN "*.hpp"
)
diff --git a/src/nonFree/sift/SIFT_describer.hpp b/src/nonFree/sift/SIFT_describer.hpp
index cd800b0..20e9c8e 100644
--- a/src/nonFree/sift/SIFT_describer.hpp
+++ b/src/nonFree/sift/SIFT_describer.hpp
@@ -17,9 +17,7 @@
#include <iostream>
#include <numeric>
-extern "C" {
-#include "nonFree/sift/vl/sift.h"
-}
+#include <sift.h>
namespace openMVG {
namespace features {
@@ -174,7 +172,7 @@ public:
const int nkeys = vl_sift_get_nkeypoints(filt);
// Update gradient before launching parallel extraction
- vl_sift_update_gradient(filt);
+ update_gradient(filt);
#ifdef OPENMVG_USE_OPENMP
#pragma omp parallel for private(descr, descriptor)
diff --git a/src/openMVG/linearProgramming/CMakeLists.txt b/src/openMVG/linearProgramming/CMakeLists.txt
index cc5212f..acc57dd 100644
--- a/src/openMVG/linearProgramming/CMakeLists.txt
+++ b/src/openMVG/linearProgramming/CMakeLists.txt
@@ -15,16 +15,12 @@ target_link_libraries(openMVG_linearProgramming
PUBLIC
openMVG_numeric
PRIVATE
- ${CLP_LIBRARIES} # clp + solver wrapper
- ${COINUTILS_LIBRARY} # container tools
- ${OSI_LIBRARY} # generic LP
+ Coin::Clp # clp + solver wrapper
+ Coin::CoinUtils # container tools
+ Coin::Osi # generic LP
)
target_include_directories(openMVG_linearProgramming
- PRIVATE
- ${CLP_INCLUDE_DIRS}
- ${COINUTILS_INCLUDE_DIRS}
- ${OSI_INCLUDE_DIRS}
PUBLIC
$<INSTALL_INTERFACE:include>
)
diff --git a/src/openMVG/matching/CMakeLists.txt b/src/openMVG/matching/CMakeLists.txt
index 5fcd972..b21ea7b 100644
--- a/src/openMVG/matching/CMakeLists.txt
+++ b/src/openMVG/matching/CMakeLists.txt
@@ -18,6 +18,7 @@ list(REMOVE_ITEM matching_files_cpp ${REMOVEFILESUNITTEST})
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
+find_package(flann REQUIRED)
set_source_files_properties(${matching_files_cpp} PROPERTIES LANGUAGE CXX)
add_library(openMVG_matching
@@ -39,10 +40,10 @@ target_link_libraries(openMVG_matching
Threads::Threads
cereal
)
-if (NOT DEFINED OpenMVG_USE_INTERNAL_FLANN)
+if (NOT OpenMVG_USE_INTERNAL_FLANN)
target_link_libraries(openMVG_matching
PUBLIC
- ${FLANN_LIBRARIES}
+ flann::flann
)
endif()
set_target_properties(openMVG_matching PROPERTIES SOVERSION ${OPENMVG_VERSION_MAJOR} VERSION "${OPENMVG_VERSION_MAJOR}.${OPENMVG_VERSION_MINOR}")
diff --git a/src/openMVG/numeric/CMakeLists.txt b/src/openMVG/numeric/CMakeLists.txt
index 1f3fc30..4097320 100644
--- a/src/openMVG/numeric/CMakeLists.txt
+++ b/src/openMVG/numeric/CMakeLists.txt
@@ -26,7 +26,7 @@ target_include_directories(openMVG_numeric
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
-if (DEFINED OpenMVG_USE_INTERNAL_EIGEN)
+if (OpenMVG_USE_INTERNAL_EIGEN)
target_include_directories(openMVG_numeric PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/openMVG/third_party/eigen/>)
else()
diff --git a/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt b/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt
index 862ffc7..326fc9a 100644
--- a/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt
+++ b/src/openMVG_Samples/describe_and_match_GUI/CMakeLists.txt
@@ -18,7 +18,7 @@ if (OpenMVG_BUILD_GUI_SOFTWARES)
add_executable( openMVG_sample_describe_and_match_GUI WIN32 ${FEATURES_PAIR_DEMO_SRCS} ${FEATURES_PAIR_DEMO_HDRS} )
endif( APPLE )
- target_link_libraries( openMVG_sample_describe_and_match_GUI Qt5::Widgets openMVG_features openMVG_image openMVG_matching vlsift )
+ target_link_libraries( openMVG_sample_describe_and_match_GUI Qt5::Widgets openMVG_features openMVG_image openMVG_matching unofficial::vlfeat::vl )
set_target_properties( openMVG_sample_describe_and_match_GUI PROPERTIES CXX_STANDARD 11)
diff --git a/src/openMVG_Samples/features_image_matching/CMakeLists.txt b/src/openMVG_Samples/features_image_matching/CMakeLists.txt
index 18fb385..d44ffce 100644
--- a/src/openMVG_Samples/features_image_matching/CMakeLists.txt
+++ b/src/openMVG_Samples/features_image_matching/CMakeLists.txt
@@ -5,7 +5,7 @@ target_link_libraries(openMVG_sample_image_matching
openMVG_features
openMVG_matching
${STLPLUS_LIBRARY}
- vlsift)
+ unofficial::vlfeat::vl)
target_compile_definitions(openMVG_sample_image_matching
PRIVATE -DTHIS_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
diff --git a/src/openMVG_Samples/features_repeatability/CMakeLists.txt b/src/openMVG_Samples/features_repeatability/CMakeLists.txt
index fd2b7c6..91f2766 100644
--- a/src/openMVG_Samples/features_repeatability/CMakeLists.txt
+++ b/src/openMVG_Samples/features_repeatability/CMakeLists.txt
@@ -6,7 +6,7 @@ target_link_libraries(openMVG_sample_main_features_repeatability_dataset
openMVG_matching
openMVG_system
openMVG_multiview
- vlsift
+ unofficial::vlfeat::vl
${STLPLUS_LIBRARY})
set_property(TARGET openMVG_sample_main_features_repeatability_dataset PROPERTY FOLDER OpenMVG/Samples)
diff --git a/src/software/Localization/CMakeLists.txt b/src/software/Localization/CMakeLists.txt
index 2f60393..0d57d0a 100644
--- a/src/software/Localization/CMakeLists.txt
+++ b/src/software/Localization/CMakeLists.txt
@@ -11,7 +11,7 @@ target_link_libraries(openMVG_main_SfM_Localization
openMVG_sfm
openMVG_exif
${STLPLUS_LIBRARY}
- vlsift
+ unofficial::vlfeat::vl
)
# Installation rules
diff --git a/src/software/SfM/CMakeLists.txt b/src/software/SfM/CMakeLists.txt
index 013a6c8..f38daa9 100644
--- a/src/software/SfM/CMakeLists.txt
+++ b/src/software/SfM/CMakeLists.txt
@@ -44,7 +44,7 @@ target_link_libraries(openMVG_main_ComputeFeatures
openMVG_multiview
openMVG_sfm
${STLPLUS_LIBRARY}
- vlsift
+ unofficial::vlfeat::vl
)
if (MSVC)
set_target_properties(openMVG_main_ComputeFeatures PROPERTIES COMPILE_FLAGS "/bigobj")
@@ -235,7 +235,7 @@ if(OpenMVG_USE_OPENCV)
openMVG_multiview
openMVG_sfm
${STLPLUS_LIBRARY}
- vlsift
+ unofficial::vlfeat::vl
${OpenCV_LIBS})
target_include_directories(openMVG_main_ComputeFeatures_OpenCV PRIVATE ${OpenCV_INCLUDE_DIRS})
diff --git a/src/software/SfM/SfM_GlobalPipeline.py.in b/src/software/SfM/SfM_GlobalPipeline.py.in
index 42405a4..28b0246 100644
--- a/src/software/SfM/SfM_GlobalPipeline.py.in
+++ b/src/software/SfM/SfM_GlobalPipeline.py.in
@@ -21,7 +21,7 @@
OPENMVG_SFM_BIN = "@OPENMVG_SOFTWARE_SFM_BUILD_DIR@"
# Indicate the openMVG camera sensor width directory
-CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_SOFTWARE_SFM_SRC_DIR@" + "/../../openMVG/exif/sensor_width_database"
+CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_CAMERA_SENSOR_WIDTH_DIRECTORY@"
import os
import subprocess
@@ -77,5 +77,3 @@ pRecons.wait()
pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeSfM_DataColor"), "-i", reconstruction_dir+"/robust.bin", "-o", os.path.join(reconstruction_dir,"robust_colorized.ply")] )
pRecons.wait()
-
-
diff --git a/src/software/SfM/SfM_SequentialPipeline.py.in b/src/software/SfM/SfM_SequentialPipeline.py.in
index 9a5a482..e804a19 100644
--- a/src/software/SfM/SfM_SequentialPipeline.py.in
+++ b/src/software/SfM/SfM_SequentialPipeline.py.in
@@ -21,7 +21,7 @@
OPENMVG_SFM_BIN = "@OPENMVG_SOFTWARE_SFM_BUILD_DIR@"
# Indicate the openMVG camera sensor width directory
-CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_SOFTWARE_SFM_SRC_DIR@" + "/../../openMVG/exif/sensor_width_database"
+CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_CAMERA_SENSOR_WIDTH_DIRECTORY@"
import os
import subprocess
@@ -77,5 +77,3 @@ pRecons.wait()
pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeSfM_DataColor"), "-i", reconstruction_dir+"/robust.bin", "-o", os.path.join(reconstruction_dir,"robust_colorized.ply")] )
pRecons.wait()
-
-
diff --git a/src/software/SfM/main_ComputeFeatures_OpenCV.cpp b/src/software/SfM/main_ComputeFeatures_OpenCV.cpp
index 9cc46af..f8bd892 100644
--- a/src/software/SfM/main_ComputeFeatures_OpenCV.cpp
+++ b/src/software/SfM/main_ComputeFeatures_OpenCV.cpp
@@ -208,7 +208,7 @@ public:
// Create a SIFT detector
std::vector< cv::KeyPoint > v_keypoints;
cv::Mat m_desc;
- cv::Ptr<cv::Feature2D> siftdetector = cv::xfeatures2d::SIFT::create();
+ cv::Ptr<cv::Feature2D> siftdetector = cv::SIFT::create();
// Process SIFT computation
siftdetector->detectAndCompute(img, m_mask, v_keypoints, m_desc);
diff --git a/src/software/SfM/tutorial_demo.py.in b/src/software/SfM/tutorial_demo.py.in
index 259e24e..1097062 100644
--- a/src/software/SfM/tutorial_demo.py.in
+++ b/src/software/SfM/tutorial_demo.py.in
@@ -12,7 +12,7 @@
OPENMVG_SFM_BIN = "@OPENMVG_SOFTWARE_SFM_BUILD_DIR@"
# Indicate the openMVG camera sensor width directory
-CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_SOFTWARE_SFM_SRC_DIR@" + "/../../openMVG/exif/sensor_width_database"
+CAMERA_SENSOR_WIDTH_DIRECTORY = "@OPENMVG_CAMERA_SENSOR_WIDTH_DIRECTORY@"
import os
import subprocess
@@ -89,5 +89,3 @@ pRecons.wait()
print ("4. Structure from Known Poses (robust triangulation)")
pRecons = subprocess.Popen( [os.path.join(OPENMVG_SFM_BIN, "openMVG_main_ComputeStructureFromKnownPoses"), "-i", reconstruction_dir+"/sfm_data.bin", "-m", matches_dir, "-o", os.path.join(reconstruction_dir,"robust.ply")] )
pRecons.wait()
-
-
diff --git a/src/software/VO/Tracker_opencv_klt.hpp b/src/software/VO/Tracker_opencv_klt.hpp
index aa7dffe..2c4d237 100644
--- a/src/software/VO/Tracker_opencv_klt.hpp
+++ b/src/software/VO/Tracker_opencv_klt.hpp
@@ -80,7 +80,7 @@ struct Tracker_opencv_KLT : public Abstract_Tracker
std::vector<cv::KeyPoint> m_nextKeypoints;
cv::Ptr<cv::FeatureDetector> m_detector = cv::GFTTDetector::create(count);
- if (m_detector == NULL)
+ if (m_detector == nullptr)
return false;
m_detector->detect(current_img, m_nextKeypoints);
diff --git a/src/third_party/CMakeLists.txt b/src/third_party/CMakeLists.txt
index b71dfab..ad98e51 100644
--- a/src/third_party/CMakeLists.txt
+++ b/src/third_party/CMakeLists.txt
@@ -18,7 +18,7 @@ add_subdirectory(stlplus3)
set(STLPLUS_LIBRARY openMVG_stlplus PARENT_SCOPE)
# Add graph library
-if(DEFINED OpenMVG_USE_INTERNAL_LEMON)
+if(OpenMVG_USE_INTERNAL_LEMON)
add_subdirectory(lemon)
set_property(TARGET openMVG_lemon PROPERTY FOLDER OpenMVG/3rdParty/lemon)
set_property(TARGET check PROPERTY FOLDER OpenMVG/3rdParty/lemon)
@@ -68,7 +68,7 @@ endif (NOT TIFF_FOUND)
add_subdirectory(vectorGraphics)
# Add ceres-solver (A Nonlinear Least Squares Minimizer)
-if (DEFINED OpenMVG_USE_INTERNAL_CERES)
+if (OpenMVG_USE_INTERNAL_CERES)
add_subdirectory(cxsparse)
add_subdirectory(ceres-solver)
set_property(TARGET openMVG_cxsparse PROPERTY FOLDER OpenMVG/3rdParty/ceres)
@@ -76,7 +76,7 @@ if (DEFINED OpenMVG_USE_INTERNAL_CERES)
endif()
# Add an Approximate Nearest Neighbor library
-if (DEFINED OpenMVG_USE_INTERNAL_FLANN)
+if (OpenMVG_USE_INTERNAL_FLANN)
set(FLANN_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/openMVG/third_party/flann/src/cpp)
add_subdirectory(flann)
endif()
@@ -90,7 +90,7 @@ add_subdirectory(fast)
##
# Install Header only libraries if necessary
##
-if (DEFINED OpenMVG_USE_INTERNAL_EIGEN)
+if (OpenMVG_USE_INTERNAL_EIGEN)
#Configure Eigen install
set(EIGEN_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/openMVG/third_party/eigen)
add_subdirectory(eigen)