aboutsummaryrefslogtreecommitdiff
path: root/cmake/protobuf-targets.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/protobuf-targets.cmake')
-rw-r--r--cmake/protobuf-targets.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmake/protobuf-targets.cmake b/cmake/protobuf-targets.cmake
new file mode 100644
index 00000000..72660aaa
--- /dev/null
+++ b/cmake/protobuf-targets.cmake
@@ -0,0 +1,17 @@
+# Library aliases
+foreach(_library
+ libprotobuf-lite
+ libprotobuf
+ libprotoc)
+ if(TARGET ${_library} AND NOT TARGET protobuf::${_library})
+ add_library(protobuf::${_library} ALIAS ${_library})
+ endif()
+endforeach()
+
+# Executable aliases
+foreach(_executable
+ protoc)
+ if(TARGET ${_executable} AND NOT TARGET protobuf::${_executable})
+ add_executable(protobuf::${_executable} ALIAS ${_executable})
+ endif()
+endforeach()