diff options
Diffstat (limited to 'pacman-c++/protobuf.pri')
| -rw-r--r-- | pacman-c++/protobuf.pri | 33 |
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 | |||
| 16 | PROTOPATH += . | ||
| 17 | PROTOPATHS = | ||
| 18 | for(p, PROTOPATH):PROTOPATHS += --proto_path=$${p} | ||
| 19 | |||
| 20 | protobuf_decl.name = protobuf header | ||
| 21 | protobuf_decl.input = PROTOS | ||
| 22 | protobuf_decl.output = ${QMAKE_FILE_BASE}.pb.h | ||
| 23 | protobuf_decl.commands = protoc --cpp_out="." $${PROTOPATHS} ${QMAKE_FILE_IN} | ||
| 24 | protobuf_decl.variable_out = GENERATED_FILES | ||
| 25 | QMAKE_EXTRA_COMPILERS += protobuf_decl | ||
| 26 | |||
| 27 | protobuf_impl.name = protobuf implementation | ||
| 28 | protobuf_impl.input = PROTOS | ||
| 29 | protobuf_impl.output = ${QMAKE_FILE_BASE}.pb.cc | ||
| 30 | protobuf_impl.depends = ${QMAKE_FILE_BASE}.pb.h | ||
| 31 | protobuf_impl.commands = $$escape_expand(\\n) | ||
| 32 | protobuf_impl.variable_out = GENERATED_SOURCES | ||
| 33 | QMAKE_EXTRA_COMPILERS += protobuf_impl | ||
