summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar lat9nq2022-12-01 00:49:58 -0500
committerGravatar lat9nq2022-12-01 00:49:58 -0500
commit5ff19890e9d2a07d1c0246f3807cdefcb36aca7d (patch)
treea2b9a1a13deb277c2847e069dd6e56d81b747df2
parentMerge pull request #9366 from zhaobot/tx-update-20221201025957 (diff)
downloadyuzu-5ff19890e9d2a07d1c0246f3807cdefcb36aca7d.tar.gz
yuzu-5ff19890e9d2a07d1c0246f3807cdefcb36aca7d.tar.xz
yuzu-5ff19890e9d2a07d1c0246f3807cdefcb36aca7d.zip
CMake: Fix FFmpeg find module
Uses find_package_handle_standard_args to handle the find_package call from the root CMakeLists. Removes all the unnecessary logic after the find_package and just sets it to REQUIRED.
-rw-r--r--CMakeLists.txt17
-rw-r--r--externals/find-modules/FindFFmpeg.cmake8
2 files changed, 9 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05bffe68e..b2fbe8806 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -458,22 +458,7 @@ if (UNIX AND NOT APPLE)
458endif() 458endif()
459if (NOT YUZU_USE_BUNDLED_FFMPEG) 459if (NOT YUZU_USE_BUNDLED_FFMPEG)
460 # Use system installed FFmpeg 460 # Use system installed FFmpeg
461 find_package(FFmpeg 4.3 QUIET COMPONENTS ${FFmpeg_COMPONENTS}) 461 find_package(FFmpeg 4.3 REQUIRED QUIET COMPONENTS ${FFmpeg_COMPONENTS})
462
463 if (FFmpeg_FOUND)
464 # Overwrite aggregate defines from FFmpeg module to avoid over-linking libraries.
465 # Prevents shipping too many libraries with the AppImage.
466 set(FFmpeg_LIBRARIES "")
467 set(FFmpeg_INCLUDE_DIR "")
468
469 foreach(COMPONENT ${FFmpeg_COMPONENTS})
470 set(FFmpeg_LIBRARIES ${FFmpeg_LIBRARIES} ${FFmpeg_LIBRARY_${COMPONENT}} CACHE PATH "Paths to FFmpeg libraries" FORCE)
471 set(FFmpeg_INCLUDE_DIR ${FFmpeg_INCLUDE_DIR} ${FFmpeg_INCLUDE_${COMPONENT}} CACHE PATH "Path to FFmpeg headers" FORCE)
472 endforeach()
473 else()
474 message(WARNING "FFmpeg not found or too old, falling back to externals")
475 set(YUZU_USE_BUNDLED_FFMPEG ON)
476 endif()
477endif() 462endif()
478 463
479# Prefer the -pthread flag on Linux. 464# Prefer the -pthread flag on Linux.
diff --git a/externals/find-modules/FindFFmpeg.cmake b/externals/find-modules/FindFFmpeg.cmake
index add5b2c01..eedf28aea 100644
--- a/externals/find-modules/FindFFmpeg.cmake
+++ b/externals/find-modules/FindFFmpeg.cmake
@@ -185,3 +185,11 @@ foreach(c ${_FFmpeg_ALL_COMPONENTS})
185endforeach() 185endforeach()
186unset(_FFmpeg_ALL_COMPONENTS) 186unset(_FFmpeg_ALL_COMPONENTS)
187unset(_FFmpeg_REQUIRED_VARS) 187unset(_FFmpeg_REQUIRED_VARS)
188
189include(FindPackageHandleStandardArgs)
190find_package_handle_standard_args(FFmpeg
191 REQUIRED_VARS
192 FFmpeg_LIBRARIES
193 FFmpeg_INCLUDE_DIR
194 HANDLE_COMPONENTS
195)