From a8972f54c4bfd8416f278c66c97240d6fe2af4d7 Mon Sep 17 00:00:00 2001
From: Marek Roszko <mark.roszko@gmail.com>
Date: Tue, 23 Apr 2024 22:42:52 -0400
Subject: [PATCH] Put idf tools behind a cmake flag that can be turned off

---
 CMakeLists.txt       | 4 ++++
 utils/CMakeLists.txt | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b4657d01a0..a8e28a2300 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -262,6 +262,10 @@ option( KICAD_IPC_API
     "Enable experimental IPC API"
     OFF )
 
+option( KICAD_IDF_TOOLS
+    "Build additional idf tools"
+    ON )
+
 # Global setting: exports are explicit
 set( CMAKE_CXX_VISIBILITY_PRESET "hidden" )
 set( CMAKE_VISIBILITY_INLINES_HIDDEN ON )
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index ac8962c804..9e5be99626 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -4,4 +4,6 @@ if( COMPILER_SUPPORTS_WARNINGS )
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARN_FLAGS_C}")
 endif()
 
-add_subdirectory( idftools )
+if( KICAD_IDF_TOOLS )
+    add_subdirectory( idftools )
+endif()
\ No newline at end of file