--- CMakeLists.txt.orig	2013-09-23 16:15:52.000000000 +0400
+++ CMakeLists.txt	2014-08-20 17:37:42.000000000 +0400
@@ -351,51 +351,81 @@
 		message("OpenMP parallelization disabled")
 	endif()
 
-	include(FindALSA OPTIONAL)
-	if(ALSA_FOUND)
-		add_definitions(-DHAVE_ALSA=1)
-		message("ALSA found, enabling ALSA sound backend")
+	option(DISABLE_ALSA "Disable ALSA sound backend" OFF)
+	if(NOT DISABLE_ALSA)
+		include(FindALSA OPTIONAL)
+		if(ALSA_FOUND)
+			add_definitions(-DHAVE_ALSA=1)
+			message("ALSA found, enabling ALSA sound backend")
+		else()
+			add_definitions(-DHAVE_ALSA=0)
+			message("ALSA NOT found, disabling ALSA sound backend")
+		endif(ALSA_FOUND)
 	else()
 		add_definitions(-DHAVE_ALSA=0)
-		message("ALSA NOT found, disabling ALSA sound backend")
-	endif(ALSA_FOUND)
+		message("ALSA sound backend disabled")
+	endif()
 
-	check_lib(AO ao QUIET)
-	if(AO_FOUND)
-		add_definitions(-DHAVE_AO=1)
-		message("ao found, enabling ao sound backend")
+	option(DISABLE_AO "Disable ao sound backend" OFF)
+	if(NOT DISABLE_AO)
+		check_lib(AO ao QUIET)
+		if(AO_FOUND)
+			add_definitions(-DHAVE_AO=1)
+			message("ao found, enabling ao sound backend")
+		else()
+			add_definitions(-DHAVE_AO=0)
+			message("ao NOT found, disabling ao sound backend")
+		endif(AO_FOUND)
 	else()
 		add_definitions(-DHAVE_AO=0)
-		message("ao NOT found, disabling ao sound backend")
-	endif(AO_FOUND)
+		message("ao sound backend disabled")
+	endif()
 
-	check_lib(BLUEZ bluez QUIET)
-	if(BLUEZ_FOUND)
-		add_definitions(-DHAVE_BLUEZ=1)
-		message("bluez found, enabling bluetooth support")
+	option(DISABLE_BLUEZ "Disable bluez (bluetooth) support" OFF)
+	if(NOT DISABLE_BLUEZ)
+		check_lib(BLUEZ bluez QUIET)
+		if(BLUEZ_FOUND)
+			add_definitions(-DHAVE_BLUEZ=1)
+			message("bluez found, enabling bluetooth support")
+		else()
+			add_definitions(-DHAVE_BLUEZ=0)
+			message("bluez NOT found, disabling bluetooth support")
+		endif(BLUEZ_FOUND)
 	else()
 		add_definitions(-DHAVE_BLUEZ=0)
-		message("bluez NOT found, disabling bluetooth support")
-	endif(BLUEZ_FOUND)
+		message("bluez (bluetooth) support disabled")
+	endif()
 
-	check_lib(PULSEAUDIO libpulse-simple QUIET)
-	if(PULSEAUDIO_FOUND)
-		add_definitions(-DHAVE_PULSEAUDIO=1)
-		message("PulseAudio found, enabling PulseAudio sound backend")
+	option(DISABLE_PULSEAUDIO "Disable PulseAudio sound backend" OFF)
+	if(NOT DISABLE_PULSEAUDIO)
+		check_lib(PULSEAUDIO libpulse-simple QUIET)
+		if(PULSEAUDIO_FOUND)
+			add_definitions(-DHAVE_PULSEAUDIO=1)
+			message("PulseAudio found, enabling PulseAudio sound backend")
+		else()
+			add_definitions(-DHAVE_PULSEAUDIO=0)
+			message("PulseAudio NOT found, disabling PulseAudio sound backend")
+		endif(PULSEAUDIO_FOUND)
 	else()
 		add_definitions(-DHAVE_PULSEAUDIO=0)
-		message("PulseAudio NOT found, disabling PulseAudio sound backend")
-	endif(PULSEAUDIO_FOUND)
+		message("PulseAudio sound backend disabled")
+	endif()
 
-	include(FindOpenAL OPTIONAL)
-	if(OPENAL_FOUND)
-		add_definitions(-DHAVE_OPENAL=1)
-		include_directories(${OPENAL_INCLUDE_DIR})
-		message("OpenAL found, enabling OpenAL sound backend")
+	option(DISABLE_OPENAL "Disable OpenAL sound backend" OFF)
+	if(NOT DISABLE_OPENAL)
+		include(FindOpenAL OPTIONAL)
+		if(OPENAL_FOUND)
+			add_definitions(-DHAVE_OPENAL=1)
+			include_directories(${OPENAL_INCLUDE_DIR})
+			message("OpenAL found, enabling OpenAL sound backend")
+		else()
+			add_definitions(-DHAVE_OPENAL=0)
+			message("OpenAL NOT found, disabling OpenAL sound backend")
+		endif(OPENAL_FOUND)
 	else()
 		add_definitions(-DHAVE_OPENAL=0)
-		message("OpenAL NOT found, disabling OpenAL sound backend")
-	endif(OPENAL_FOUND)
+		message("OpenAL sound backend disabled")
+	endif()
 
 	if(UNIX AND NOT APPLE)
 		# Note: The convention is to check USE_X11 or USE_WAYLAND where needed.
@@ -577,14 +618,14 @@
 set(SFML_FIND_VERSION_MAJOR 1)
 set(SFML_FIND_VERSION_MINOR 5)
 if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
-	include(FindSFML OPTIONAL)
+	#include(FindSFML OPTIONAL)
 endif()
 if(SFML_FOUND AND NOT SFML_VERSION_MAJOR) # SFML 1.x doesn't define SFML_VERSION_MAJOR
 	message("Using shared SFML")
 else()
 	message("Using static SFML ${SFML_FIND_VERSION_MAJOR}.${SFML_FIND_VERSION_MINOR} from Externals")
 	add_subdirectory(Externals/SFML)
-	include_directories(Externals/SFML/include)
+	include_directories(BEFORE Externals/SFML/include)
 endif()
 
 if(USE_UPNP)
