Cleanup FindGflags & use installed gflags CMake config if present.
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

ysonggit/ceres-solver,whuaegeanse/ceres-solver,whuaegeanse/ceres-solver,whuaegeanse/ceres-solver,DougFirErickson/ceres-solver,whuaegeanse/ceres-solver,DougFirErickson/ceres-solver,ysonggit/ceres-solver,ysonggit/ceres-solver,DougFirErickson/ceres-solver,ysonggit/ceres-solver,DougFirErickson/ceres-solver