summaryrefslogtreecommitdiffstats
path: root/pacman-c++/protobuf.pri
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/protobuf.pri')
-rw-r--r--pacman-c++/protobuf.pri33
1 files changed, 33 insertions, 0 deletions
diff --git a/pacman-c++/protobuf.pri b/pacman-c++/protobuf.pri
new file mode 100644
index 0000000..03b9514
--- /dev/null
+++ b/pacman-c++/protobuf.pri
@@ -0,0 +1,33 @@
1#
2# Qt qmake integration with Google Protocol Buffers compiler protoc
3#
4# To compile protocol buffers with qt qmake, specify PROTOS variable and
5# include this file
6#
7# Example:
8# PROTOS = a.proto b.proto
9# include(protobuf.pri)
10#
11# By default protoc looks for .proto files (including the imported ones) in
12# the current directory where protoc is run. If you need to include additional
13# paths specify the PROTOPATH variable
14#
15
16PROTOPATH += .
17PROTOPATHS =
18for(p, PROTOPATH):PROTOPATHS += --proto_path=$${p}
19
20protobuf_decl.name = protobuf header
21protobuf_decl.input = PROTOS
22protobuf_decl.output = ${QMAKE_FILE_BASE}.pb.h
23protobuf_decl.commands = protoc --cpp_out="." $${PROTOPATHS} ${QMAKE_FILE_IN}
24protobuf_decl.variable_out = GENERATED_FILES
25QMAKE_EXTRA_COMPILERS += protobuf_decl
26
27protobuf_impl.name = protobuf implementation
28protobuf_impl.input = PROTOS
29protobuf_impl.output = ${QMAKE_FILE_BASE}.pb.cc
30protobuf_impl.depends = ${QMAKE_FILE_BASE}.pb.h
31protobuf_impl.commands = $$escape_expand(\\n)
32protobuf_impl.variable_out = GENERATED_SOURCES
33QMAKE_EXTRA_COMPILERS += protobuf_impl