From decf1df37a22c87da78230941209c110f7763f4b Mon Sep 17 00:00:00 2001
From: William Breathitt Gray <vilhelm.gray@gmail.com>
Date: Sat, 31 Aug 2019 21:23:23 +0900
Subject: [PATCH] Introduce the BUILD_NONFREE option

This allow users to disable building nonfree components (brightmaps.pk3
and game_support.pk3) if they so desire.
---
 CMakeLists.txt | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e59452..c2f49b2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -393,10 +393,14 @@ add_subdirectory( libraries/lzma )
 add_subdirectory( tools )
 add_subdirectory( libraries/gdtoa )
 add_subdirectory( wadsrc )
-add_subdirectory( wadsrc_bm )
 add_subdirectory( wadsrc_lights )
-add_subdirectory( wadsrc_extra )
 add_subdirectory( src )
+option (BUILD_NONFREE "Build nonfree components" ON)
+if( BUILD_NONFREE )
+       add_subdirectory( wadsrc_bm )
+       add_subdirectory( wadsrc_extra )
+endif()
+
 
 if( NOT CMAKE_CROSSCOMPILING )
 	export(TARGETS ${CROSS_EXPORTS} FILE "${CMAKE_BINARY_DIR}/ImportExecutables.cmake" )
-- 
2.26.2

