Browse Source

protobuf_generate(): add relative path to output dir

Without this fix, protobuf_generate() sets the variable _generated_srcs to
${protobuf_generate_PROTOC_OUT_DIR}/${_rel_dir}/${_basename}${_ext}
but generates the files in
${protobuf_generate_PROTOC_OUT_DIR}/${_basename}${_ext}
Markus Heß 7 years ago
parent
commit
93f6b67eb2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      cmake/protobuf-config.cmake.in

+ 1 - 1
cmake/protobuf-config.cmake.in

@@ -105,7 +105,7 @@ function(protobuf_generate)
     add_custom_command(
     add_custom_command(
       OUTPUT ${_generated_srcs}
       OUTPUT ${_generated_srcs}
       COMMAND  protobuf::protoc
       COMMAND  protobuf::protoc
-      ARGS --${protobuf_generate_LANGUAGE}_out ${_dll_export_decl}${protobuf_generate_PROTOC_OUT_DIR} ${_protobuf_include_path} ${_abs_file}
+      ARGS --${protobuf_generate_LANGUAGE}_out ${_dll_export_decl}${protobuf_generate_PROTOC_OUT_DIR}/${_rel_dir} ${_protobuf_include_path} ${_abs_file}
       DEPENDS ${_abs_file} protobuf::protoc
       DEPENDS ${_abs_file} protobuf::protoc
       COMMENT "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}"
       COMMENT "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}"
       VERBATIM )
       VERBATIM )