Files
ffmini/cmake/FindFFmpeg.cmake
mnerv 84c06b59a0 FindFFmpeg works on Windows
The application links with ffmpeg dll and needs a copy of it to works in
the output binary location.
2023-09-08 20:37:43 +02:00

71 lines
2.1 KiB
CMake

find_path(FFMPEG_INCLUDE_DIR
NAMES
libavcodec
libavdevice
libavfilter
libavformat
libavutil
libpostproc
libswresample
libswscale
)
find_library(FFMPEG_AVCODEC_LIBRARY avcodec)
find_library(FFMPEG_AVDEVICE_LIBRARY avdevice)
find_library(FFMPEG_AVFILTER_LIBRARY avfilter)
find_library(FFMPEG_AVFORMAT_LIBRARY avformat)
find_library(FFMPEG_AVUTIL_LIBRARY avutil)
find_library(FFMPEG_POSTPROC_LIBRARY postproc)
find_library(FFMPEG_SWRESAMPLE_LIBRARY swresample)
find_library(FFMPEG_SWSCALE_LIBRARY swscale)
#find_library(FFMPEG_AVCODEC_LIBRARY NAMES "avcodec.lib" "libavcodec.a")
#find_library(FFMPEG_AVDEVICE_LIBRARY NAMES "avdevice.lib" "libavdevice.a")
#find_library(FFMPEG_AVFILTER_LIBRARY NAMES "avfilter.lib" "libavfilter.a")
#find_library(FFMPEG_AVFORMAT_LIBRARY NAMES "avformat.lib" "libavformat.a")
#find_library(FFMPEG_AVUTIL_LIBRARY NAMES "avutil.lib" "libavutil.a")
#find_library(FFMPEG_POSTPROC_LIBRARY NAMES "postproc.lib" "libpostproc.a")
#find_library(FFMPEG_SWRESAMPLE_LIBRARY NAMES "swresample.lib" "libswresample.a")
#find_library(FFMPEG_SWSCALE_LIBRARY NAMES "swscale.lib" "libswscale.a")
if (FFMPEG_INCLUDE_DIR AND
FFMPEG_AVCODEC_LIBRARY AND
FFMPEG_AVDEVICE_LIBRARY AND
FFMPEG_AVFILTER_LIBRARY AND
FFMPEG_AVFORMAT_LIBRARY AND
FFMPEG_AVUTIL_LIBRARY AND
FFMPEG_POSTPROC_LIBRARY AND
FFMPEG_SWRESAMPLE_LIBRARY AND
FFMPEG_SWSCALE_LIBRARY)
set(FFMPEG_FOUND TRUE)
else()
set(FFMPEG_FOUND FALSE)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFmpeg
REQUIRED_VARS
FFMPEG_INCLUDE_DIR
FFMPEG_AVCODEC_LIBRARY
FFMPEG_AVDEVICE_LIBRARY
FFMPEG_AVFILTER_LIBRARY
FFMPEG_AVFORMAT_LIBRARY
FFMPEG_AVUTIL_LIBRARY
FFMPEG_POSTPROC_LIBRARY
FFMPEG_SWRESAMPLE_LIBRARY
FFMPEG_SWSCALE_LIBRARY
)
mark_as_advanced(
FFMPEG_INCLUDE_DIR
FFMPEG_AVCODEC_LIBRARY
FFMPEG_AVDEVICE_LIBRARY
FFMPEG_AVFILTER_LIBRARY
FFMPEG_AVFORMAT_LIBRARY
FFMPEG_AVUTIL_LIBRARY
FFMPEG_POSTPROC_LIBRARY
FFMPEG_SWRESAMPLE_LIBRARY
FFMPEG_SWSCALE_LIBRARY
)