From 3a82249163e6930317c06c8b4991cf3323b4eb87 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 14 May 2021 10:21:33 +0200 Subject: [PATCH] Some further cleanup of the FFmpeg CMake find module. --- CMake/Packages/FindFFmpeg.cmake | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/CMake/Packages/FindFFmpeg.cmake b/CMake/Packages/FindFFmpeg.cmake index 8595e7b92..ff4dabe18 100644 --- a/CMake/Packages/FindFFmpeg.cmake +++ b/CMake/Packages/FindFFmpeg.cmake @@ -1,32 +1,18 @@ -# Locate ffmpeg -# This module defines -# FFMPEG_LIBRARIES -# FFMPEG_FOUND, if false, do not try to link to ffmpeg -# FFMPEG_INCLUDE_DIR, where to find the headers +# Locate FFmpeg # -# $FFMPEG_DIR is an environment variable that would -# correspond to the ./configure --prefix=$FFMPEG_DIR +# This module defines: +# FFMPEG_FOUND +# FFMPEG_INCLUDE_DIRS +# FFMPEG_LIBRARIES # # Created by Robert Osfield # Modified by Lukas Lalinsky # Modified by Leon Styhre +# -# In ffmpeg code, old version use "#include " and newer use "#include " -# In OSG ffmpeg plugin, we use "#include " for compatibility with old version of ffmpeg - -# We have to search the path which contain the header.h (usefull for old version) -# and search the path which contain the libname/header.h (usefull for new version) - -# Then we need to include ${FFMPEG_libname_INCLUDE_DIRS} -# (in old version case, use by ffmpeg header and osg plugin code) -# (in new version case, use by ffmpeg header) -# and ${FFMPEG_libname_INCLUDE_DIRS/libname} -# (in new version case, use by osg plugin code) - -# Macro to find header and lib directories -# example: FFMPEG_FIND(AVFORMAT avformat avformat.h) +# Macro to find headers and library directories. +# Example: FFMPEG_FIND(AVFORMAT avformat avformat.h) macro(FFMPEG_FIND varname shortname headername) - find_path(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername} PATHS ${FFMPEG_ROOT}/include @@ -68,7 +54,7 @@ FFMPEG_FIND(LIBAVCODEC avcodec avcodec.h) FFMPEG_FIND(LIBAVCODEC_FFT avcodec avfft.h) FFMPEG_FIND(LIBAVUTIL avutil avutil.h) FFMPEG_FIND(LIBSWRESAMPLE swresample swresample.h) -FFMPEG_FIND(LIBSWSCALE swscale swscale.h) # Not sure about the header to look for here. +FFMPEG_FIND(LIBSWSCALE swscale swscale.h) set(FFMPEG_FOUND "NO")