diff options
author | Brad King <brad.king@kitware.com> | 2016-06-10 13:10:02 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-06-10 13:10:02 (GMT) |
commit | ff4697fc94d74e8c08d165837add668ccb5a5fad (patch) | |
tree | 3a8d98a4e711fe589b8369663220e28fbe99f86f /Modules | |
parent | fbf461dde26aca7bb4b44d0f25e459ea30e3aa87 (diff) | |
parent | d4b8e8135358024b6982100654a430358574efb2 (diff) | |
download | CMake-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.cmake | 8 |
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( |