diff --git a/SerialPrograms/CMakeLists.txt b/SerialPrograms/CMakeLists.txt index edbacc028c..84e30d8486 100644 --- a/SerialPrograms/CMakeLists.txt +++ b/SerialPrograms/CMakeLists.txt @@ -821,5 +821,11 @@ if (QT_MAJOR GREATER_EQUAL 6) qt_finalize_target(SerialPrograms) endif() -# Add command-line executable (GUI-free) from subdirectory -include(Source/CommandLine/CommandLineExecutable.cmake) + +# Define a toggle option (ON by default) +option(COMMAND_LINE_EXE "Build the optional executable" ON) + +if(COMMAND_LINE_EXE) + # Add command-line executable (GUI-free) from subdirectory + include(Source/CommandLine/CommandLineExecutable.cmake) +endif()