[Theia] Fix bugs in TheiaConfig.cmake (#21548)

* Fix CMake configuration for 3rd party libraries

Fix CMake configuration for Eigen3 and glog in TheiaConfig.cmake. Use OpenImageIO::OpenImageIO instead of ${OPENIMAGEIO_LIBRARIES} in CMakeLists.txt.

* Create new port version pointing to latest port commit.

* Revert "Create new port version pointing to latest port commit."

This reverts commit d4d4bd7cc3.

* advance port version

* create new version and update baseline

* replace deprecated vcpkg functions

* create new port version

* Back out multiple update of port-version of theia.

* Update version database.

Co-authored-by: Daniel Buhrig <daniel.buhrig@ottobock.de>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
danielbuhrig 2021-11-23 05:39:54 +01:00 committed by GitHub
parent 713261eec4
commit 75116b9cab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 96 additions and 7 deletions

View File

@ -0,0 +1,76 @@
diff --git a/cmake/TheiaConfig.cmake.in b/cmake/TheiaConfig.cmake.in
index 7e9d912..2a98124 100644
--- a/cmake/TheiaConfig.cmake.in
+++ b/cmake/TheiaConfig.cmake.in
@@ -43,7 +43,7 @@ macro(THEIA_REPORT_NOT_FOUND REASON_MSG)
# use the camelcase library name, not uppercase.
if (Theia_FIND_QUIETLY)
message(STATUS "Failed to find Theia - " ${REASON_MSG} ${ARGN})
- else (Theia_FIND_REQUIRED)
+ elseif (Theia_FIND_REQUIRED)
message(FATAL_ERROR "Failed to find Theia - " ${REASON_MSG} ${ARGN})
else()
# Neither QUIETLY nor REQUIRED, use SEND_ERROR which emits an error
@@ -103,35 +103,35 @@ set(THEIA_INCLUDE_DIRS ${THEIA_INCLUDE_DIR})
# Eigen.
# Flag set during configuration and build of Theia.
-set(THEIA_EIGEN_VERSION @EIGEN_VERSION@)
+set(THEIA_EIGEN_VERSION @EIGEN3_VERSION@)
# Append the locations of Eigen when Theia was built to the search path hints.
-list(APPEND EIGEN_INCLUDE_DIR_HINTS @EIGEN_INCLUDE_DIR@)
+list(APPEND EIGEN_INCLUDE_DIR_HINTS @EIGEN3_INCLUDE_DIR@)
# Search quietly s/t we control the timing of the error message if not found.
-find_package(Eigen ${THEIA_EIGEN_VERSION} EXACT QUIET)
-if (EIGEN_FOUND)
+find_package(Eigen3 ${THEIA_EIGEN_VERSION} REQUIRED)
+if (EIGEN3_FOUND)
message(STATUS "Found required Theia dependency: "
- "Eigen version ${THEIA_EIGEN_VERSION} in ${EIGEN_INCLUDE_DIRS}")
-else (EIGEN_FOUND)
+ "Eigen version ${THEIA_EIGEN_VERSION} in ${EIGEN3_INCLUDE_DIRS}")
+else (EIGEN3_FOUND)
theia_report_not_found("Missing required Theia "
"dependency: Eigen version ${THEIA_EIGEN_VERSION}, please set "
"EIGEN_INCLUDE_DIR.")
-endif (EIGEN_FOUND)
-list(APPEND THEIA_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})
+endif (EIGEN3_FOUND)
+list(APPEND THEIA_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
# Ceres.
# Append the locations of ceres when Theia was built to the search path hints.
-list(APPEND CERES_INCLUDE_DIR_HINTS @CERES_INCLUDE_DIR@)
-get_filename_component(THEIA_BUILD_CERES_LIBRARY_DIR @CERES_LIBRARIES@ PATH)
-list(APPEND CERES_LIBRARY_DIR_HINTS ${THEIA_BUILD_CERES_LIBRARY_DIR})
+#list(APPEND CERES_INCLUDE_DIR_HINTS @CERES_INCLUDE_DIR@)
+#get_filename_component(THEIA_BUILD_CERES_LIBRARY_DIR @CERES_LIBRARIES@ PATH)
+#list(APPEND CERES_LIBRARY_DIR_HINTS ${THEIA_BUILD_CERES_LIBRARY_DIR})
# Search quietly s/t we control the timing of the error message if not found.
find_package(Ceres REQUIRED)
list(APPEND THEIA_INCLUDE_DIRS ${CERES_INCLUDE_DIRS})
# Glog.
# Append the locations of glog when Theia was built to the search path hints.
-list(APPEND GLOG_INCLUDE_DIR_HINTS @GLOG_INCLUDE_DIR@)
-get_filename_component(THEIA_BUILD_GLOG_LIBRARY_DIR @GLOG_LIBRARY@ PATH)
-list(APPEND GLOG_LIBRARY_DIR_HINTS ${THEIA_BUILD_GLOG_LIBRARY_DIR})
+#list(APPEND GLOG_INCLUDE_DIR_HINTS @GLOG_INCLUDE_DIR@)
+#get_filename_component(THEIA_BUILD_GLOG_LIBRARY_DIR @GLOG_LIBRARY@ PATH)
+#list(APPEND GLOG_LIBRARY_DIR_HINTS ${THEIA_BUILD_GLOG_LIBRARY_DIR})
# Search quietly s/t we control the timing of the error message if not found.
find_package(Glog REQUIRED)
list(APPEND THEIA_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS})
diff --git a/src/theia/CMakeLists.txt b/src/theia/CMakeLists.txt
index 768586d..c1f6593 100644
--- a/src/theia/CMakeLists.txt
+++ b/src/theia/CMakeLists.txt
@@ -207,7 +207,7 @@ set(THEIA_LIBRARY_DEPENDENCIES
${GFLAGS_LIBRARIES}
${GLOG_LIBRARIES}
${SUITESPARSE_LIBRARIES}
- ${OPENIMAGEIO_LIBRARIES}
+ OpenImageIO::OpenImageIO
akaze
statx
stlplus3

View File

@ -8,6 +8,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
fix-external-dependencies.patch
fix-external-dependencies2.patch
)
file(REMOVE ${SOURCE_PATH}/cmake/FindSuiteSparse.cmake)
@ -15,9 +16,8 @@ file(REMOVE ${SOURCE_PATH}/cmake/FindGflags.cmake)
file(REMOVE ${SOURCE_PATH}/cmake/FindGlog.cmake)
file(REMOVE ${SOURCE_PATH}/cmake/FindEigen.cmake)
vcpkg_configure_cmake(
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DCMAKE_CXX_STANDARD=14
-DCMAKE_CXX_EXTENSIONS=OFF
@ -27,8 +27,8 @@ vcpkg_configure_cmake(
-DTHEIA_USE_EXTERNAL_FLANN=ON
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
vcpkg_copy_pdbs()
# Clean

View File

@ -1,7 +1,7 @@
{
"name": "theia",
"version-string": "0.8",
"port-version": 4,
"port-version": 5,
"description": "An open source library for multiview geometry and structure from motion",
"homepage": "https://github.com/sweeneychris/TheiaSfM",
"dependencies": [
@ -18,6 +18,14 @@
"platform": "!osx"
},
"glew",
"openimageio"
"openimageio",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -6678,7 +6678,7 @@
},
"theia": {
"baseline": "0.8",
"port-version": 4
"port-version": 5
},
"think-cell-range": {
"baseline": "498839d",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "eff19230130911fb05e12a22ba59fc35f0d4b341",
"version-string": "0.8",
"port-version": 5
},
{
"git-tree": "9e4f395b731d46fde09836e4ff9a23ace6c74a6a",
"version-string": "0.8",