$OpenBSD: patch-CMakeLists_txt,v 1.3 2018/02/11 13:25:38 fcambus Exp $

Make PortAudio and CAPSImage detection conditional and disabled by default,
and disable building the Python GTK+2 user interface.

Index: CMakeLists.txt
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -34,6 +34,12 @@ set(ENABLE_SMALL_MEM 0
     CACHE BOOL "Enable to use less memory - at the expense of emulation speed")
 set(ENABLE_WINUAE_CPU 1
     CACHE BOOL "Enable WinUAE CPU core")
+set(ENABLE_PORTAUDIO 0
+    CACHE BOOL "Enable building with PortAudio to enable microphone input in Falcon mode")
+set(ENABLE_CAPSIMAGE 0
+    CACHE BOOL "Enable building with CAPSImage for using .IPF, .RAW and .CTR disk images")
+set(ENABLE_UI 0
+    CACHE BOOL "Enable building the Python GTK+2 user interface, requires GTK+2 bindings")
 
 # Run-time checks with GCC "mudflap" etc features:
 # - stack protection
@@ -121,20 +127,24 @@ if (NOT ENABLE_OSX_BUNDLE)
 	endif(X11_FOUND)
 endif()
 
-find_package(PortAudio)
-if(PORTAUDIO_FOUND)
-	set(HAVE_PORTAUDIO 1)
-endif(PORTAUDIO_FOUND)
+if(ENABLE_PORTAUDIO)
+	find_package(PortAudio)
+	if(PORTAUDIO_FOUND)
+		set(HAVE_PORTAUDIO 1)
+	endif(PORTAUDIO_FOUND)
+endif(ENABLE_PORTAUDIO)
 
 find_package(PortMidi)
 if(PORTMIDI_FOUND)
 	set(HAVE_PORTMIDI 1)
 endif(PORTMIDI_FOUND)
 
-find_package(CapsImage)
-if(CAPSIMAGE_FOUND)
-	set(HAVE_CAPSIMAGE 1)
-endif(CAPSIMAGE_FOUND)
+if(ENABLE_CAPSIMAGE)
+	find_package(CapsImage)
+	if(CAPSIMAGE_FOUND)
+		set(HAVE_CAPSIMAGE 1)
+	endif(CAPSIMAGE_FOUND)
+endif(ENABLE_CAPSIMAGE)
 
 find_package(Udev)
 if(UDEV_FOUND)
@@ -301,10 +311,12 @@ add_subdirectory(src)
 add_subdirectory(doc)
 add_subdirectory(tools)
 
-include(FindPythonInterp)
-if(PYTHONINTERP_FOUND)
-	add_subdirectory(python-ui)
-endif(PYTHONINTERP_FOUND)
+if(ENABLE_UI)
+	include(FindPythonInterp)
+	if(PYTHONINTERP_FOUND)
+		add_subdirectory(python-ui)
+	endif(PYTHONINTERP_FOUND)
+endif(ENABLE_UI)
 
 if(UNIX AND NOT ENABLE_OSX_BUNDLE)
 	add_subdirectory(share)
@@ -351,11 +363,13 @@ else()
   message( "  - png :\tnot found, install it to compress screenshot/avi files using png" )
 endif(PNG_FOUND)
 
-if(PORTAUDIO_FOUND)
-  message( "  - portaudio :\tfound, enables the microphone input in Falcon mode" )
-else()
-  message( "  - portaudio :\tnot found, install it to enable the Falcon microphone input" )
-endif(PORTAUDIO_FOUND)
+if(ENABLE_PORTAUDIO)
+  if(PORTAUDIO_FOUND)
+    message( "  - portaudio :\tfound, enables the microphone input in Falcon mode" )
+  else()
+    message( "  - portaudio :\tnot found, install it to enable the Falcon microphone input" )
+  endif(PORTAUDIO_FOUND)
+endif(ENABLE_PORTAUDIO)
 
 if(PORTMIDI_FOUND)
   message( "  - portmidi :\tfound, required for (non-Linux) MIDI support" )
@@ -363,11 +377,13 @@ else()
   message( "  - portmidi :\tnot found, install it for MIDI support on Windows / OSX" )
 endif(PORTMIDI_FOUND)
 
-if(CAPSIMAGE_FOUND)
-  message( "  - capsimage :\tv${CAPSIMAGE_VERSION} found, allow to use .IPF, .RAW and .CTR disk images" )
-else()
-  message( "  - capsimage :\tv${CAPSIMAGE_VERSION} not found, install it to use .IPF, .RAW and .CTR disk images" )
-endif(CAPSIMAGE_FOUND)
+if(ENABLE_CAPSIMAGE)
+  if(CAPSIMAGE_FOUND)
+    message( "  - capsimage :\tv${CAPSIMAGE_VERSION} found, allow to use .IPF, .RAW and .CTR disk images" )
+  else()
+    message( "  - capsimage :\tv${CAPSIMAGE_VERSION} not found, install it to use .IPF, .RAW and .CTR disk images" )
+  endif(CAPSIMAGE_FOUND)
+endif(ENABLE_CAPSIMAGE)
 
 if(UDEV_FOUND)
   message( "  - udev :\tfound, required for media change detection in NatFeats SCSI" )
