forked from ricochet-im/ricochet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add protobuf compilation support to build
This adds dependencies on libprotobuf, protoc, and a C++11 compiler.
- Loading branch information
Showing
4 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Qt qmake integration with Google Protocol Buffers compiler protoc | ||
# | ||
# To compile protocol buffers with qt qmake, specify PROTOS variable and | ||
# include this file | ||
# | ||
# Based on: | ||
# https://vilimpoc.org/blog/2013/06/09/using-google-protocol-buffers-with-qmake/ | ||
|
||
PROTOC = protoc | ||
|
||
unix { | ||
CONFIG += link_pkgconfig | ||
PKGCONFIG += protobuf | ||
} | ||
|
||
win32 { | ||
isEmpty(PROTOBUFDIR):error(You must pass PROTOBUFDIR=path/to/protobuf to qmake on this platform) | ||
INCLUDEPATH += $${PROTOBUFDIR}/include | ||
LIBS += -L$${PROTOBUFDIR}/lib -llibprotobuf | ||
PROTOC = $${PROTOBUFDIR}/protoc.exe | ||
} | ||
|
||
protobuf_decl.name = protobuf headers | ||
protobuf_decl.input = PROTOS | ||
protobuf_decl.output = ${QMAKE_FILE_IN_PATH}/${QMAKE_FILE_BASE}.pb.h | ||
protobuf_decl.commands = $$PROTOC --cpp_out=${QMAKE_FILE_IN_PATH} --proto_path=${QMAKE_FILE_IN_PATH} ${QMAKE_FILE_NAME} | ||
protobuf_decl.variable_out = HEADERS | ||
QMAKE_EXTRA_COMPILERS += protobuf_decl | ||
|
||
protobuf_impl.name = protobuf sources | ||
protobuf_impl.input = PROTOS | ||
protobuf_impl.output = ${QMAKE_FILE_IN_PATH}/${QMAKE_FILE_BASE}.pb.cc | ||
protobuf_impl.depends = ${QMAKE_FILE_IN_PATH}/${QMAKE_FILE_BASE}.pb.h | ||
protobuf_impl.commands = $$escape_expand(\n) | ||
protobuf_impl.variable_out = SOURCES | ||
QMAKE_EXTRA_COMPILERS += protobuf_impl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters