Merge branch 'FindProtobuf-fix-subdirs' into release

This commit is contained in:
Brad King 2016-10-07 10:16:33 -04:00
commit a033f86712
1 changed files with 10 additions and 6 deletions

View File

@ -136,10 +136,12 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
foreach(FIL ${ARGN}) foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE) get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE) get_filename_component(FIL_WE ${FIL} NAME_WE)
if(NOT PROTOBUF_GENERATE_CPP_APPEND_PATH)
get_filename_component(FIL_DIR ${FIL} DIRECTORY) get_filename_component(FIL_DIR ${FIL} DIRECTORY)
if(FIL_DIR) if(FIL_DIR)
set(FIL_WE "${FIL_DIR}/${FIL_WE}") set(FIL_WE "${FIL_DIR}/${FIL_WE}")
endif() endif()
endif()
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc") list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h") list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
@ -197,10 +199,12 @@ function(PROTOBUF_GENERATE_PYTHON SRCS)
foreach(FIL ${ARGN}) foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE) get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE) get_filename_component(FIL_WE ${FIL} NAME_WE)
if(NOT PROTOBUF_GENERATE_CPP_APPEND_PATH)
get_filename_component(FIL_DIR ${FIL} DIRECTORY) get_filename_component(FIL_DIR ${FIL} DIRECTORY)
if(FIL_DIR) if(FIL_DIR)
set(FIL_WE "${FIL_DIR}/${FIL_WE}") set(FIL_WE "${FIL_DIR}/${FIL_WE}")
endif() endif()
endif()
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py") list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py")
add_custom_command( add_custom_command(