diff --git a/CMake/FindFFMPEG.cmake b/CMake/FindFFMPEG.cmake index f727ef2d..b5eae147 100644 --- a/CMake/FindFFMPEG.cmake +++ b/CMake/FindFFMPEG.cmake @@ -79,16 +79,19 @@ function (_ffmpeg_find component headername) set(_deps_found TRUE) set(_deps_link) foreach (_ffmpeg_dep IN LISTS ARGN) - if (TARGET "FFMPEG::${_ffmpeg_dep}") - list(APPEND _deps_link "FFMPEG::${_ffmpeg_dep}") + if (TARGET "FFmpeg::${_ffmpeg_dep}") + list(APPEND _deps_link "FFmpeg::${_ffmpeg_dep}") else () set(_deps_found FALSE) endif () endforeach () if (_deps_found) - if (NOT TARGET "FFMPEG::${component}") - add_library("FFMPEG::${component}" UNKNOWN IMPORTED) - set_target_properties("FFMPEG::${component}" PROPERTIES + if (NOT TARGET "FFmpeg::${component}") + # vcpkg cmake wrapper + add_library("FFmpeg::${component}" UNKNOWN IMPORTED) + # VTK + add_library("FFMPEG::${component}" ALIAS "FFmpeg::${component}") + set_target_properties("FFmpeg::${component}" PROPERTIES IMPORTED_LOCATION "${FFMPEG_${component}_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${FFMPEG_${component}_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LIBRARIES "${_deps_link}") @@ -148,7 +151,7 @@ _ffmpeg_find(avfilter avfilter.h _ffmpeg_find(avdevice avdevice.h avformat avutil) -if (TARGET FFMPEG::avutil) +if (TARGET FFmpeg::avutil) set(_ffmpeg_version_header_path "${FFMPEG_avutil_INCLUDE_DIR}/libavutil/ffversion.h") if (EXISTS "${_ffmpeg_version_header_path}") file(STRINGS "${_ffmpeg_version_header_path}" _ffmpeg_version @@ -165,7 +168,7 @@ set(FFMPEG_INCLUDE_DIRS) set(FFMPEG_LIBRARIES) set(_ffmpeg_required_vars) foreach (_ffmpeg_component IN LISTS FFMPEG_FIND_COMPONENTS) - if (TARGET "FFMPEG::${_ffmpeg_component}") + if (TARGET "FFmpeg::${_ffmpeg_component}") set(FFMPEG_${_ffmpeg_component}_INCLUDE_DIRS "${FFMPEG_${_ffmpeg_component}_INCLUDE_DIR}") set(FFMPEG_${_ffmpeg_component}_LIBRARIES