2019-04-30 16:54:33 -07:00
|
|
|
diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in
|
2022-04-14 23:20:44 +08:00
|
|
|
index 4745483..b55462d 100644
|
2019-04-30 16:54:33 -07:00
|
|
|
--- a/cmake/CeresConfig.cmake.in
|
|
|
|
+++ b/cmake/CeresConfig.cmake.in
|
2022-04-14 23:20:44 +08:00
|
|
|
@@ -217,55 +217,14 @@ else (Eigen3_FOUND)
|
|
|
|
endif (Eigen3_FOUND)
|
2019-04-30 16:54:33 -07:00
|
|
|
|
2020-12-01 23:13:35 +01:00
|
|
|
# glog (and maybe gflags).
|
|
|
|
-#
|
|
|
|
-# Flags set during configuration and build of Ceres.
|
2019-04-30 16:54:33 -07:00
|
|
|
-set(CERES_USES_MINIGLOG @MINIGLOG@)
|
2020-12-01 23:13:35 +01:00
|
|
|
-set(CERES_GLOG_VERSION @glog_VERSION@)
|
|
|
|
-set(CERES_GLOG_WAS_BUILT_WITH_CMAKE @FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION@)
|
|
|
|
-
|
2019-04-30 16:54:33 -07:00
|
|
|
-set(CERES_USES_GFLAGS @GFLAGS@)
|
2020-12-01 23:13:35 +01:00
|
|
|
-set(CERES_GFLAGS_VERSION @gflags_VERSION@)
|
|
|
|
-
|
2019-04-30 16:54:33 -07:00
|
|
|
-if (CERES_USES_MINIGLOG)
|
|
|
|
- # Output message at standard log level (not the lower STATUS) so that
|
|
|
|
- # the message is output in GUI during configuration to warn user.
|
2020-12-01 23:13:35 +01:00
|
|
|
- ceres_message("-- Found Ceres compiled with miniglog substitute "
|
2019-04-30 16:54:33 -07:00
|
|
|
- "for glog, beware this will likely cause problems if glog is later linked.")
|
2020-12-01 23:13:35 +01:00
|
|
|
-else(CERES_USES_MINIGLOG)
|
|
|
|
- if (CERES_GLOG_WAS_BUILT_WITH_CMAKE)
|
|
|
|
- find_package(glog ${CERES_GLOG_VERSION} CONFIG QUIET)
|
|
|
|
- set(GLOG_FOUND ${glog_FOUND})
|
2019-04-30 16:54:33 -07:00
|
|
|
- else()
|
2020-12-01 23:13:35 +01:00
|
|
|
- # Version of glog against which Ceres was built was not built with CMake,
|
|
|
|
- # use the exported glog find_package() module from Ceres to find it again.
|
|
|
|
- # Append the locations of glog when Ceres was built to the search path hints.
|
|
|
|
- list(APPEND GLOG_INCLUDE_DIR_HINTS "@GLOG_INCLUDE_DIR@")
|
|
|
|
- get_filename_component(CERES_BUILD_GLOG_LIBRARY_DIR "@GLOG_LIBRARY@" PATH)
|
2019-04-30 16:54:33 -07:00
|
|
|
- list(APPEND GLOG_LIBRARY_DIR_HINTS ${CERES_BUILD_GLOG_LIBRARY_DIR})
|
2020-12-01 23:13:35 +01:00
|
|
|
-
|
|
|
|
- # Search quietly s/t we control the timing of the error message if not found.
|
|
|
|
- find_package(Glog QUIET)
|
2019-04-30 16:54:33 -07:00
|
|
|
- endif()
|
2020-05-11 18:45:42 -04:00
|
|
|
|
2019-04-30 16:54:33 -07:00
|
|
|
- if (GLOG_FOUND)
|
2020-12-01 23:13:35 +01:00
|
|
|
- ceres_message(STATUS "Found required Ceres dependency: glog")
|
|
|
|
- else()
|
|
|
|
- ceres_report_not_found("Missing required Ceres dependency: glog.")
|
|
|
|
- endif()
|
2022-04-14 23:20:44 +08:00
|
|
|
+include (CMakeFindDependencyMacro)
|
|
|
|
+find_dependency (glog NO_MODULE)
|
|
|
|
|
2019-04-30 16:54:33 -07:00
|
|
|
- # gflags is only a public dependency of Ceres via glog, thus is not required
|
|
|
|
- # if Ceres was built with MINIGLOG.
|
|
|
|
- if (CERES_USES_GFLAGS)
|
|
|
|
- # Search quietly s/t we control the timing of the error message if not found.
|
2020-12-01 23:13:35 +01:00
|
|
|
- find_package(gflags ${CERES_GFLAGS_VERSION} QUIET)
|
|
|
|
- if (gflags_FOUND AND TARGET gflags)
|
|
|
|
- ceres_message(STATUS "Found required Ceres dependency: gflags")
|
2019-04-30 16:54:33 -07:00
|
|
|
- else()
|
|
|
|
- ceres_report_not_found("Missing required Ceres "
|
2020-12-01 23:13:35 +01:00
|
|
|
- "dependency: gflags (not found, or not found as exported CMake target).")
|
2019-04-30 16:54:33 -07:00
|
|
|
- endif()
|
|
|
|
- endif()
|
2020-12-01 23:13:35 +01:00
|
|
|
-endif(CERES_USES_MINIGLOG)
|
|
|
|
+# SuiteSparse
|
2020-05-11 18:45:42 -04:00
|
|
|
+if (@SUITESPARSE@)
|
2022-04-14 23:20:44 +08:00
|
|
|
+ find_dependency(SuiteSparse CONFIG)
|
2020-05-11 18:45:42 -04:00
|
|
|
+endif()
|
2019-04-30 16:54:33 -07:00
|
|
|
|
|
|
|
# Import exported Ceres targets, if they have not already been imported.
|
|
|
|
if (NOT TARGET ceres AND NOT Ceres_BINARY_DIR)
|