CMake: fix FindFFmpeg when ffmpeg isn't found
This commit is contained in:
parent
d951d2e4c4
commit
9dfd8bbf38
|
@ -95,7 +95,7 @@ function(find_ffmpeg LIBNAME)
|
||||||
if(NOT FFMPEG_DIR AND (NOT FFmpeg_LIBRARY_${LIBNAME} OR NOT FFmpeg_INCLUDE_${LIBNAME}))
|
if(NOT FFMPEG_DIR AND (NOT FFmpeg_LIBRARY_${LIBNAME} OR NOT FFmpeg_INCLUDE_${LIBNAME}))
|
||||||
# Didn't find it in the usual paths, try pkg-config
|
# Didn't find it in the usual paths, try pkg-config
|
||||||
find_package(PkgConfig QUIET)
|
find_package(PkgConfig QUIET)
|
||||||
pkg_check_modules(FFmpeg_PKGCONFIG_${LIBNAME} REQUIRED QUIET lib${LIBNAME})
|
pkg_check_modules(FFmpeg_PKGCONFIG_${LIBNAME} QUIET lib${LIBNAME})
|
||||||
|
|
||||||
find_path(FFmpeg_INCLUDE_${LIBNAME} lib${LIBNAME}/${LIBNAME}.h
|
find_path(FFmpeg_INCLUDE_${LIBNAME} lib${LIBNAME}/${LIBNAME}.h
|
||||||
${FFmpeg_PKGCONFIG_${LIBNAME}_INCLUDE_DIRS}
|
${FFmpeg_PKGCONFIG_${LIBNAME}_INCLUDE_DIRS}
|
||||||
|
@ -144,7 +144,9 @@ foreach(c ${_FFmpeg_ALL_COMPONENTS})
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
list(REMOVE_DUPLICATES FFmpeg_INCLUDES)
|
if(FFmpeg_INCLUDES)
|
||||||
|
list(REMOVE_DUPLICATES FFmpeg_INCLUDES)
|
||||||
|
endif()
|
||||||
|
|
||||||
foreach(c ${FFmpeg_FIND_COMPONENTS})
|
foreach(c ${FFmpeg_FIND_COMPONENTS})
|
||||||
list(APPEND _FFmpeg_REQUIRED_VARS FFmpeg_INCLUDE_${c} FFmpeg_LIBRARY_${c})
|
list(APPEND _FFmpeg_REQUIRED_VARS FFmpeg_INCLUDE_${c} FFmpeg_LIBRARY_${c})
|
||||||
|
|
Loading…
Reference in New Issue