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.
This commit is contained in:
Jimi Huotari
2018-07-11 02:08:51 +03:00
parent eee6541153
commit 79006adaf2

View File

@@ -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"