From fb227b0968e668cf9a3b7b6e1e2f5445f29eafb0 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 18 Jan 2018 19:32:27 +0100 Subject: improve comments on find_package(Protobuf) --- cmake/protobuf.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmake') 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}) -- cgit v1.2.3