diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2019-05-08 12:54:37 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2019-05-08 14:57:00 +0200 |
commit | 9a324cbee092276b4c344b5deec5875ab76b3e3b (patch) | |
tree | 8b125c2282ffb4019d27e8d79d287a404ab1271b /Modules/FindProtobuf.cmake | |
parent | afd7df9d1cd9f4aefc3a15e274cd8c6fb01e339c (diff) | |
download | cmake-9a324cbee092276b4c344b5deec5875ab76b3e3b.tar.gz |
Protobuf: Fix generated source path with PROTOBUF_GENERATE_CPP_APPEND_PATH OFF
Diffstat (limited to 'Modules/FindProtobuf.cmake')
-rw-r--r-- | Modules/FindProtobuf.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 1758fb3556..76bc873fd8 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -207,9 +207,14 @@ function(protobuf_generate) get_filename_component(_basename ${_proto} NAME_WE) file(RELATIVE_PATH _rel_dir ${CMAKE_CURRENT_SOURCE_DIR} ${_abs_dir}) + set(_possible_rel_dir) + if (NOT protobuf_generate_APPEND_PATH) + set(_possible_rel_dir ${_rel_dir}/) + endif() + 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}/${_possible_rel_dir}${_basename}${_ext}") endforeach() if(protobuf_generate_DESCRIPTORS AND protobuf_generate_LANGUAGE STREQUAL cpp) |