mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-19 21:13:12 -07:00
Fix FindFFMPEG.cmake for older CMake (#344)
This commit is contained in:
parent
732f312b17
commit
d5b220d7c3
1 changed files with 22 additions and 14 deletions
|
@ -46,6 +46,7 @@ function (_ffmpeg_find component headername)
|
|||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(FFMPEG_${component} lib${component} IMPORTED_TARGET)
|
||||
if(FFMPEG_${component}_FOUND)
|
||||
if((TARGET PkgConfig::FFMPEG_${component}) AND (NOT CMAKE_VERSION VERSION_LESS "3.11.0"))
|
||||
if(APPLE)
|
||||
join(FFMPEG_LDFLAGS_STRING " " ${FFMPEG_${component}_LDFLAGS})
|
||||
string(REGEX REPLACE "-Wl,-framework,([^ ]+)" "-framework \\1" FFMPEG_LDFLAGS_STRING_CLEAN ${FFMPEG_LDFLAGS_STRING})
|
||||
|
@ -61,6 +62,13 @@ function (_ffmpeg_find component headername)
|
|||
endif()
|
||||
set_target_properties(PkgConfig::FFMPEG_${component} PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
add_library(FFMPEG::${component} ALIAS PkgConfig::FFMPEG_${component})
|
||||
else()
|
||||
add_library("FFMPEG::${component}" INTERFACE IMPORTED)
|
||||
set_target_properties("FFMPEG::${component}" PROPERTIES
|
||||
INTERFACE_LINK_DIRECTORIES "${FFMPEG_${component}_LIBRARY_DIRS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FFMPEG_${component}_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${FFMPEG_${component}_LIBRARIES}")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue