diff options
author | Vladimír Vondruš <mosra@centrum.cz> | 2016-06-09 13:53:17 (GMT) |
---|---|---|
committer | Vladimír Vondruš <mosra@centrum.cz> | 2016-06-09 14:13:45 (GMT) |
commit | d4b8e8135358024b6982100654a430358574efb2 (patch) | |
tree | 4eafb2a842e649f635caaa67c202c90f1c4247d4 /Modules/FindProtobuf.cmake | |
parent | 39699947589e96b59d7f56d9c0b1dcb1bef27f8a (diff) | |
download | CMake-d4b8e8135358024b6982100654a430358574efb2.zip CMake-d4b8e8135358024b6982100654a430358574efb2.tar.gz CMake-d4b8e8135358024b6982100654a430358574efb2.tar.bz2 |
FindProtobuf: fix protobuf_generate_*() to handle proto files in subdirs.
Diffstat (limited to 'Modules/FindProtobuf.cmake')
-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( |