fix macos build
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index 8778599..966a73c 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -182,8 +182,8 @@
     set(CARES_STATIC ON)
     set(CARES_INCLUDE_DIR "<%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/third_party/cares/cares")
     add_subdirectory(third_party/cares/cares)
-    if(TARGET c-ares_static)
-      set(_gRPC_CARES_LIBRARIES c-ares_static)
+    if(TARGET c-ares)
+      set(_gRPC_CARES_LIBRARIES c-ares)
     endif()
     if(gRPC_INSTALL)
       message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_CARES_PROVIDER is \"module\"")