cmake protobuf_generate examples

Signatures

protobuf_generate(
  [TARGET <target>]
  [LANGUAGE <lang>]
  [OUT_VAR <variable>]
  [EXPORT_MACRO <macro>]
  [PROTOC_OUT_DIR <out-dir>]
  [PLUGIN <plugin>]
  [PLUGIN_OPTIONS <plugin-options>]
  [DEPENDENCIES <dependencies>...]
  [PROTOS <proto-files>...]
  [IMPORT_DIRS <dirs>...]
  [APPEND_PATH]
  [GENERATE_EXTENSIONS <extensions>...]
  [PROTOC_OPTIONS <options>...]
  [PROTOC_EXE <executable>]
  [DESCRIPTORS]
)

Examples

google/filament third_party/dawn/third_party/protobuf/cmake/tests.cmake :182

protobuf_generate(
        PROTOS ${proto_file}
        LANGUAGE ${generator}
        GENERATE_EXTENSIONS .${generator}.h .${generator}.c
        OUT_VAR pb_generated_files
        IMPORT_DIRS ${protobuf_SOURCE_DIR}/src
        IMPORT_DIRS ${protobuf_SOURCE_DIR}
        PLUGIN protoc-gen-${generator}=$<TARGET_FILE:protobuf::protoc-gen-${generator}>
        DEPENDENCIES $<TARGET_FILE:protobuf::protoc-gen-${generator}>
      )

protocolbuffers/protobuf cmake/tests.cmake :202

protobuf_generate(
        PROTOS ${proto_file}
        LANGUAGE ${generator}
        GENERATE_EXTENSIONS .${generator}.h .${generator}.c
        OUT_VAR pb_generated_files
        IMPORT_DIRS ${protobuf_SOURCE_DIR}/src
        IMPORT_DIRS ${protobuf_SOURCE_DIR}
        PLUGIN protoc-gen-${generator}=$<TARGET_FILE:protobuf::protoc-gen-${generator}>
        DEPENDENCIES $<TARGET_FILE:protobuf::protoc-gen-${generator}>
      )