early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,46 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 33e98b1..f275d68 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -426,27 +426,7 @@ if (MINIGLOG)
GLOG_LIBRARY)
else (MINIGLOG)
unset(MINIGLOG_MAX_LOG_LEVEL CACHE)
- # Don't search with REQUIRED so that configuration continues if not found and
- # we can output an error messages explaining MINIGLOG option.
- find_package(Glog)
- if (NOT GLOG_FOUND)
- message(FATAL_ERROR "Can't find Google Log (glog). Please set either: "
- "glog_DIR (newer CMake built versions of glog) or GLOG_INCLUDE_DIR & "
- "GLOG_LIBRARY or enable MINIGLOG option to use minimal glog "
- "implementation.")
- endif(NOT GLOG_FOUND)
- # By default, assume gflags was found, updating the message if it was not.
- set(GLOG_GFLAGS_DEPENDENCY_MESSAGE
- " Assuming glog was built with gflags support as gflags was found. "
- "This will make gflags a public dependency of Ceres.")
- if (NOT gflags_FOUND)
- set(GLOG_GFLAGS_DEPENDENCY_MESSAGE
- " Assuming glog was NOT built with gflags support as gflags was "
- "not found. If glog was built with gflags, please set the "
- "gflags search locations such that it can be found by Ceres. "
- "Otherwise, Ceres may fail to link due to missing gflags symbols.")
- endif(NOT gflags_FOUND)
- message("-- Found Google Log (glog)." ${GLOG_GFLAGS_DEPENDENCY_MESSAGE})
+ find_package(Glog REQUIRED)
endif (MINIGLOG)
if (NOT SCHUR_SPECIALIZATIONS)
@@ -760,12 +740,6 @@ install(FILES "${Ceres_BINARY_DIR}/CeresConfig-install.cmake"
DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR})
install(FILES "${Ceres_BINARY_DIR}/CeresConfigVersion.cmake"
DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR})
-if (GLOG_FOUND AND NOT FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION)
- # Version of glog detected was not built with CMake, install our glog module
- # file to enable detection in CeresConfig.
- install(FILES "${Ceres_SOURCE_DIR}/cmake/FindGlog.cmake"
- DESTINATION ${RELATIVE_CMAKECONFIG_INSTALL_DIR})
-endif()
if (PROVIDE_UNINSTALL_TARGET)
# Create an uninstall target to remove all installed files.

View File

@@ -0,0 +1,25 @@
diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt
index 0e33263..299b373 100644
--- a/internal/ceres/CMakeLists.txt
+++ b/internal/ceres/CMakeLists.txt
@@ -101,17 +101,9 @@ endif()
find_package(Threads QUIET)
list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES Threads::Threads)
-if (NOT MINIGLOG AND GLOG_FOUND)
- list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES ${GLOG_LIBRARIES})
- if (gflags_FOUND)
- # If glog & gflags are both found, we assume that glog was built with
- # gflags, as it is awkward to perform a try_compile() to verify this
- # when gflags is an imported target (as it is in newer versions).
- # As glog #includes gflags/gflags.h in glog/logging.h if compiled with
- # gflags, it is thus a public dependency for Ceres in this case.
- list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES gflags)
- endif()
-endif (NOT MINIGLOG AND GLOG_FOUND)
+if (NOT MINIGLOG)
+ list(APPEND CERES_LIBRARY_PUBLIC_DEPENDENCIES glog::glog)
+endif (NOT MINIGLOG)
if (SUITESPARSE AND SuiteSparse_FOUND)
# Define version information for use in Solver::FullReport.

View File

@@ -0,0 +1,66 @@
diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in
index 4745483..b55462d 100644
--- a/cmake/CeresConfig.cmake.in
+++ b/cmake/CeresConfig.cmake.in
@@ -217,55 +217,14 @@ else (Eigen3_FOUND)
endif (Eigen3_FOUND)
# glog (and maybe gflags).
-#
-# Flags set during configuration and build of Ceres.
-set(CERES_USES_MINIGLOG @MINIGLOG@)
-set(CERES_GLOG_VERSION @glog_VERSION@)
-set(CERES_GLOG_WAS_BUILT_WITH_CMAKE @FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION@)
-
-set(CERES_USES_GFLAGS @GFLAGS@)
-set(CERES_GFLAGS_VERSION @gflags_VERSION@)
-
-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.
- ceres_message("-- Found Ceres compiled with miniglog substitute "
- "for glog, beware this will likely cause problems if glog is later linked.")
-else(CERES_USES_MINIGLOG)
- if (CERES_GLOG_WAS_BUILT_WITH_CMAKE)
- find_package(glog ${CERES_GLOG_VERSION} CONFIG QUIET)
- set(GLOG_FOUND ${glog_FOUND})
- else()
- # 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)
- list(APPEND GLOG_LIBRARY_DIR_HINTS ${CERES_BUILD_GLOG_LIBRARY_DIR})
-
- # Search quietly s/t we control the timing of the error message if not found.
- find_package(Glog QUIET)
- endif()
- if (GLOG_FOUND)
- ceres_message(STATUS "Found required Ceres dependency: glog")
- else()
- ceres_report_not_found("Missing required Ceres dependency: glog.")
- endif()
+include (CMakeFindDependencyMacro)
+find_dependency (glog NO_MODULE)
- # 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.
- find_package(gflags ${CERES_GFLAGS_VERSION} QUIET)
- if (gflags_FOUND AND TARGET gflags)
- ceres_message(STATUS "Found required Ceres dependency: gflags")
- else()
- ceres_report_not_found("Missing required Ceres "
- "dependency: gflags (not found, or not found as exported CMake target).")
- endif()
- endif()
-endif(CERES_USES_MINIGLOG)
+# SuiteSparse
+if (@SUITESPARSE@)
+ find_dependency(SuiteSparse CONFIG)
+endif()
# Import exported Ceres targets, if they have not already been imported.
if (NOT TARGET ceres AND NOT Ceres_BINARY_DIR)

View File

@@ -0,0 +1,112 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2d241fe..b79454d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -244,7 +244,7 @@ else (CUDA)
endif (CUDA)
if (LAPACK)
- find_package(LAPACK QUIET)
+ find_package(LAPACK REQUIRED)
if (LAPACK_FOUND)
message("-- Found LAPACK library: ${LAPACK_LIBRARIES}")
else (LAPACK_FOUND)
@@ -266,7 +266,8 @@ if (SUITESPARSE)
# built with SuiteSparse support.
# Check for SuiteSparse and dependencies.
- 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)
# CXSparse.
if (CXSPARSE)
# Don't search with REQUIRED as we can continue without CXSparse.
- find_package(CXSparse)
+ find_package(CXSparse REQUIRED)
if (CXSparse_FOUND)
set(CXSparse_DEPENDENCY "find_dependency(CXSparse ${CXSparse_VERSION})")
# By default, if CXSparse and all dependencies are found, Ceres is
@@ -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()
# GFlags.
if (GFLAGS)
# Don't search with REQUIRED as we can continue without gflags.
- find_package(gflags 2.2.0)
+ find_package(gflags CONFIG REQUIRED)
if (gflags_FOUND)
- if (TARGET gflags)
+ if (TARGET gflags::gflags)
+ add_library(gflags ALIAS gflags::gflags)
message("-- Found Google Flags (gflags) version ${gflags_VERSION}: ${gflags_DIR}")
else()
message("-- Detected version of gflags: ${gflags_VERSION} does not define "
@@ -420,7 +422,7 @@ set_ceres_threading_model("${CERES_THREADING_MODEL}")
if (BUILD_BENCHMARKS)
# Version 1.3 was first to provide import targets
- find_package(benchmark 1.3 QUIET)
+ find_package(benchmark CONFIG REQUIRED)
if (benchmark_FOUND)
message("-- Found Google benchmark library. Building Ceres benchmarks.")
else()
@@ -611,7 +613,7 @@ create_ceres_config("${CERES_COMPILE_OPTIONS}"
add_subdirectory(internal/ceres)
if (BUILD_DOCUMENTATION)
- find_package(Sphinx)
+ find_package(Sphinx REQUIRED)
if (NOT SPHINX_FOUND)
message("-- Failed to find Sphinx and/or its dependencies, disabling build of documentation.")
update_cache_variable(BUILD_DOCUMENTATION OFF)
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)

62
externals/vcpkg/ports/ceres/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,62 @@
set(MSVC_USE_STATIC_CRT_VALUE OFF)
if(VCPKG_CRT_LINKAGE STREQUAL "static")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
message(FATAL_ERROR "Ceres does not support mixing static CRT and dynamic library linkage")
endif()
set(MSVC_USE_STATIC_CRT_VALUE ON)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ceres-solver/ceres-solver
REF f68321e7de8929fbcdb95dd42877531e64f72f66 #2.1.0
SHA512 67bbd8a9385a40fe69d118fbc84da0fcc9aa1fbe14dd52f5403ed09686504213a1d931e95a1a0148d293b27ab5ce7c1d618fbf2e8fed95f2bbafab851a1ef449
HEAD_REF master
PATCHES
0001_cmakelists_fixes.patch
0002_use_glog_target.patch
0003_fix_exported_ceres_config.patch
find-package-required.patch
)
file(REMOVE "${SOURCE_PATH}/cmake/FindCXSparse.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/FindGflags.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/FindGlog.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/FindEigen.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/FindSuiteSparse.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/FindMETIS.cmake")
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"suitesparse" SUITESPARSE
"cxsparse" CXSPARSE
"lapack" LAPACK
"eigensparse" EIGENSPARSE
"tools" GFLAGS
"cuda" CUDA
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DEXPORT_BUILD_DIR=ON
-DBUILD_BENCHMARKS=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTING=OFF
-DBUILD_BENCHMARKS=OFF
-DPROVIDE_UNINSTALL_TARGET=OFF
-DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT_VALUE}
-DLIB_SUFFIX=${LIB_SUFFIX}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib${LIB_SUFFIX}/cmake/Ceres")
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

68
externals/vcpkg/ports/ceres/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,68 @@
{
"name": "ceres",
"version": "2.1.0",
"port-version": 1,
"description": "non-linear optimization package",
"homepage": "https://github.com/ceres-solver/ceres-solver",
"license": "Apache-2.0",
"dependencies": [
"eigen3",
"glog",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"cuda": {
"description": "Support for CUDA based dense solvers",
"supports": "linux | (!osx & !uwp & !(arm64 & windows))",
"dependencies": [
"cuda"
]
},
"cxsparse": {
"description": "CXSparse support for Ceres",
"dependencies": [
{
"name": "suitesparse",
"default-features": false
}
]
},
"eigensparse": {
"description": "Use of Eigen as a sparse linear algebra library in Ceres"
},
"lapack": {
"description": "Use Lapack in Ceres",
"dependencies": [
"lapack"
]
},
"suitesparse": {
"description": "SuiteSparse support for Ceres",
"dependencies": [
{
"name": "ceres",
"features": [
"lapack"
]
},
{
"name": "suitesparse",
"default-features": false
}
]
},
"tools": {
"description": "Ceres tools",
"dependencies": [
"gflags"
]
}
}
}