From f4d9a27854023c3fc1eaaf1b5a3762b0e22cafe3 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Fri, 6 Sep 2024 11:13:32 -0700 Subject: [PATCH] Fix _gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR NOT-FOUND --- cmake/protobuf.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/protobuf.cmake b/cmake/protobuf.cmake index fab2eb00e96..09c75148c05 100644 --- a/cmake/protobuf.cmake +++ b/cmake/protobuf.cmake @@ -65,12 +65,11 @@ elseif(gRPC_PROTOBUF_PROVIDER STREQUAL "package") endif() if(TARGET protobuf::libprotoc) set(_gRPC_PROTOBUF_PROTOC_LIBRARIES protobuf::libprotoc) - # extract the include dir from target's properties - get_target_property(_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR protobuf::libprotoc INTERFACE_INCLUDE_DIRECTORIES) else() set(_gRPC_PROTOBUF_PROTOC_LIBRARIES ${PROTOBUF_PROTOC_LIBRARIES}) - set(_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR ${PROTOBUF_INCLUDE_DIRS}) endif() + # Well-known proto files are expected to be in the Protobuf include directory. + get_target_property(_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR _gRPC_PROTOBUF_LIBRARIES INTERFACE_INCLUDE_DIRECTORIES) if(TARGET protobuf::protoc) set(_gRPC_PROTOBUF_PROTOC protobuf::protoc) if(CMAKE_CROSSCOMPILING)