diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f7102d3cc..646cd86dcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -580,6 +580,9 @@ function(protobuf_generate_grpc_cpp_with_import_path_correction FILE_LOCATION IM message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files") return() endif() + if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${FILE_LOCATION}") + return() + endif() # Sets the include path for ProtoBuf files set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR})