2021-01-22 12:25:40 -08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2022-04-14 23:20:44 +08:00
|
|
|
index 2d241fe..b79454d 100644
|
2021-01-22 12:25:40 -08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2022-04-14 23:20:44 +08:00
|
|
|
@@ -244,7 +244,7 @@ else (CUDA)
|
|
|
|
endif (CUDA)
|
2021-01-22 12:25:40 -08:00
|
|
|
|
|
|
|
if (LAPACK)
|
|
|
|
- find_package(LAPACK QUIET)
|
|
|
|
+ find_package(LAPACK REQUIRED)
|
|
|
|
if (LAPACK_FOUND)
|
|
|
|
message("-- Found LAPACK library: ${LAPACK_LIBRARIES}")
|
|
|
|
else (LAPACK_FOUND)
|
2022-04-14 23:20:44 +08:00
|
|
|
@@ -266,7 +266,8 @@ if (SUITESPARSE)
|
2021-01-22 12:25:40 -08:00
|
|
|
# built with SuiteSparse support.
|
|
|
|
|
|
|
|
# Check for SuiteSparse and dependencies.
|
2022-04-14 23:20:44 +08:00
|
|
|
- find_package(SuiteSparse 4.0 COMPONENTS CHOLMOD SPQR)
|
|
|
|
+ find_package(suitesparse CONFIG REQUIRED)
|
|
|
|
+ set(SuiteSparse_FOUND 1)
|
|
|
|
if (SuiteSparse_FOUND)
|
|
|
|
set(SuiteSparse_DEPENDENCY "find_dependency(SuiteSparse ${SuiteSparse_VERSION})")
|
|
|
|
# By default, if all of SuiteSparse's dependencies are found, Ceres is
|
|
|
|
@@ -274,11 +275,11 @@ if (SUITESPARSE)
|
|
|
|
message("-- Found SuiteSparse ${SuiteSparse_VERSION}, "
|
|
|
|
"building with SuiteSparse.")
|
|
|
|
|
|
|
|
- if (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR)
|
|
|
|
+ if (0)
|
|
|
|
install(FILES ${Ceres_SOURCE_DIR}/cmake/FindSuiteSparse.cmake
|
|
|
|
${Ceres_SOURCE_DIR}/cmake/FindMETIS.cmake
|
|
|
|
DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR})
|
|
|
|
- endif (SuiteSparse_NO_CMAKE OR NOT SuiteSparse_DIR)
|
|
|
|
+ endif ()
|
|
|
|
else (SuiteSparse_FOUND)
|
|
|
|
# Disable use of SuiteSparse if it cannot be found and continue.
|
|
|
|
message("-- Did not find all SuiteSparse dependencies, disabling "
|
|
|
|
@@ -294,7 +295,7 @@ endif (SUITESPARSE)
|
2021-01-22 12:25:40 -08:00
|
|
|
# CXSparse.
|
|
|
|
if (CXSPARSE)
|
|
|
|
# Don't search with REQUIRED as we can continue without CXSparse.
|
|
|
|
- find_package(CXSparse)
|
|
|
|
+ find_package(CXSparse REQUIRED)
|
2022-04-14 23:20:44 +08:00
|
|
|
if (CXSparse_FOUND)
|
|
|
|
set(CXSparse_DEPENDENCY "find_dependency(CXSparse ${CXSparse_VERSION})")
|
2021-01-22 12:25:40 -08:00
|
|
|
# By default, if CXSparse and all dependencies are found, Ceres is
|
2022-04-14 23:20:44 +08:00
|
|
|
@@ -302,10 +303,10 @@ if (CXSPARSE)
|
|
|
|
message("-- Found CXSparse version: ${CXSparse_VERSION}, "
|
|
|
|
"building with CXSparse.")
|
|
|
|
|
|
|
|
- if (CXSparse_NO_CMAKE OR NOT CXSparse_DIR)
|
|
|
|
+ if (0)
|
|
|
|
install(FILES ${Ceres_SOURCE_DIR}/cmake/FindCXSparse.cmake
|
|
|
|
DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR})
|
|
|
|
- endif (CXSparse_NO_CMAKE OR NOT CXSparse_DIR)
|
|
|
|
+ endif ()
|
|
|
|
else (CXSparse_FOUND)
|
|
|
|
# Disable use of CXSparse if it cannot be found and continue.
|
|
|
|
message("-- Did not find CXSparse, Building without CXSparse.")
|
|
|
|
@@ -367,9 +368,10 @@ endif()
|
2021-01-22 12:25:40 -08:00
|
|
|
# GFlags.
|
|
|
|
if (GFLAGS)
|
|
|
|
# Don't search with REQUIRED as we can continue without gflags.
|
|
|
|
- find_package(gflags 2.2.0)
|
2022-04-14 23:20:44 +08:00
|
|
|
+ find_package(gflags CONFIG REQUIRED)
|
2021-01-22 12:25:40 -08:00
|
|
|
if (gflags_FOUND)
|
2022-04-14 23:20:44 +08:00
|
|
|
- if (TARGET gflags)
|
|
|
|
+ if (TARGET gflags::gflags)
|
|
|
|
+ add_library(gflags ALIAS gflags::gflags)
|
2021-01-22 12:25:40 -08:00
|
|
|
message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}")
|
2022-04-14 23:20:44 +08:00
|
|
|
else()
|
|
|
|
message("-- Detected version of gflags: ${gflags_VERSION} does not define "
|
|
|
|
@@ -420,7 +422,7 @@ set_ceres_threading_model("${CERES_THREADING_MODEL}")
|
2021-01-22 12:25:40 -08:00
|
|
|
|
|
|
|
if (BUILD_BENCHMARKS)
|
2022-04-14 23:20:44 +08:00
|
|
|
# Version 1.3 was first to provide import targets
|
|
|
|
- find_package(benchmark 1.3 QUIET)
|
|
|
|
+ find_package(benchmark CONFIG REQUIRED)
|
2021-01-22 12:25:40 -08:00
|
|
|
if (benchmark_FOUND)
|
|
|
|
message("-- Found Google benchmark library. Building Ceres benchmarks.")
|
|
|
|
else()
|
2022-04-14 23:20:44 +08:00
|
|
|
@@ -611,7 +613,7 @@ create_ceres_config("${CERES_COMPILE_OPTIONS}"
|
|
|
|
add_subdirectory(internal/ceres)
|
2021-01-22 12:25:40 -08:00
|
|
|
|
2022-04-14 23:20:44 +08:00
|
|
|
if (BUILD_DOCUMENTATION)
|
|
|
|
- find_package(Sphinx)
|
2021-01-22 12:25:40 -08:00
|
|
|
+ find_package(Sphinx REQUIRED)
|
|
|
|
if (NOT SPHINX_FOUND)
|
2022-04-14 23:20:44 +08:00
|
|
|
message("-- Failed to find Sphinx and/or its dependencies, disabling build of documentation.")
|
2021-01-22 12:25:40 -08:00
|
|
|
update_cache_variable(BUILD_DOCUMENTATION OFF)
|
2022-04-14 23:20:44 +08:00
|
|
|
diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt
|
|
|
|
index 299b373..33d41d8 100644
|
|
|
|
--- a/internal/ceres/CMakeLists.txt
|
|
|
|
+++ b/internal/ceres/CMakeLists.txt
|
|
|
|
@@ -108,14 +108,14 @@ endif (NOT MINIGLOG)
|
|
|
|
if (SUITESPARSE AND SuiteSparse_FOUND)
|
|
|
|
# Define version information for use in Solver::FullReport.
|
|
|
|
add_definitions(-DCERES_SUITESPARSE_VERSION="${SuiteSparse_VERSION}")
|
|
|
|
- list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES SuiteSparse::CHOLMOD
|
|
|
|
- SuiteSparse::SPQR)
|
|
|
|
+ list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES SuiteSparse::cholmod
|
|
|
|
+ SuiteSparse::spqr)
|
|
|
|
endif (SUITESPARSE AND SuiteSparse_FOUND)
|
|
|
|
|
|
|
|
if (CXSPARSE AND CXSparse_FOUND)
|
|
|
|
# Define version information for use in Solver::FullReport.
|
|
|
|
add_definitions(-DCERES_CXSPARSE_VERSION="${CXSparse_VERSION}")
|
|
|
|
- list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES CXSparse::CXSparse)
|
|
|
|
+ list(APPEND CERES_LIBRARY_PRIVATE_DEPENDENCIES ${CXSparse_LIBRARIES})
|
|
|
|
endif (CXSPARSE AND CXSparse_FOUND)
|
|
|
|
|
|
|
|
if (ACCELERATESPARSE AND AccelerateSparse_FOUND)
|