summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-01-25 16:14:38 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-01-25 16:14:38 (GMT)
commitc6a33dce36598b224a6e44485275022356c9ccfd (patch)
treee37d548dfd40a81adc94022e9066cc77c0e995d3
parent31c53c288c3644cc357684124e566baf9a07a1a1 (diff)
parent27bc9e2631a2f7b6d78064f5adf0b528982a2de7 (diff)
downloadCMake-c6a33dce36598b224a6e44485275022356c9ccfd.zip
CMake-c6a33dce36598b224a6e44485275022356c9ccfd.tar.gz
CMake-c6a33dce36598b224a6e44485275022356c9ccfd.tar.bz2
Merge topic 'FindProtobuf_import_dirs'
27bc9e2 FindProtobuf: Update documentation comment for 2.8.8 84079c9 FindProtobuf: Merge patch that allows extra import dirs
-rw-r--r--Modules/FindProtobuf.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 5344304..1e1e493 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -7,6 +7,9 @@
# (vsprojects/Debug & vsprojects/Release) will be searched
# for libraries and binaries.
#
+# PROTOBUF_IMPORT_DIRS - List of additional directories to be searched for
+# imported .proto files. (New in CMake 2.8.8)
+#
# Defines the following variables:
#
# PROTOBUF_FOUND - Found the Google Protocol Buffers library (libprotobuf & header files)
@@ -91,6 +94,16 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif()
+ if(DEFINED PROTOBUF_IMPORT_DIRS)
+ foreach(DIR ${PROTOBUF_IMPORT_DIRS})
+ get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
+ list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
+ if(${_contains_already} EQUAL -1)
+ list(APPEND _protobuf_include_path -I ${ABS_PATH})
+ endif()
+ endforeach()
+ endif()
+
set(${SRCS})
set(${HDRS})
foreach(FIL ${ARGN})