aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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})