From 698c462430e0dfeb5a00a95cbdbf7ded81a14e21 Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Sun, 10 Nov 2024 11:34:43 -0700 Subject: [PATCH] fix: Pull in upstream nanopb fix for protoc locating. --- modules/nanopb/nanopb.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/nanopb/nanopb.cmake b/modules/nanopb/nanopb.cmake index ddcdb5f61d195c..d42e67e673bc5f 100644 --- a/modules/nanopb/nanopb.cmake +++ b/modules/nanopb/nanopb.cmake @@ -6,10 +6,13 @@ include_guard(GLOBAL) list(APPEND CMAKE_MODULE_PATH ${ZEPHYR_NANOPB_MODULE_DIR}/extra) -find_program(PROTOC protoc) -if(NOT PROTOC) +find_package(Nanopb REQUIRED) + +if(NOT PROTOBUF_PROTOC_EXECUTABLE) message(FATAL_ERROR "'protoc' not found, please ensure protoc is installed\ and in path. See https://docs.zephyrproject.org/latest/samples/modules/nanopb/README.html") +else() + message(STATUS "Found protoc: ${PROTOBUF_PROTOC_EXECUTABLE}") endif() find_package(Nanopb REQUIRED)