diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake index 36f389301b..9fb6f49886 100644 --- a/cmake/opentelemetry-proto.cmake +++ b/cmake/opentelemetry-proto.cmake @@ -84,7 +84,12 @@ foreach(IMPORT_DIR ${PROTOBUF_IMPORT_DIRS}) list(APPEND PROTOBUF_INCLUDE_FLAGS "-I${IMPORT_DIR}") endforeach() -set(gRPC_CPP_PLUGIN_EXECUTABLE $) + +if(CMAKE_CROSSCOMPILING) + find_program(gRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin) +else() + set(gRPC_CPP_PLUGIN_EXECUTABLE $) +endif() add_custom_command( OUTPUT ${COMMON_PB_H_FILE}