diff --git a/dtool/Config.cmake b/dtool/Config.cmake index d38e394f87..d1225f12b9 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -466,18 +466,6 @@ option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) -# Is FFMPEG installed, and where? -find_package(FFMPEG QUIET) -find_package(SWScale QUIET) -find_package(SWResample QUIET) - -package_option(FFMPEG - "Enables support for audio- and video-decoding using the FFMPEG library.") -package_option(SWSCALE - "Enables support for FFMPEG's libswscale for video rescaling.") -package_option(SWRESAMPLE - "Enables support for FFMPEG's libresample for audio resampling.") - # Is ODE installed, and where? find_package(ODE QUIET) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 1c7d4beffc..f35c6b8d62 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -291,12 +291,6 @@ else() message("- Did not find OpenCV") endif() -if(HAVE_FFMPEG) - message("+ FFMPEG") -else() - message("- Did not find FFMPEG") -endif() - if(HAVE_ODE) message("+ ODE") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 6160db69de..626b0db4a8 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -146,6 +146,33 @@ package_option(ZLIB config_package(ZLIB "zlib") +# +# ------------ FFmpeg ------------ +# + +find_package(FFMPEG QUIET) +find_package(SWScale QUIET) +find_package(SWResample QUIET) + +package_option(FFMPEG + "Enables support for audio- and video-decoding using the FFmpeg library.") +package_option(SWSCALE + "Enables support for FFmpeg's libswscale for video rescaling.") +package_option(SWRESAMPLE + "Enables support for FFmpeg's libresample for audio resampling.") + +if(HAVE_SWSCALE AND HAVE_SWRESAMPLE) + set(ffmpeg_features "with swscale and swresample") +elseif(HAVE_SWSCALE) + set(ffmpeg_features "with swscale") +elseif(HAVE_SWRESAMPLE) + set(ffmpeg_features "with swresample") +else() + set(ffmpeg_features "without resampling/rescaling support") +endif() +config_package(FFMPEG "FFmpeg" "${ffmpeg_features}") + + # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System")