about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCarlos O'Ryan <coryan@users.noreply.github.com>2019-09-01T20·42-0400
committerGitHub <noreply@github.com>2019-09-01T20·42-0400
commit03c3da1e78a48f80affad1c4353309a7ca2f12ff (patch)
tree9c5c8d6ba52c73c2602192f82c4fb3c43462a664
parent51d2b0895c8e301cd132038252734df0ed41afc4 (diff)
parent1f68a41e38079373d763478ec56cc2eeafb26906 (diff)
bug: do not redefine targets in config file.
-rw-r--r--cmake/config.cmake.in9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in
index 2dd9201977c0..295501e569b9 100644
--- a/cmake/config.cmake.in
+++ b/cmake/config.cmake.in
@@ -38,7 +38,10 @@ foreach (_target
          type_expr)
     set(scoped_name "googleapis-c++::${_target}_protos")
     set(imported_name "googleapis_cpp_${_target}_protos")
-    add_library(${scoped_name} IMPORTED INTERFACE)
-    set_target_properties(${scoped_name}
-                          PROPERTIES INTERFACE_LINK_LIBRARIES ${imported_name})
+    if (NOT TARGET ${scoped_name})
+        add_library(${scoped_name} IMPORTED INTERFACE)
+        set_target_properties(${scoped_name}
+                              PROPERTIES INTERFACE_LINK_LIBRARIES
+                              ${imported_name})
+    endif ()
 endforeach ()