@ -53,6 +53,9 @@ set_property(CACHE gRPC_SSL_PROVIDER PROPERTY STRINGS "module" "package")
set ( gRPC_PROTOBUF_PROVIDER "module" CACHE STRING "Provider of protobuf library" )
set_property ( CACHE gRPC_PROTOBUF_PROVIDER PROPERTY STRINGS "module" "package" )
set ( gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package" )
set_property ( CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE" )
set ( gRPC_GFLAGS_PROVIDER "module" CACHE STRING "Provider of gflags library" )
set_property ( CACHE gRPC_GFLAGS_PROVIDER PROPERTY STRINGS "module" "package" )
@ -183,21 +186,27 @@ if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module")
set ( gRPC_INSTALL FALSE )
endif ( )
elseif ( "${gRPC_PROTOBUF_PROVIDER}" STREQUAL "package" )
find_package ( protobuf CONFIG )
if ( protobuf _FOUND)
find_package ( Protobuf ${ gRPC_PROTOBUF_PACKAGE_TYPE } )
if ( Protobuf_FOUND OR PROTOBUF _FOUND)
if ( TARGET protobuf:: ${ _gRPC_PROTOBUF_LIBRARY_NAME } )
set ( _gRPC_PROTOBUF_LIBRARIES protobuf:: ${ _gRPC_PROTOBUF_LIBRARY_NAME } )
else ( )
set ( _gRPC_PROTOBUF_LIBRARIES ${ PROTOBUF_LIBRARIES } )
endif ( )
if ( TARGET protobuf::libprotoc )
set ( _gRPC_PROTOBUF_PROTOC_LIBRARIES protobuf::libprotoc )
else ( )
set ( _gRPC_PROTOBUF_PROTOC_LIBRARIES ${ PROTOBUF_PROTOC_LIBRARIES } )
endif ( )
if ( TARGET protobuf::protoc )
set ( _gRPC_PROTOBUF_PROTOC protobuf::protoc )
else ( )
set ( _gRPC_PROTOBUF_PROTOC ${ PROTOBUF_PROTOC_EXECUTABLE } )
endif ( )
set ( _gRPC_FIND_PROTOBUF "if(NOT protobuf_FOUND)\n find_package(protobuf CONFIG)\nendif()" )
else ( )
find_package ( Protobuf MODULE )
set ( _gRPC_FIND_PROTOBUF "if(NOT Protobuf_FOUND)\n find_package(Protobuf)\nendif()" )
set ( _gRPC_FIND_PROTOBUF "if(NOT Protobuf_FOUND AND NOT PROTOBUF_FOUND)\n find_package(Protobuf ${gRPC_PROTOBUF_PACKAGE_TYPE} )\nendif()" )
endif ( )
if ( PROTOBUF_FOUND )
include_directories ( ${ PROTOBUF_INCLUDE_DIRS } )
endif ( )
set ( PROTOBUF_WELLKNOWN_IMPORT_DIR /usr/local/include )
endif ( )