diff options
author | Brad King <brad.king@kitware.com> | 2016-10-07 14:16:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-10-07 14:16:33 (GMT) |
commit | a033f8671272c382ba55c23f1269439cc4db4a97 (patch) | |
tree | 323535c26b7139a37f46def27602fd72033e67b1 | |
parent | 111d90465f00559c808b7a02944f890af6c0fe89 (diff) | |
parent | 2b9dad694a43d850af5fe83dd327fc82db29a012 (diff) | |
download | CMake-a033f8671272c382ba55c23f1269439cc4db4a97.zip CMake-a033f8671272c382ba55c23f1269439cc4db4a97.tar.gz CMake-a033f8671272c382ba55c23f1269439cc4db4a97.tar.bz2 |
Merge branch 'FindProtobuf-fix-subdirs' into release
-rw-r--r-- | Modules/FindProtobuf.cmake | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index 10c07c2..14e392a 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -136,9 +136,11 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS) foreach(FIL ${ARGN}) get_filename_component(ABS_FIL ${FIL} ABSOLUTE) get_filename_component(FIL_WE ${FIL} NAME_WE) - get_filename_component(FIL_DIR ${FIL} DIRECTORY) - if(FIL_DIR) - set(FIL_WE "${FIL_DIR}/${FIL_WE}") + if(NOT PROTOBUF_GENERATE_CPP_APPEND_PATH) + get_filename_component(FIL_DIR ${FIL} DIRECTORY) + if(FIL_DIR) + set(FIL_WE "${FIL_DIR}/${FIL_WE}") + endif() endif() list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc") @@ -197,9 +199,11 @@ function(PROTOBUF_GENERATE_PYTHON SRCS) foreach(FIL ${ARGN}) get_filename_component(ABS_FIL ${FIL} ABSOLUTE) get_filename_component(FIL_WE ${FIL} NAME_WE) - get_filename_component(FIL_DIR ${FIL} DIRECTORY) - if(FIL_DIR) - set(FIL_WE "${FIL_DIR}/${FIL_WE}") + if(NOT PROTOBUF_GENERATE_CPP_APPEND_PATH) + get_filename_component(FIL_DIR ${FIL} DIRECTORY) + if(FIL_DIR) + set(FIL_WE "${FIL_DIR}/${FIL_WE}") + endif() endif() list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py") |