about summary refs log tree commit diff
path: root/cmake/FindProtobufTargets.cmake
diff options
context:
space:
mode:
authorCarlos O'Ryan <coryan@users.noreply.github.com>2020-02-25T18·20-0500
committerGitHub <noreply@github.com>2020-02-25T18·20-0500
commitc1713cb00d5969dcb1a8b0775817d6b3d32886c3 (patch)
tree448eb308e4827cf4aedda41be6ea572fd4f4b798 /cmake/FindProtobufTargets.cmake
parent3e4f8c025e7618abee90ae35e64f6577e96c1c2c (diff)
feat: update protos to 2020-02-25 version (#37)
Update the dependencies based on the new protos.
Diffstat (limited to 'cmake/FindProtobufTargets.cmake')
-rw-r--r--cmake/FindProtobufTargets.cmake71
1 files changed, 34 insertions, 37 deletions
diff --git a/cmake/FindProtobufTargets.cmake b/cmake/FindProtobufTargets.cmake
index 28cb36fca8c5..ab196118d731 100644
--- a/cmake/FindProtobufTargets.cmake
+++ b/cmake/FindProtobufTargets.cmake
@@ -107,35 +107,35 @@ else ()
 
         if (NOT TARGET protobuf::libprotobuf)
             add_library(protobuf::libprotobuf IMPORTED INTERFACE)
-            set_property(TARGET protobuf::libprotobuf
-                         PROPERTY INTERFACE_INCLUDE_DIRECTORIES
-                                  ${Protobuf_INCLUDE_DIR})
-            set_property(TARGET protobuf::libprotobuf
-                         APPEND
-                         PROPERTY INTERFACE_LINK_LIBRARIES ${Protobuf_LIBRARY}
-                                  Threads::Threads)
+            set_property(
+                TARGET protobuf::libprotobuf
+                PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Protobuf_INCLUDE_DIR})
+            set_property(
+                TARGET protobuf::libprotobuf APPEND
+                PROPERTY INTERFACE_LINK_LIBRARIES ${Protobuf_LIBRARY}
+                         Threads::Threads)
         endif ()
 
         if (NOT TARGET protobuf::libprotobuf-lite)
             add_library(protobuf::libprotobuf-lite IMPORTED INTERFACE)
-            set_property(TARGET protobuf::libprotobuf-lite
-                         PROPERTY INTERFACE_INCLUDE_DIRECTORIES
-                                  ${Protobuf_INCLUDE_DIR})
-            set_property(TARGET protobuf::libprotobuf-lite
-                         APPEND
-                         PROPERTY INTERFACE_LINK_LIBRARIES
-                                  ${Protobuf_LITE_LIBRARY} Threads::Threads)
+            set_property(
+                TARGET protobuf::libprotobuf-lite
+                PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Protobuf_INCLUDE_DIR})
+            set_property(
+                TARGET protobuf::libprotobuf-lite APPEND
+                PROPERTY INTERFACE_LINK_LIBRARIES ${Protobuf_LITE_LIBRARY}
+                         Threads::Threads)
         endif ()
 
         if (NOT TARGET protobuf::libprotoc)
             add_library(protobuf::libprotoc IMPORTED INTERFACE)
-            set_property(TARGET protobuf::libprotoc
-                         PROPERTY INTERFACE_INCLUDE_DIRECTORIES
-                                  ${Protobuf_INCLUDE_DIR})
-            set_property(TARGET protobuf::libprotoc
-                         APPEND
-                         PROPERTY INTERFACE_LINK_LIBRARIES
-                                  ${Protobuf_PROTOC_LIBRARY} Threads::Threads)
+            set_property(
+                TARGET protobuf::libprotoc
+                PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Protobuf_INCLUDE_DIR})
+            set_property(
+                TARGET protobuf::libprotoc APPEND
+                PROPERTY INTERFACE_LINK_LIBRARIES ${Protobuf_PROTOC_LIBRARY}
+                         Threads::Threads)
         endif ()
     endif ()
 endif ()
@@ -152,9 +152,10 @@ if (ProtobufTargets_FOUND AND NOT TARGET protobuf::protoc)
     add_executable(protobuf::protoc IMPORTED)
 
     # Discover the protoc compiler location.
-    find_program(_protobuf_PROTOC_EXECUTABLE
-                 NAMES protoc
-                 DOC "The Google Protocol Buffers Compiler")
+    find_program(
+        _protobuf_PROTOC_EXECUTABLE
+        NAMES protoc
+        DOC "The Google Protocol Buffers Compiler")
     if (protobuf_DEBUG)
         message(
             STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
@@ -165,11 +166,11 @@ if (ProtobufTargets_FOUND AND NOT TARGET protobuf::protoc)
     set_property(TARGET protobuf::protoc
                  PROPERTY IMPORTED_LOCATION ${_protobuf_PROTOC_EXECUTABLE})
     set_property(
-        TARGET protobuf::protoc
-        PROPERTY IMPORTED_LOCATION_DEBUG ${_protobuf_PROTOC_EXECUTABLE})
-    set_property(TARGET protobuf::protoc
-                 PROPERTY IMPORTED_LOCATION_RELEASE
-                          ${_protobuf_PROTOC_EXECUTABLE})
+        TARGET protobuf::protoc PROPERTY IMPORTED_LOCATION_DEBUG
+                                         ${_protobuf_PROTOC_EXECUTABLE})
+    set_property(
+        TARGET protobuf::protoc PROPERTY IMPORTED_LOCATION_RELEASE
+                                         ${_protobuf_PROTOC_EXECUTABLE})
     unset(_protobuf_PROTOC_EXECUTABLE)
 
     if (protobuf_DEBUG)
@@ -186,10 +187,8 @@ if (protobuf_DEBUG)
                    "ProtobufTargets_FOUND = ${ProtobufTargets_FOUND}"
                    " ProtobufTargets_VERSION = ${ProtobufTargets_VERSION}")
     if (ProtobufTargets_FOUND)
-        foreach (_target
-                 protobuf::libprotobuf
-                 protobuf::libprotobuf-lite
-                 protobuf::libprotoc)
+        foreach (_target protobuf::libprotobuf protobuf::libprotobuf-lite
+                         protobuf::libprotoc)
             if (NOT TARGET ${_target})
                 message(
                     STATUS
@@ -201,7 +200,5 @@ if (protobuf_DEBUG)
     endif ()
 endif ()
 
-find_package_handle_standard_args(ProtobufTargets
-                                  REQUIRED_VARS
-                                  ProtobufTargets_FOUND
-                                  ProtobufTargets_VERSION)
+find_package_handle_standard_args(ProtobufTargets REQUIRED_VARS
+                                  ProtobufTargets_FOUND ProtobufTargets_VERSION)