summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-10 13:10:02 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-06-10 13:10:02 (GMT)
commitff4697fc94d74e8c08d165837add668ccb5a5fad (patch)
tree3a8d98a4e711fe589b8369663220e28fbe99f86f /Modules
parentfbf461dde26aca7bb4b44d0f25e459ea30e3aa87 (diff)
parentd4b8e8135358024b6982100654a430358574efb2 (diff)
downloadCMake-ff4697fc94d74e8c08d165837add668ccb5a5fad.zip
CMake-ff4697fc94d74e8c08d165837add668ccb5a5fad.tar.gz
CMake-ff4697fc94d74e8c08d165837add668ccb5a5fad.tar.bz2
Merge topic 'FindProtobuf-proto-in-subdirs'
d4b8e813 FindProtobuf: fix protobuf_generate_*() to handle proto files in subdirs.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindProtobuf.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 8042073..c90a0a2 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -144,6 +144,10 @@ 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}")
+ endif()
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
@@ -197,6 +201,10 @@ 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}")
+ endif()
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py")
add_custom_command(