Browse Source

obs-filters: Use less automagic for SpeexDSP detection

This adds a build-time option for disabling the SpeexDSP-based
Noise Suppression filter support in cases where users do not
wish to build it, but have the required library installed.
Jimi Huotari 7 years ago
parent
commit
79006adaf2
1 changed files with 17 additions and 7 deletions
  1. 17 7
      plugins/obs-filters/CMakeLists.txt

+ 17 - 7
plugins/obs-filters/CMakeLists.txt

@@ -1,13 +1,23 @@
 project(obs-filters)
 
-find_package(Libspeexdsp QUIET)
-if(LIBSPEEXDSP_FOUND)
-	set(obs-filters_LIBSPEEXDSP_SOURCES
-		noise-suppress-filter.c)
-	set(obs-filters_LIBSPEEXDSP_LIBRARIES
-		${LIBSPEEXDSP_LIBRARIES})
+option(DISABLE_SPEEXDSP "Disable building of the SpeexDSP-based Noise Suppression filter" OFF)
+
+if(DISABLE_SPEEXDSP)
+	message(STATUS "SpeexDSP support disabled")
+	set(LIBSPEEXDSP_FOUND FALSE)
 else()
-	message(STATUS "Speexdsp library not found, speexdsp filters disabled")
+	find_package(Libspeexdsp QUIET)
+
+	if(NOT LIBSPEEXDSP_FOUND)
+		message(STATUS "SpeexDSP support not found")
+		set(LIBSPEEXDSP_FOUND FALSE)
+	else()
+		message(STATUS "SpeexDSP supported")
+		set(obs-filters_LIBSPEEXDSP_SOURCES
+			noise-suppress-filter.c)
+		set(obs-filters_LIBSPEEXDSP_LIBRARIES
+			${LIBSPEEXDSP_LIBRARIES})
+	endif()
 endif()
 
 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/obs-filters-config.h.in"