提交 a2f5c323 编写于 作者: K Kurt Kartaltepe

obs-filters: Cleanup CMake

This file has become a mess of people hacking in fixes so this cleans it
up to make sense again.
上级 f319b966
...@@ -3,49 +3,36 @@ project(obs-filters) ...@@ -3,49 +3,36 @@ project(obs-filters)
option(DISABLE_SPEEXDSP "Disable building of the SpeexDSP-based Noise Suppression filter" OFF) option(DISABLE_SPEEXDSP "Disable building of the SpeexDSP-based Noise Suppression filter" OFF)
option(DISABLE_RNNOISE "Disable building of the RNNoise-based Noise Suppression filter" OFF) option(DISABLE_RNNOISE "Disable building of the RNNoise-based Noise Suppression filter" OFF)
if(DISABLE_SPEEXDSP AND DISABLE_RNNOISE) if(DISABLE_SPEEXDSP)
message(STATUS "SpeexDSP and RNNoise support disabled") message(STATUS "SpeexDSP support disabled")
set(NOISEREDUCTION_ENABLED FALSE) set(LIBSPEEXDSP_FOUND FALSE)
else() else()
if(DISABLE_SPEEXDSP) find_package(Libspeexdsp)
message(STATUS "SpeexDSP support disabled") if(LIBSPEEXDSP_FOUND)
set(LIBSPEEXDSP_FOUND FALSE) add_definitions(-DLIBSPEEXDSP_ENABLED)
else()
find_package(Libspeexdsp QUIET)
if(NOT LIBSPEEXDSP_FOUND)
message(STATUS "SpeexDSP support not found")
set(LIBSPEEXDSP_FOUND FALSE)
else()
message(STATUS "SpeexDSP supported")
add_definitions(-DLIBSPEEXDSP_ENABLED)
endif()
endif() endif()
endif()
if(DISABLE_RNNOISE) if(DISABLE_RNNOISE)
message(STATUS "RNNoise support disabled") message(STATUS "RNNoise support disabled")
set(LIBRNNOISE_FOUND FALSE) set(LIBRNNOISE_FOUND FALSE)
else() else()
find_package(Librnnoise QUIET) find_package(Librnnoise)
if(NOT LIBRNNOISE_FOUND) if(LIBRNNOISE_FOUND)
message(STATUS "RNNoise support not found") add_definitions(-DLIBRNNOISE_ENABLED)
set(LIBRNNOISE_FOUND FALSE)
else()
message(STATUS "RNNoise supported")
add_definitions(-DLIBRNNOISE_ENABLED)
endif()
endif() endif()
if(LIBSPEEXDSP_FOUND OR LIBRNNOISE_FOUND) endif()
message(STATUS "Noise Reduction effect enabled")
set(obs-filters_NOISEREDUCTION_SOURCES if(LIBSPEEXDSP_FOUND OR LIBRNNOISE_FOUND)
noise-suppress-filter.c) message(STATUS "Noise Reduction effect enabled")
set(obs-filters_NOISEREDUCTION_LIBRARIES set(obs-filters_NOISEREDUCTION_SOURCES
${LIBSPEEXDSP_LIBRARIES} ${LIBRNNOISE_LIBRARIES}) noise-suppress-filter.c)
set(NOISEREDUCTION_ENABLED TRUE) set(obs-filters_NOISEREDUCTION_LIBRARIES
else() ${LIBSPEEXDSP_LIBRARIES} ${LIBRNNOISE_LIBRARIES})
set(NOISEREDUCTION_ENABLED FALSE) set(NOISEREDUCTION_ENABLED TRUE)
endif() else()
set(NOISEREDUCTION_ENABLED FALSE)
endif() endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/obs-filters-config.h.in" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/obs-filters-config.h.in"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册