Take the location of gflags from a variable passed in by the parent script.

The build of glog as part of the Cobalt stand-alone CMake build was failing
on my new laptop (even though it seems to work on the build bot and on other
people's dev machines.) I believe this
is because the build was linking against the version of gflags that happened
to be on the build machine and my new laptop must have an older version
of gflags.

Change-Id: I3c54f73042dfd19cad953bd01341a38e4eb4a779
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ede6e7..a459818 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -396,7 +396,11 @@
     HAVE_SNPRINTF)
 endif (WIN32 AND HAVE_SNPRINTF)
 
-if (gflags_FOUND)
+# Note(rudominer) cobalt_gflags_DIR is defined in Cobalt's CMakeLists.txt file.
+if (DEFINED cobalt_gflags_DIR)
+  target_include_directories (glog PUBLIC ${cobalt_gflags_DIR}/include)
+  target_link_libraries (glog PUBLIC ${cobalt_gflags_DIR}/lib/libgflags.a)
+elseif (gflags_FOUND)
   target_include_directories (glog PUBLIC $<BUILD_INTERFACE:${gflags_INCLUDE_DIR}>)
   target_link_libraries (glog PUBLIC ${gflags_LIBRARIES})
 
@@ -404,7 +408,7 @@
     # Don't use __declspec(dllexport|dllimport) if this is a static build
     targeT_compile_definitions (glog PUBLIC GFLAGS_DLL_DECLARE_FLAG= GFLAGS_DLL_DEFINE_FLAG=)
   endif (NOT BUILD_SHARED_LIBS)
-endif (gflags_FOUND)
+endif (DEFINED cobalt_gflags_DIR)
 
 set_target_properties (glog PROPERTIES VERSION ${GLOG_MAJOR_VERSION})
 set_target_properties (glog PROPERTIES SOVERSION ${GLOG_VERSION})