summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-10-10 14:23:21 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-10-10 14:23:21 (GMT)
commitce002921344cceb42801d088ab82fcf8f21964da (patch)
tree2e8677e2ed16203abd8d264c15c1ed6a874ff614 /Modules
parente3c5aed6ae1b0dcdde51f5baea7f150395d21d9f (diff)
parent2b9dad694a43d850af5fe83dd327fc82db29a012 (diff)
downloadCMake-ce002921344cceb42801d088ab82fcf8f21964da.zip
CMake-ce002921344cceb42801d088ab82fcf8f21964da.tar.gz
CMake-ce002921344cceb42801d088ab82fcf8f21964da.tar.bz2
Merge topic 'FindProtobuf-fix-subdirs'
2b9dad69 FindProtobuf: Fix protobuf_generate_*() to handle subdirs
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindProtobuf.cmake16
1 files changed, 10 insertions, 6 deletions
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")