From 2246db2ace6719b797a17cddc3148ba3171265d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Date: Tue, 10 Jun 2025 14:53:23 +0200 Subject: [PATCH] cmake: Add support for custom protoc executable via OR_TOOLS_PROTOC_EXECUTABLE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow users to specify a custom protoc executable by setting the OR_TOOLS_PROTOC_EXECUTABLE variable, which takes precedence over the default cross-compilation and system protoc detection logic. Signed-off-by: Clément Péron --- cmake/host.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/host.cmake b/cmake/host.cmake index fe303362fe4..f95949cb908 100644 --- a/cmake/host.cmake +++ b/cmake/host.cmake @@ -11,6 +11,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +if (OR_TOOLS_PROTOC_EXECUTABLE) + set(PROTOC_PRG ${OR_TOOLS_PROTOC_EXECUTABLE}) + return() +endif() + if(NOT CMAKE_CROSSCOMPILING) set(PROTOC_PRG protobuf::protoc) return()