aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2018-01-18 19:32:27 +0100
committerGravatar Jan Tattermusch <jtattermusch@google.com>2018-01-18 19:34:20 +0100
commitfb227b0968e668cf9a3b7b6e1e2f5445f29eafb0 (patch)
tree292776fe2f6f2dcf0060c47cdc4c9d4923b3f6cb /cmake
parentdec076c4abe7bd5518abab7a8da4e624c49ec655 (diff)
improve comments on find_package(Protobuf)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/protobuf.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/protobuf.cmake b/cmake/protobuf.cmake
index fccabd455a..cb799b5295 100644
--- a/cmake/protobuf.cmake
+++ b/cmake/protobuf.cmake
@@ -53,6 +53,11 @@ if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module")
endif()
elseif("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "package")
find_package(Protobuf REQUIRED ${gRPC_PROTOBUF_PACKAGE_TYPE})
+
+ # {Protobuf,PROTOBUF}_FOUND is defined based on find_package type ("MODULE" vs "CONFIG").
+ # For "MODULE", the case has also changed between cmake 3.5 and 3.6.
+ # We use the legacy uppercase version for *_LIBRARIES AND *_INCLUDE_DIRS variables
+ # as newer cmake versions provide them too for backward compatibility.
if(Protobuf_FOUND OR PROTOBUF_FOUND)
if(TARGET protobuf::${_gRPC_PROTOBUF_LIBRARY_NAME})
set(_gRPC_PROTOBUF_LIBRARIES protobuf::${_gRPC_PROTOBUF_LIBRARY_NAME})