Improve CMake scoping, CUDA defaults, and examples

Avoid leaking top-level build settings when Ceres is embedded via
FetchContent or add_subdirectory. Output directories, debug
postfixes, PIC, and the default CMAKE_BUILD_TYPE now apply only when
Ceres is the top-level project (and CMAKE_BUILD_TYPE is only defaulted
for single-config generators). export(PACKAGE) now uses PROJECT_NAME
instead of CMAKE_PROJECT_NAME.

Respect user-supplied CMAKE_CUDA_ARCHITECTURES instead of clearing it
unconditionally, declare WITH_EIGENSPARSE before WITH_EIGENMETIS,
move EIGEN_MPL2_ONLY and SuiteSparse/METIS version defines onto the
ceres target, and make CERES_TEST and add_dependencies_to_benchmark
functions instead of macros.

In examples, move absl::time from simple_bundle_adjuster to
bundle_adjuster, drop unused absl::log_initialize from
curve_fitting_c, and replace directory-wide include_directories in
examples/slam with per-target include directories.

In docs/source/CMakeLists.txt, drop -a from the Sphinx build so
incremental rebuilds work and remove the no-op PATTERN clause from
install(DIRECTORY).

Change-Id: Ifd65b419313b1b34e1415f143676739706277b97
7 files changed
tree: cd0b5d1fb93479749626fde758f5689d4ca5dc1a
  1. .github/
  2. bazel/
  3. cmake/
  4. config/
  5. data/
  6. docs/
  7. examples/
  8. include/
  9. internal/
  10. LICENSES/
  11. scripts/
  12. third_party/
  13. .bazelignore
  14. .clang-format
  15. .gitignore
  16. .gitmodules
  17. .readthedocs.yaml
  18. BUILD
  19. CITATION.cff
  20. CMakeLists.txt
  21. CONTRIBUTING.md
  22. LICENSE
  23. MODULE.bazel
  24. package.xml
  25. README.md
  26. REUSE.toml
  27. WORKSPACE
README.md

Android Linux macOS Windows

Ceres Solver

Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.

  1. Non-linear Least Squares problems with bounds constraints.
  2. General unconstrained optimization problems.

Please see the Ceres Solver website for more information.