Only include utf8_range if it hasn't been included already

See #1201

PiperOrigin-RevId: 518333273
diff --git a/cmake/make_cmakelists.py b/cmake/make_cmakelists.py
index 5cf92b3..6e552ba 100755
--- a/cmake/make_cmakelists.py
+++ b/cmake/make_cmakelists.py
@@ -349,20 +349,22 @@
     include_directories(../cmake)
     include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
-    if(EXISTS ../external/utf8_range)
-      # utf8_range is already installed
-      include_directories(../external/utf8_range)
-    else()
-      include(FetchContent)
-      FetchContent_Declare(
-        utf8_range
-        GIT_REPOSITORY "https://github.com/protocolbuffers/utf8_range.git"
-        GIT_TAG "%(utf8_range_commit)s"
-      )
-      FetchContent_GetProperties(utf8_range)
-      if(NOT utf8_range_POPULATED)
-        FetchContent_Populate(utf8_range)
-        include_directories(${utf8_range_SOURCE_DIR})
+    if(NOT TARGET utf8_range)
+      if(EXISTS ../external/utf8_range)
+        # utf8_range is already installed
+        include_directories(../external/utf8_range)
+      else()
+        include(FetchContent)
+        FetchContent_Declare(
+          utf8_range
+          GIT_REPOSITORY "https://github.com/protocolbuffers/utf8_range.git"
+          GIT_TAG "%(utf8_range_commit)s"
+        )
+        FetchContent_GetProperties(utf8_range)
+        if(NOT utf8_range_POPULATED)
+          FetchContent_Populate(utf8_range)
+          include_directories(${utf8_range_SOURCE_DIR})
+        endif()
       endif()
     endif()