← Back to team overview

kicad-developers team mailing list archive

[PATCH v2] Add KICAD_INSTALL_DEMOS CMake option

 

It is ON by default, determines wether to install the bundled demos
and examples.
---

This version has the required documentation changes.

---
 CMakeLists.txt                         | 6 ++++++
 Documentation/development/compiling.md | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bfeaac5..9fba017 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,6 +49,10 @@ option( KICAD_USE_OCE
     "Build tools and plugins related to OpenCascade Community Edition (default OFF)"
     )
 
+option( KICAD_INSTALL_DEMOS
+    "Install kicad demos and examples (default ON)"
+    ON )
+
 # when option KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES is enabled:
 # PYTHON_EXECUTABLE can be defined when invoking cmake
 # ( use -DPYTHON_EXECUTABLE=<python path>/python.exe or python2 )
@@ -806,5 +810,7 @@ add_subdirectory( utils )
 add_subdirectory( qa )
 
 # Resources
+if ( KICAD_INSTALL_DEMOS )
 add_subdirectory( demos )
+endif ( KICAD_INSTALL_DEMOS )
 add_subdirectory( template )
diff --git a/Documentation/development/compiling.md b/Documentation/development/compiling.md
index ac4824e..603ebfc 100644
--- a/Documentation/development/compiling.md
+++ b/Documentation/development/compiling.md
@@ -166,6 +166,13 @@ and plugins related to OpenCascade Community Edition (OCE) are enabled with this
 enabled it requires [OCE][] to be available, and the location of the installed OCE libary to be
 passed via the OCE_DIR flag. This option is disabled by default.
 
+## Demos and Examples ## {#demo_install_opt}
+
+The KiCad source code includes some demos and examples to showcase the program. You can choose
+whether install them or not with the KICAD_INSTALL_DEMOS option. You can also select where to
+install them with the KICAD_DEMOS variable. On Linux the demos are installed in
+$PREFIX/share/kicad/demos by default.
+
 # Getting the KiCad Source Code ## {#getting_src}
 
 There are several ways to get the KiCad source.  If you want to build the stable version you

Follow ups

References