如果我想在 cmake 中重新创建以下 protoc 命令:
protoc -I ../proto/ --cpp_out=. service.proto
我在 cmake 中使用以下几行:
file(GLOB ProtoFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.proto")
PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
如果我想重新创建下面的 protoc 命令:
protoc -I ../proto/ --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` service.proto
在上述情况下,我无法确定如何更改 cmake 文件,请帮助!
问题是我该如何解决:
--plugin=EXECUTABLE Specifies a plugin executable to use.
Normally, protoc searches the PATH for
plugins, but you may specify additional
executables not in the path using this flag.
Additionally, EXECUTABLE may be of the form
NAME=PATH, in which case the given plugin name
is mapped to the given executable even if
the executable's own name differs.
我一直在阅读PROTOBUF_GENERATE_CPP文档,但没有找到答案!