64 lines
1.3 KiB
CMake
64 lines
1.3 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
|
|
if (NOT FFMPEG_FIND_COMPONENTS)
|
|
set(FFMPEG_FIND_COMPONENTS
|
|
AVCODEC
|
|
AVDEVICE
|
|
AVFILTER
|
|
AVFORMAT
|
|
AVUTIL
|
|
POSTPROC
|
|
SWRESAMPLE
|
|
SWSCALE
|
|
)
|
|
endif()
|
|
|
|
find_path(FFMPEG_INCLUDE_DIR
|
|
NAMES
|
|
libavcodec
|
|
libavdevice
|
|
libavfilter
|
|
libavformat
|
|
libavutil
|
|
libpostproc
|
|
libswresample
|
|
libswscale
|
|
)
|
|
|
|
foreach (component ${FFMPEG_FIND_COMPONENTS})
|
|
string(TOLOWER ${component} library)
|
|
find_library(FFMPEG_${component}_LIBRARY ${library})
|
|
endforeach()
|
|
|
|
if (WIN32)
|
|
#set(bin_path "${FFMPEG_INCLUDE_DIR}/../bin")
|
|
# TODO: Copy DLLs
|
|
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
|
|
)
|
|
|