Cleanup FindGflags & use installed gflags CMake config if present.

- Split out gflags namespace detection methods:
  check_cxx_source_compiles() & regex, into separate functions.
- Use installed/exported gflags CMake configuration (present for
  versions >= 2.1) if available, unless user expresses a preference not
  to, or specifies search directories, in which case fall back to manual
  search for components.
-- Prefer installed gflags CMake configurations over exported gflags
   build directories on all OSs.
- Remove custom version of check_cxx_source_compiles() that attempted
  to force the build type of the test project.  This only worked for
  NMake on Windows, not MSVC as msbuild ignored our attempts to force
  the build type.  Now we always use the regex method on Windows if
  we cannot find an installed gflags CMake configuration which works
  even on MSVC by bypassing msbuild.
- Add default search paths for gflags on Windows.

Change-Id: I083b267d97a7a5838a1314f3d41a61ae48d5a2d7
1 file changed
tree: 2a703a79525cecc254a887367743201ca297575f
  1. cmake/
  2. config/
  3. data/
  4. docs/
  5. examples/
  6. include/
  7. internal/
  8. jni/
  9. scripts/
  10. .gitignore
  11. CMakeLists.txt
  12. LICENSE
  13. README.md
README.md

Ceres Solver - A non-linear least squares minimizer

Please see ceres-solver.org 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

https://ceres-solver.googlesource.com/ceres-solver