[Cmake-commits] CMake branch, next, updated. v3.7.0-rc1-211-g284bc42
Brad King
brad.king at kitware.com
Fri Oct 7 09:52:11 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 284bc42262d70e849e5ebab15cf930f220a41f7c (commit)
via 2b9dad694a43d850af5fe83dd327fc82db29a012 (commit)
from 92d6775f6bb2443adaab7f85a645ed01e8a5cf15 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=284bc42262d70e849e5ebab15cf930f220a41f7c
commit 284bc42262d70e849e5ebab15cf930f220a41f7c
Merge: 92d6775 2b9dad6
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 7 09:52:10 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Oct 7 09:52:10 2016 -0400
Merge topic 'FindProtobuf-fix-subdirs' into next
2b9dad69 FindProtobuf: Fix protobuf_generate_*() to handle subdirs
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2b9dad694a43d850af5fe83dd327fc82db29a012
commit 2b9dad694a43d850af5fe83dd327fc82db29a012
Author: Martin Joly <perso at martin-joly.fr>
AuthorDate: Fri Oct 7 15:37:55 2016 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 7 09:50:52 2016 -0400
FindProtobuf: Fix protobuf_generate_*() to handle subdirs
The change in commit v3.7.0-rc1~513^2 (FindProtobuf: fix
protobuf_generate_*() to handle proto files in subdirs, 2016-06-09)
incorrectly adds subdirectories to the path of the generated files when
`*.proto` files are passed to `protobuf_generate_*` with subdirectories.
This behavior is not correct when `PROTOBUF_GENERATE_CPP_APPEND_PATH` is
True (default behavior) as `protoc` will generate output file in the
current build directory.
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")
-----------------------------------------------------------------------
Summary of changes:
Modules/FindProtobuf.cmake | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list