cmake_minimum_required(VERSION 3.22...3.25) legacy_check() option(ENABLE_FFMPEG_LOGGING "Enables obs-ffmpeg logging" OFF) option(ENABLE_NEW_MPEGTS_OUTPUT "Use native SRT/RIST mpegts output" ON) include(cmake/dependencies.cmake) add_library(obs-ffmpeg MODULE) add_library(OBS::ffmpeg ALIAS obs-ffmpeg) add_subdirectory(ffmpeg-mux) target_sources( obs-ffmpeg PRIVATE # cmake-format: sortable $<$:obs-ffmpeg-logging.c> $<$:obs-ffmpeg-mpegts.c> $<$:obs-ffmpeg-rist.h> $<$:obs-ffmpeg-srt.h> $<$:obs-ffmpeg-url.h> $<$:obs-ffmpeg-vaapi.c> $<$:vaapi-utils.c> $<$:vaapi-utils.h> $<$:obs-nvenc-helpers.c> $<$:obs-nvenc.c> $<$:obs-nvenc.h> $<$:texture-amf-opts.hpp> $<$:texture-amf.cpp> obs-ffmpeg-audio-encoders.c obs-ffmpeg-av1.c obs-ffmpeg-compat.h obs-ffmpeg-formats.h obs-ffmpeg-hls-mux.c obs-ffmpeg-mux.c obs-ffmpeg-mux.h obs-ffmpeg-nvenc.c obs-ffmpeg-output.c obs-ffmpeg-output.h obs-ffmpeg-source.c obs-ffmpeg-video-encoders.c obs-ffmpeg.c) target_compile_options(obs-ffmpeg PRIVATE $<$:-Wno-shorten-64-to-32>) target_compile_definitions(obs-ffmpeg PRIVATE $<$:ENABLE_FFMPEG_LOGGING> $<$:NEW_MPEGTS_OUTPUT>) target_link_libraries( obs-ffmpeg PRIVATE OBS::libobs OBS::media-playback OBS::opts-parser FFmpeg::avcodec FFmpeg::avfilter FFmpeg::avformat FFmpeg::avdevice FFmpeg::avutil FFmpeg::swscale FFmpeg::swresample $<$:OBS::obs-nvenc-version> $<$:OBS::w32-pthreads> $<$:AMF::AMF> $<$:FFnvcodec::FFnvcodec> $<$:ws2_32> $<$:Libva::va> $<$:Libva::drm> $<$:Libpci::pci> $<$:Librist::Librist> $<$:Libsrt::Libsrt>) if(OS_WINDOWS) configure_file(cmake/windows/obs-module.rc.in obs-ffmpeg.rc) target_sources(obs-ffmpeg PRIVATE obs-ffmpeg.rc) endif() # cmake-format: off set_target_properties_obs(obs-ffmpeg PROPERTIES FOLDER plugins/obs-ffmpeg PREFIX "") # cmake-format: on