Skip to content

[CMake] Allow custom plugin options e.g. to generate mocks#9105

Merged
acozzette merged 6 commits intoprotocolbuffers:masterfrom
tiolan:topic/plugin_opts
Feb 9, 2022
Merged

[CMake] Allow custom plugin options e.g. to generate mocks#9105
acozzette merged 6 commits intoprotocolbuffers:masterfrom
tiolan:topic/plugin_opts

Conversation

@tiolan
Copy link
Copy Markdown
Contributor

@tiolan tiolan commented Oct 15, 2021

This would allow setting options for plugins, e.g. to generate mocks.
Example:

protobuf_generate(
      TARGET
      myTarget
      LANGUAGE
      grpc
      PROTOC_OUT_DIR
      ${CMAKE_BINARY_DIR}
      GENERATE_EXTENSIONS
      .grpc.pb.h
      .grpc.pb.cc
      PLUGIN
      protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin>
      PLUGIN_OPTIONS
      generate_mock_code=true
      IMPORT_DIRS
      ${PROTO_IMPORT_DIRS})

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Oct 15, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla Bot added the cla: no label Oct 15, 2021
@tiolan
Copy link
Copy Markdown
Contributor Author

tiolan commented Oct 15, 2021

@googlebot I signed it!

@tiolan
Copy link
Copy Markdown
Contributor Author

tiolan commented Oct 15, 2021

Resolves #8779

@tiolan
Copy link
Copy Markdown
Contributor Author

tiolan commented Nov 30, 2021

@acozzette any chance this will be merged?

Comment thread cmake/protobuf-config.cmake.in
@acozzette acozzette merged commit 4ed3941 into protocolbuffers:master Feb 9, 2022
@acozzette
Copy link
Copy Markdown

Thanks, @tiolan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants