The grpc_cpp_plugin may failed to be found

Signed-off-by: Tao He <sighingnow@gmail.com>
This commit is contained in:
Tao He 2023-04-20 19:40:52 +08:00
parent 6e4b45f986
commit 88012f4f2b
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ if(Protobuf_PROTOC_EXECUTABLE)
endif() endif()
find_package(gRPC QUIET) find_package(gRPC QUIET)
if(gRPC_FOUND) if(gRPC_FOUND AND TARGET gRPC::grpc AND TARGET gRPC::grpc_cpp_plugin)
set(GRPC_LIBRARIES gRPC::gpr gRPC::grpc gRPC::grpc++) set(GRPC_LIBRARIES gRPC::gpr gRPC::grpc gRPC::grpc++)
get_target_property(GRPC_CPP_PLUGIN gRPC::grpc_cpp_plugin LOCATION) get_target_property(GRPC_CPP_PLUGIN gRPC::grpc_cpp_plugin LOCATION)
get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES)