Fix _gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR NOT-FOUND

pull/37627/head
Esun Kim 6 months ago
parent f6c57b6384
commit f4d9a27854
  1. 5
      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)

Loading…
Cancel
Save