• Home
  • Raw
  • Download

Lines Matching +full:object +full:- +full:schema

8 [`protobuf-generate.cmake`](../cmake/protobuf-generate.cmake). It can be used to automatically gene…
12 … to generate and compile the source files of a proto schema whenever an object target called `prot…
16 - `proto/helloworld/helloworld.proto`
17 - `CMakeLists.txt`
19 where `helloworld.proto` is a protobuf schema file and `CMakeLists.txt` contains:
24 add_library(proto-objects OBJECT "${CMAKE_CURRENT_LIST_DIR}/proto/helloworld/helloworld.proto")
26 target_link_libraries(proto-objects PUBLIC protobuf::libprotobuf)
30 target_include_directories(proto-objects PUBLIC "$<BUILD_INTERFACE:${PROTO_BINARY_DIR}>")
33 TARGET proto-objects
38 Building the target `proto-objects` will generate the files:
40 - `${CMAKE_CURRENT_BINARY_DIR}/generated/helloworld/helloworld.pb.h`
41 - `${CMAKE_CURRENT_BINARY_DIR}/generated/helloworld/helloworld.pb.cc`
47 [build] [2/2] Building CXX object /build/generated/helloworld/helloworld.pb.cc.o
52 …'s `grpc_cpp_plugin`. Given the same directory structure as in the [basic example](#basic-example)
58 add_library(proto-objects OBJECT "${CMAKE_CURRENT_LIST_DIR}/proto/helloworld/helloworld.proto")
60 target_link_libraries(proto-objects PUBLIC protobuf::libprotobuf gRPC::grpc++)
65 target_include_directories(proto-objects PUBLIC "$<BUILD_INTERFACE:${PROTO_BINARY_DIR}>")
68 TARGET proto-objects
73 TARGET proto-objects
76 PLUGIN "protoc-gen-grpc=\$<TARGET_FILE:gRPC::grpc_cpp_plugin>"
81 Then building `proto-objects` will generate and compile:
83 - `${CMAKE_CURRENT_BINARY_DIR}/generated/helloworld/helloworld.pb.h`
84 - `${CMAKE_CURRENT_BINARY_DIR}/generated/helloworld/helloworld.pb.cc`
85 - `${CMAKE_CURRENT_BINARY_DIR}/generated/helloworld/helloworld.grpc.pb.h`
86 - `${CMAKE_CURRENT_BINARY_DIR}/generated/helloworld/helloworld.grpc.pb.cc`
88 And `protoc` will automatically be re-run whenever the schema files change and `proto-objects` is b…
108 …is made up of the arguments for `protoc`, like the output directory, the schema files, the languag…
117 - `APPEND_PATH` — A flag that causes the base path of all proto schema files to be added to `IMPORT…
119 Single-value arguments:
121 - `LANGUAGE` — A single value: cpp or python. Determines what kind of source
123 - `OUT_VAR` — Name of a CMake variable that will be filled with the paths to
125 - `EXPORT_MACRO` — Name of a macro that is applied to all generated Protobuf
128 - `PROTOC_EXE` — Command name, path, or CMake executable used to run protoc
130 - `PROTOC_OUT_DIR` — Output directory of generated source files. Defaults to
132 - `PLUGIN` — An optional plugin executable. This could, for example, be the
134 - `PLUGIN_OPTIONS` — Additional options provided to the plugin, such as
136 - `DEPENDENCIES` — Arguments forwarded to the `DEPENDS` of the underlying
138 - `TARGET` — CMake target that will have the generated files added as sources.
140 Multi-value arguments:
142 - `PROTOS` — List of proto schema files. If omitted, then every source file
144 - `IMPORT_DIRS` — A common parent directory for the schema files. For example,
145 if the schema file is `proto/helloworld/helloworld.proto` and the import
149 - `GENERATE_EXTENSIONS` — If LANGUAGE is omitted then this must be set to the
151 - `PROTOC_OPTIONS` — Additional arguments that are forwarded to protoc.