添加ffmpeg相关cmake文件

This commit is contained in:
xiongziliang 2022-05-28 10:18:40 +08:00
parent a11289e5f0
commit ff2e4cf152
5 changed files with 50 additions and 6 deletions

View File

@ -1,8 +1,12 @@
find_path(AVCODEC_INCLUDE_DIR find_path(AVCODEC_INCLUDE_DIR
NAMES libavcodec/avcodec.h) NAMES libavcodec/avcodec.h
HINTS ${FFMPEG_PATH_ROOT}
PATH_SUFFIXES include)
find_library(AVCODEC_LIBRARY find_library(AVCODEC_LIBRARY
NAMES avcodec) NAMES avcodec
HINTS ${FFMPEG_PATH_ROOT}
PATH_SUFFIXES bin lib)
set(AVCODEC_LIBRARIES ${AVCODEC_LIBRARY}) set(AVCODEC_LIBRARIES ${AVCODEC_LIBRARY})
set(AVCODEC_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR}) set(AVCODEC_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR})

16
cmake/FindAVFORMAT.cmake Normal file
View File

@ -0,0 +1,16 @@
find_path(AVFORMAT_INCLUDE_DIR
NAMES libavformat/avformat.h
HINTS ${FFMPEG_PATH_ROOT}
PATH_SUFFIXES include)
find_library(AVFORMAT_LIBRARY
NAMES avformat
HINTS ${FFMPEG_PATH_ROOT}
PATH_SUFFIXES bin lib)
set(AVFORMAT_LIBRARIES ${AVFORMAT_LIBRARY})
set(AVFORMAT_INCLUDE_DIRS ${AVFORMAT_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(AVFORMAT DEFAULT_MSG AVFORMAT_LIBRARY AVFORMAT_INCLUDE_DIR)

View File

@ -1,8 +1,12 @@
find_path(AVUTIL_INCLUDE_DIR find_path(AVUTIL_INCLUDE_DIR
NAMES libavutil/avutil.h) NAMES libavutil/avutil.h
HINTS ${FFMPEG_PATH_ROOT}
PATH_SUFFIXES include)
find_library(AVUTIL_LIBRARY find_library(AVUTIL_LIBRARY
NAMES avutil) NAMES avutil
HINTS ${FFMPEG_PATH_ROOT}
PATH_SUFFIXES bin lib)
set(AVUTIL_LIBRARIES ${AVUTIL_LIBRARY}) set(AVUTIL_LIBRARIES ${AVUTIL_LIBRARY})
set(AVUTIL_INCLUDE_DIRS ${AVUTIL_INCLUDE_DIR}) set(AVUTIL_INCLUDE_DIRS ${AVUTIL_INCLUDE_DIR})

View File

@ -1,8 +1,12 @@
find_path(SWRESAMPLE_INCLUDE_DIR find_path(SWRESAMPLE_INCLUDE_DIR
NAMES libswresample/swresample.h) NAMES libswresample/swresample.h
HINTS ${FFMPEG_PATH_ROOT}
PATH_SUFFIXES include)
find_library(SWRESAMPLE_LIBRARY find_library(SWRESAMPLE_LIBRARY
NAMES swresample) NAMES swresample
HINTS ${FFMPEG_PATH_ROOT}
PATH_SUFFIXES bin lib)
set(SWRESAMPLE_LIBRARIES ${SWRESAMPLE_LIBRARY}) set(SWRESAMPLE_LIBRARIES ${SWRESAMPLE_LIBRARY})
set(SWRESAMPLE_INCLUDE_DIRS ${SWRESAMPLE_INCLUDE_DIR}) set(SWRESAMPLE_INCLUDE_DIRS ${SWRESAMPLE_INCLUDE_DIR})

16
cmake/FindSWSCALE.cmake Normal file
View File

@ -0,0 +1,16 @@
find_path(SWSCALE_INCLUDE_DIR
NAMES libswscale/swscale.h
HINTS ${FFMPEG_PATH_ROOT}
PATH_SUFFIXES include)
find_library(SWSCALE_LIBRARY
NAMES swscale
HINTS ${FFMPEG_PATH_ROOT}
PATH_SUFFIXES bin lib)
set(SWSCALE_LIBRARIES ${SWSCALE_LIBRARY})
set(SWSCALE_INCLUDE_DIRS ${SWSCALE_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SWSCALE DEFAULT_MSG SWSCALE_LIBRARY SWSCALE_INCLUDE_DIR)