gflags library target renamed in v2.2.0
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index 20c1b27..a326f36 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -210,8 +210,8 @@
endif()
if(EXISTS "<%text>${GFLAGS_ROOT_DIR}</%text>/CMakeLists.txt")
add_subdirectory(<%text>${GFLAGS_ROOT_DIR}</%text> third_party/gflags)
- if(TARGET gflags-static)
- set(_gRPC_GFLAGS_LIBRARIES gflags-static)
+ if(TARGET gflags_static)
+ set(_gRPC_GFLAGS_LIBRARIES gflags_static)
endif()
else()
message(WARNING "gRPC_GFLAGS_PROVIDER is \"module\" but GFLAGS_ROOT_DIR is wrong")