2 Provides the following variables:
4 * `FFMPEG_INCLUDE_DIRS`: Include directories necessary to use FFMPEG.
5 * `FFMPEG_LIBRARIES`: Libraries necessary to use FFMPEG. Note that
this only
6 includes libraries
for the components requested.
7 * `FFMPEG_VERSION`: The
version of FFMPEG found.
9 The following components are supported:
20 For each
component, the following are provided:
22 * `FFMPEG_<component>_FOUND`: Libraries
for the
component.
23 * `FFMPEG_<component>_INCLUDE_DIRS`: Include directories
for 25 * `FFMPEG_<component>_LIBRARIES`: Libraries
for the
component.
28 Note that only components requested with `COMPONENTS` or `OPTIONAL_COMPONENTS`
29 are guaranteed to
set these variables or provide targets.
33 find_path(
"FFMPEG_${component}_INCLUDE_DIR" 35 "lib${component}/${headername}" 37 "${FFMPEG_ROOT}/include" 43 /opt/local/include # DarwinPorts
44 /opt/csw/include # Blastwave
49 DOC
"FFMPEG's ${component} include directory")
50 mark_as_advanced(
"FFMPEG_${component}_INCLUDE_DIR")
52 # On Windows, static FFMPEG is sometimes built as `lib<name>.a`. 54 list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
".a" ".lib")
55 list(APPEND CMAKE_FIND_LIBRARY_PREFIXES
"" "lib")
58 find_library("FFMPEG_${
component}_LIBRARY
" 75 DOC "FFMPEG
's ${component} library") 76 mark_as_advanced("FFMPEG_${component}_LIBRARY") 78 if (FFMPEG_${component}_LIBRARY AND FFMPEG_${component}_INCLUDE_DIR) 81 foreach (_ffmpeg_dep IN LISTS ARGN) 82 if (TARGET "FFMPEG::${_ffmpeg_dep}") 83 list(APPEND _deps_link "FFMPEG::${_ffmpeg_dep}") 85 set(_deps_found FALSE) 89 if (NOT TARGET "FFMPEG::${component}") 90 add_library("FFMPEG::${component}" UNKNOWN IMPORTED) 91 set_target_properties("FFMPEG::${component}" PROPERTIES 92 IMPORTED_LOCATION "${FFMPEG_${component}_LIBRARY}" 93 INTERFACE_INCLUDE_DIRECTORIES "${FFMPEG_${component}_INCLUDE_DIR}" 94 IMPORTED_LINK_INTERFACE_LIBRARIES "${_deps_link}") 96 set("FFMPEG_${component}_FOUND" 1 99 set(version_header_path "${FFMPEG_${component}_INCLUDE_DIR}/lib${component}/version.h") 100 if (EXISTS "${version_header_path}") 101 string(TOUPPER "${component}" component_upper) 102 file(STRINGS "${version_header_path}" version 103 REGEX "#define *LIB${component_upper}_VERSION_(MAJOR|MINOR|MICRO) ") 104 string(REGEX REPLACE ".*_MAJOR *\([0-9]*\).*" "\\1" major "${version}") 105 string(REGEX REPLACE ".*_MINOR *\([0-9]*\).*" "\\1" minor "${version}") 106 string(REGEX REPLACE ".*_MICRO *\([0-9]*\).*" "\\1" micro "${version}") 107 if (NOT major STREQUAL "" AND 108 NOT minor STREQUAL "" AND 109 NOT micro STREQUAL "") 110 set("FFMPEG_${component}_VERSION" "${major}.${minor}.${micro}" 115 set("FFMPEG_${component}_FOUND" 0 118 if (NOT FFMPEG_${component}_LIBRARY) 121 if (NOT FFMPEG_${component}_INCLUDE_DIR) 123 string(APPEND what " or headers") 128 set("FFMPEG_${component}_NOT_FOUND_MESSAGE" 129 "Could not find the ${what} for ${component}." 135 _ffmpeg_find(avutil avutil.h) 136 _ffmpeg_find(avresample avresample.h 138 _ffmpeg_find(swresample swresample.h 140 _ffmpeg_find(swscale swscale.h 142 _ffmpeg_find(avcodec avcodec.h 144 _ffmpeg_find(avformat avformat.h 146 _ffmpeg_find(avfilter avfilter.h 148 _ffmpeg_find(avdevice avdevice.h 151 if (TARGET FFMPEG::avutil) 152 set(_ffmpeg_version_header_path "${FFMPEG_avutil_INCLUDE_DIR}/libavutil/ffversion.h") 153 if (EXISTS "${_ffmpeg_version_header_path}") 154 file(STRINGS "${_ffmpeg_version_header_path}" _ffmpeg_version 155 REGEX "FFMPEG_VERSION") 156 string(REGEX REPLACE ".*\"n?\(.*\)\"" "\\1" FFMPEG_VERSION "${_ffmpeg_version}") 157 unset(_ffmpeg_version) 159 set(FFMPEG_VERSION FFMPEG_VERSION-NOTFOUND) 161 unset(_ffmpeg_version_header_path) 164 set(FFMPEG_INCLUDE_DIRS) 165 set(FFMPEG_LIBRARIES) 166 set(_ffmpeg_required_vars) 167 foreach (_ffmpeg_component IN LISTS FFMPEG_FIND_COMPONENTS) 168 if (TARGET "FFMPEG::${_ffmpeg_component}") 169 set(FFMPEG_${_ffmpeg_component}_INCLUDE_DIRS 170 "${FFMPEG_${_ffmpeg_component}_INCLUDE_DIR}") 171 set(FFMPEG_${_ffmpeg_component}_LIBRARIES 172 "${FFMPEG_${_ffmpeg_component}_LIBRARY}") 173 list(APPEND FFMPEG_INCLUDE_DIRS 174 "${FFMPEG_${_ffmpeg_component}_INCLUDE_DIRS}") 175 list(APPEND FFMPEG_LIBRARIES 176 "${FFMPEG_${_ffmpeg_component}_LIBRARIES}") 177 if (FFMEG_FIND_REQUIRED_${_ffmpeg_component}) 178 list(APPEND _ffmpeg_required_vars 179 "FFMPEG_${_ffmpeg_required_vars}_INCLUDE_DIRS" 180 "FFMPEG_${_ffmpeg_required_vars}_LIBRARIES") 184 unset(_ffmpeg_component) 186 if (FFMPEG_INCLUDE_DIRS) 187 list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) 190 include(FindPackageHandleStandardArgs) 191 find_package_handle_standard_args(FFMPEG 192 REQUIRED_VARS FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES ${_ffmpeg_required_vars} 193 VERSION_VAR FFMPEG_VERSION 195 unset(_ffmpeg_required_vars)
boost::graph_traits< vtkGraph *>::vertex_descriptor target(boost::graph_traits< vtkGraph *>::edge_descriptor e, vtkGraph *)
function _ffmpeg_find(component, headername)
Provides the following variables: