Here is the error:
Some (but not all) targets in this export set were already defined.
Targets Defined: gflags_shared;gflags_nothreads_shared
Targets not yet defined: gflags_static;gflags_nothreads_static
This must be addressed via some hints in the CMakefile.