From d71878cd35219ccc1a1e882de65954f00a95129e Mon Sep 17 00:00:00 2001 From: tytan652 Date: Thu, 4 Aug 2022 21:30:45 +0200 Subject: [PATCH] obs-ffmpeg: Add better error if SRT or RIST libraries are not found --- plugins/obs-ffmpeg/CMakeLists.txt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/plugins/obs-ffmpeg/CMakeLists.txt b/plugins/obs-ffmpeg/CMakeLists.txt index e154c34f2..98b88876d 100644 --- a/plugins/obs-ffmpeg/CMakeLists.txt +++ b/plugins/obs-ffmpeg/CMakeLists.txt @@ -18,8 +18,25 @@ add_library(OBS::ffmpeg ALIAS obs-ffmpeg) add_subdirectory(ffmpeg-mux) if(ENABLE_NEW_MPEGTS_OUTPUT) - find_package(Librist REQUIRED) - find_package(Libsrt REQUIRED) + find_package(Librist QUIET) + find_package(Libsrt QUIET) + + if(NOT TARGET Librist::Librist AND NOT TARGET Libsrt::Libsrt) + obs_status( + FATAL_ERROR + "SRT and RIST libraries not found! Please install SRT and RIST libraries or set ENABLE_NEW_MPEGTS_OUTPUT=OFF." + ) + elseif(NOT TARGET Libsrt::Libsrt) + obs_status( + FATAL_ERROR + "SRT library not found! Please install SRT library or set ENABLE_NEW_MPEGTS_OUTPUT=OFF." + ) + elseif(NOT TARGET Librist::Librist) + obs_status( + FATAL_ERROR + "RIST library not found! Please install RIST library or set ENABLE_NEW_MPEGTS_OUTPUT=OFF." + ) + endif() endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/obs-ffmpeg-config.h.in