[Build] fix `gRPCConfig.cmake` (#33361)

Without this change, calling `find_package(gRPC REQUIRED)` errors out
with

CMake Error at /opt/homebrew/lib/cmake/grpc/gRPCConfig.cmake:8
(find_dependency):
      Unknown CMake command "find_dependency".

The issue is that `find_dependency` is provided by the
`CMakeFindDependencyMacro` module[^1], so we need to `include` it before
use.

[^1]:
https://cmake.org/cmake/help/v3.26/module/CMakeFindDependencyMacro.html
pull/34221/head
Carlo Cabrera 1 year ago committed by GitHub
parent b7e680ad46
commit 5c9e4050c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmake/protobuf.cmake

@ -86,6 +86,6 @@ elseif(gRPC_PROTOBUF_PROVIDER STREQUAL "package")
set(_gRPC_PROTOBUF_PROTOC_EXECUTABLE ${PROTOBUF_PROTOC_EXECUTABLE})
endif()
endif()
set(_gRPC_FIND_PROTOBUF "find_dependency(Protobuf CONFIG)")
set(_gRPC_FIND_PROTOBUF "include(CMakeFindDependencyMacro)\nfind_dependency(Protobuf CONFIG)")
endif()
endif()

Loading…
Cancel
Save