Hi protobuf community members,
I had an idea about some improvements for
the protobuf cmake file. It was discussed over
a recent merge request. I agree with Brad King's comment about moving this to the upstream code base but before I send it out, just want to get a sense whether I am on the right track. Right now, the function generate_protobuf is intended to be used like this:
protobuf_generate(
OUT_VAR helloworld_proto
PROTOS helloworld.proto
LANGUAGE cpp
)
protobuf_generate(
OUT_VAR helloworld_grpc
PROTOS helloworld.proto
LANGUAGE grpc
PLUGIN "protoc-gen-grpc=${_GRPC_CPP_PLUGIN_EXECUTABLE}"
)
It seems for each grpc proto file, we will need two calls, so I want to make it also support
protobuf_generate(
OUT_VAR helloworld_proto
PLUGIN_OUT_VAR helloworld_gprc
PROTOS helloworld.proto
LANGUAGE cpp
PLUGIN "protoc-gen-grpc=${_GRPC_CPP_PLUGIN_EXECUTABLE}"
GENERATE_EXTENSIONS .pb.h .pb.cc .grpc.pb.h .grpc.pb.cc
)
Let me know if this would be a good change to make and I am happy to send out a pull request.