mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-19 21:13:12 -07:00
Fix FindFFMPEG.cmake for ancient cmake
This commit is contained in:
parent
35130b08b7
commit
f8b34febbe
1 changed files with 16 additions and 5 deletions
|
@ -49,7 +49,11 @@ function (_ffmpeg_find component headername)
|
||||||
|
|
||||||
# Try pkg-config first
|
# Try pkg-config first
|
||||||
if(PKG_CONFIG_FOUND)
|
if(PKG_CONFIG_FOUND)
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "3.6")
|
||||||
|
pkg_check_modules(FFMPEG_${component} lib${component})
|
||||||
|
else()
|
||||||
pkg_check_modules(FFMPEG_${component} lib${component} IMPORTED_TARGET)
|
pkg_check_modules(FFMPEG_${component} lib${component} IMPORTED_TARGET)
|
||||||
|
endif()
|
||||||
if(FFMPEG_${component}_FOUND)
|
if(FFMPEG_${component}_FOUND)
|
||||||
if((TARGET PkgConfig::FFMPEG_${component}) AND (NOT CMAKE_VERSION VERSION_LESS "3.11.0"))
|
if((TARGET PkgConfig::FFMPEG_${component}) AND (NOT CMAKE_VERSION VERSION_LESS "3.11.0"))
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
@ -69,6 +73,9 @@ function (_ffmpeg_find component headername)
|
||||||
add_library(FFMPEG::${component} ALIAS PkgConfig::FFMPEG_${component})
|
add_library(FFMPEG::${component} ALIAS PkgConfig::FFMPEG_${component})
|
||||||
else()
|
else()
|
||||||
add_library("FFMPEG::${component}" INTERFACE IMPORTED)
|
add_library("FFMPEG::${component}" INTERFACE IMPORTED)
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "3.6")
|
||||||
|
link_directories("${FFMPEG_${component}_LIBRARY_DIRS}")
|
||||||
|
endif()
|
||||||
set_target_properties("FFMPEG::${component}" PROPERTIES
|
set_target_properties("FFMPEG::${component}" PROPERTIES
|
||||||
INTERFACE_LINK_DIRECTORIES "${FFMPEG_${component}_LIBRARY_DIRS}"
|
INTERFACE_LINK_DIRECTORIES "${FFMPEG_${component}_LIBRARY_DIRS}"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${FFMPEG_${component}_INCLUDE_DIRS}"
|
INTERFACE_INCLUDE_DIRECTORIES "${FFMPEG_${component}_INCLUDE_DIRS}"
|
||||||
|
@ -224,10 +231,14 @@ foreach (_ffmpeg_component IN LISTS FFMPEG_FIND_COMPONENTS)
|
||||||
list(APPEND _ffmpeg_required_vars
|
list(APPEND _ffmpeg_required_vars
|
||||||
"FFMPEG_${_ffmpeg_component}_LIBRARIES")
|
"FFMPEG_${_ffmpeg_component}_LIBRARIES")
|
||||||
else()
|
else()
|
||||||
|
if(NOT FFMPEG_${_ffmpeg_component}_INCLUDE_DIRS)
|
||||||
set(FFMPEG_${_ffmpeg_component}_INCLUDE_DIRS
|
set(FFMPEG_${_ffmpeg_component}_INCLUDE_DIRS
|
||||||
"${FFMPEG_${_ffmpeg_component}_INCLUDE_DIR}")
|
"${FFMPEG_${_ffmpeg_component}_INCLUDE_DIR}")
|
||||||
|
endif()
|
||||||
|
if(NOT FFMPEG_${_ffmpeg_component}_LIBRARIES)
|
||||||
set(FFMPEG_${_ffmpeg_component}_LIBRARIES
|
set(FFMPEG_${_ffmpeg_component}_LIBRARIES
|
||||||
"${FFMPEG_${_ffmpeg_component}_LIBRARY}")
|
"${FFMPEG_${_ffmpeg_component}_LIBRARY}")
|
||||||
|
endif()
|
||||||
list(APPEND FFMPEG_INCLUDE_DIRS
|
list(APPEND FFMPEG_INCLUDE_DIRS
|
||||||
"${FFMPEG_${_ffmpeg_component}_INCLUDE_DIRS}")
|
"${FFMPEG_${_ffmpeg_component}_INCLUDE_DIRS}")
|
||||||
list(APPEND FFMPEG_LIBRARIES
|
list(APPEND FFMPEG_LIBRARIES
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue