cmake_minimum_required(VERSION 3.22...3.25)

legacy_check()

add_library(obs-filters MODULE)
add_library(OBS::filters ALIAS obs-filters)

target_sources(
  obs-filters
  PRIVATE # cmake-format: sortable
          async-delay-filter.c
          chroma-key-filter.c
          color-correction-filter.c
          color-grade-filter.c
          color-key-filter.c
          compressor-filter.c
          crop-filter.c
          eq-filter.c
          expander-filter.c
          gain-filter.c
          gpu-delay.c
          hdr-tonemap-filter.c
          invert-audio-polarity.c
          limiter-filter.c
          luma-key-filter.c
          mask-filter.c
          noise-gate-filter.c
          obs-filters.c
          scale-filter.c
          scroll-filter.c
          sharpness-filter.c)

target_link_libraries(obs-filters PRIVATE OBS::libobs $<$<PLATFORM_ID:Windows>:OBS::w32-pthreads>)

include(cmake/speexdsp.cmake)
include(cmake/rnnoise.cmake)

if(OS_WINDOWS)
  include(cmake/nvidia.cmake)

  configure_file(cmake/windows/obs-module.rc.in obs-filters.rc)
  target_sources(obs-filters PRIVATE obs-filters.rc)
endif()

# cmake-format: off
set_target_properties_obs(obs-filters PROPERTIES FOLDER plugins PREFIX "")
# cmake-format: on
