Fix missing gflags imported target definition in CeresConfig.cmake

- If gflags was built & exported with CMake but glog was not, but both
  were found then as we now make gflags a public dependency of Ceres if
  both it and glog are found, the *name* of the exported gflags CMake
  target (gflags-shared or similar) will appear in CERES_LIBRARIES.
- However, as imported targets are not re-exported, this results in a
  linker error when compiling client code, as the name of the exported
  gflags target is not known to CMake, it assumes it is a library name,
  which it is not.
- Confusingly, if glog was built with CMake, this problem would not
  occur, as in that case glog’s CMake target would bring in gflags’.
- Now we explicitly call find_package(Gflags) in CeresConfig.cmake if
  Ceres was built with gflags as a public dependency (via glog).

Change-Id: I5cc9483a1fae50f4e9e3a8fbba491b645fd45db6
4 files changed
tree: d71a3e81c38e7a33db01f049daeece5c61e1dfde
  1. .gitignore
  2. CMakeLists.txt
  5. cmake/
  6. config/
  7. data/
  8. docs/
  9. examples/
  10. include/
  11. internal/
  12. jni/
  13. package.xml
  14. scripts/

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 for more information.

WARNING - Do not make GitHub pull requests!

Ceres development happens on Gerrit, including both repository hosting and code reviews. The GitHub Repository is a continuously updated mirror which is primarily meant for issue tracking. Please see our Contributing to Ceres Guide for more details.

The upstream Gerrit repository is