CMake: Search specifically for the ffmpeg components we need

And fix the not-found logic.
This commit is contained in:
Stenzek 2023-01-02 01:49:02 +10:00 committed by refractionpcsx2
parent f3e7491c3a
commit 336ef58f61
1 changed files with 2 additions and 2 deletions

View File

@ -35,8 +35,8 @@ else()
# Use bundled ffmpeg v4.x.x headers if we can't locate it in the system.
# We'll try to load it dynamically at runtime.
find_package(FFMPEG)
if(NOT FFMPEG_VERSION)
find_package(FFMPEG COMPONENTS avcodec avformat avutil swresample swscale)
if(NOT FFMPEG_FOUND)
message(WARNING "FFmpeg not found, using bundled headers.")
set(FFMPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/3rdparty/ffmpeg/include")
endif()