Zhenkai Zhu | eeff966 | 2012-05-30 17:02:49 -0700 | [diff] [blame^] | 1 | PROTOPATH += . |
| 2 | PROTOPATHS = |
| 3 | for(p, PROTOPATH):PROTOPATHS += --proto_path=$${p} |
| 4 | |
| 5 | protobuf_decl.name = protobuf header |
| 6 | protobuf_decl.input = PROTOS |
| 7 | protobuf_decl.output = ${QMAKE_FILE_BASE}.pb.h |
| 8 | protobuf_decl.commands = protoc --cpp_out="." $${PROTOPATHS} ${QMAKE_FILE_NAME} |
| 9 | protobuf_decl.variable_out = GENERATED_FILES |
| 10 | QMAKE_EXTRA_COMPILERS += protobuf_decl |
| 11 | |
| 12 | protobuf_impl.name = protobuf implementation |
| 13 | protobuf_impl.input = PROTOS |
| 14 | protobuf_impl.output = ${QMAKE_FILE_BASE}.pb.cc |
| 15 | protobuf_impl.depends = ${QMAKE_FILE_BASE}.pb.h |
| 16 | protobuf_impl.commands = $$escape_expand(\n) |
| 17 | protobuf_impl.variable_out = GENERATED_SOURCES |
| 18 | QMAKE_EXTRA_COMPILERS += protobuf_impl |