asio-grpc v3.1.0
Asynchronous gRPC with Asio/unified executors
|
In the same directory that called find_package(asio-grpc)
the following CMake function will be made available. It can be used to generate Protobuf/gRPC source files from .proto
schemas.
If you are using cmake-format then you can copy the asio_grpc_protobuf_generate
section from cmake-format.yaml to get proper formatting.
.proto
schema files.CMAKE_CURRENT_BINARY_DIR
.<target>
: PRIVATE
, PUBLIC
, INTERFACE
. Default: PRIVATE
.<proto_file_base_name>.desc
._mock.grpc.pb.h
.
Given a CMake target called target-option
:
Compiling target-option
will cause the generation and compilation of:
${CMAKE_CURRENT_BINARY_DIR}/target/target.pb.h
${CMAKE_CURRENT_BINARY_DIR}/target/target.pb.cc
${CMAKE_CURRENT_BINARY_DIR}/target/target.grpc.pb.h
${CMAKE_CURRENT_BINARY_DIR}/target/target.grpc.pb.cc
${CMAKE_CURRENT_BINARY_DIR}/target/target_mock.grpc.pb.h
whenever ${CMAKE_CURRENT_SOURCE_DIR}/proto/target.proto
has been modified.