aboutsummaryrefslogtreecommitdiff
path: root/cmake/protobuf-targets.cmake
diff options
context:
space:
mode:
authorKonstantin Podsvirov <konstantin@podsvirov.pro>2016-06-01 17:00:08 +0300
committerKonstantin Podsvirov <konstantin@podsvirov.pro>2016-06-04 00:10:07 +0300
commit71556295ffe315be34ce70e1a6821860fb088f07 (patch)
tree2429940c0d78972693670df9aea755cf23ec9d59 /cmake/protobuf-targets.cmake
parent20b532544fde1dff34429b52db95c3a96409b73c (diff)
downloadprotobuf-71556295ffe315be34ce70e1a6821860fb088f07.tar.gz
protobuf-71556295ffe315be34ce70e1a6821860fb088f07.tar.bz2
protobuf-71556295ffe315be34ce70e1a6821860fb088f07.zip
CMake project updates
A series of improvements: - Improved Protobuf module compatibility (disabled by default); - Hide advanced settings; - Added build tree configuration; - Added build of examples.
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()