diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2018-06-25 14:48:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 14:48:44 -0700 |
commit | bc21385aa1f0e8b71ff9015564aba0bd437ae943 (patch) | |
tree | 11fce3ee3fe9dc89ac4406937374f78a0a969c87 | |
parent | 7402555f34bbe04ca20268eff54a026c158087fb (diff) | |
parent | 3e84147d53bea86f9e0e88c642f7af4b00365621 (diff) |
Merge pull request #4826 from wittmeie/wittmeie/fix-for-protobuf-generate-output-definitions
Fixed protobuf_generate output definition
-rw-r--r-- | cmake/protobuf-config.cmake.in | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cmake/protobuf-config.cmake.in b/cmake/protobuf-config.cmake.in index 3480c17c..18054687 100644 --- a/cmake/protobuf-config.cmake.in +++ b/cmake/protobuf-config.cmake.in @@ -92,11 +92,13 @@ function(protobuf_generate) set(_generated_srcs_all) foreach(_proto ${protobuf_generate_PROTOS}) get_filename_component(_abs_file ${_proto} ABSOLUTE) + get_filename_component(_abs_dir ${_abs_file} DIRECTORY) get_filename_component(_basename ${_proto} NAME_WE) + file(RELATIVE_PATH _rel_dir ${CMAKE_CURRENT_SOURCE_DIR} ${_abs_dir}) set(_generated_srcs) foreach(_ext ${protobuf_generate_GENERATE_EXTENSIONS}) - list(APPEND _generated_srcs "${protobuf_generate_PROTOC_OUT_DIR}/${_basename}${_ext}") + list(APPEND _generated_srcs "${protobuf_generate_PROTOC_OUT_DIR}/${_rel_dir}/${_basename}${_ext}") endforeach() list(APPEND _generated_srcs_all ${_generated_srcs}) |