diff options
author | Brad King <brad.king@kitware.com> | 2019-05-13 14:02:17 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-13 14:02:26 (GMT) |
commit | b498967243cb531c8c6fe60e6712432a2064507b (patch) | |
tree | 377dbac718947fcf37050fffde62c975920dea5c /Modules | |
parent | 9af34615ae1a84a890a280c3cdd75856e879fb64 (diff) | |
parent | 9a324cbee092276b4c344b5deec5875ab76b3e3b (diff) | |
download | CMake-b498967243cb531c8c6fe60e6712432a2064507b.zip CMake-b498967243cb531c8c6fe60e6712432a2064507b.tar.gz CMake-b498967243cb531c8c6fe60e6712432a2064507b.tar.bz2 |
Merge topic 'FindProtobuf-gen-sources'
9a324cbee0 Protobuf: Fix generated source path with PROTOBUF_GENERATE_CPP_APPEND_PATH OFF
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3295
Diffstat (limited to 'Modules')
-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 1758fb3..76bc873 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) |