Files
Aethera/web_server/third_party/ffmpeg.cmake
T
2026-08-29 19:03:19 +08:00

36 lines
1.4 KiB
CMake

include_guard(GLOBAL)
set(Aethera_FFmpeg_root
"${CMAKE_CURRENT_LIST_DIR}/ffmpeg-9.0.1-full_build-shared")
set(Aethera_FFmpeg_runtime_libraries
"${Aethera_FFmpeg_root}/bin/avcodec-63.dll"
"${Aethera_FFmpeg_root}/bin/avutil-61.dll"
"${Aethera_FFmpeg_root}/bin/swresample-7.dll"
"${Aethera_FFmpeg_root}/bin/swscale-10.dll")
foreach(runtime IN LISTS Aethera_FFmpeg_runtime_libraries)
if (NOT EXISTS "${runtime}")
message(FATAL_ERROR "Aethera FFmpeg runtime was not found: ${runtime}")
endif ()
endforeach()
foreach(component IN ITEMS avutil avcodec swscale)
add_library(Aethera_FFmpeg_${component} SHARED IMPORTED GLOBAL)
set_target_properties(Aethera_FFmpeg_${component} PROPERTIES
IMPORTED_IMPLIB "${Aethera_FFmpeg_root}/lib/${component}.lib"
INTERFACE_INCLUDE_DIRECTORIES "${Aethera_FFmpeg_root}/include")
endforeach()
set_target_properties(Aethera_FFmpeg_avutil PROPERTIES
IMPORTED_LOCATION "${Aethera_FFmpeg_root}/bin/avutil-61.dll")
set_target_properties(Aethera_FFmpeg_avcodec PROPERTIES
IMPORTED_LOCATION "${Aethera_FFmpeg_root}/bin/avcodec-63.dll")
set_target_properties(Aethera_FFmpeg_swscale PROPERTIES
IMPORTED_LOCATION "${Aethera_FFmpeg_root}/bin/swscale-10.dll")
add_library(Aethera_FFmpeg INTERFACE)
add_library(Aethera::FFmpeg ALIAS Aethera_FFmpeg)
target_link_libraries(Aethera_FFmpeg INTERFACE
Aethera_FFmpeg_avcodec
Aethera_FFmpeg_avutil
Aethera_FFmpeg_swscale)