many different fixes
This commit is contained in:
1 parent
a583c17916
commit
53801f2b53
36 files changed
+5149
-1291
No files matched your search
@@ -0,0 +1,48 @@
|
||||
# BundleFFmpeg.cmake - Helper to bundle FFmpeg libraries on install
|
||||
|
||||
function(bundle_ffmpeg_libraries target)
|
||||
if(NOT TARGET ${target})
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
# Create post-install script to copy FFmpeg libs
|
||||
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/bundle_ffmpeg_$<CONFIG>.sh
|
||||
CONTENT "#!/bin/bash
|
||||
# Bundle FFmpeg libraries
|
||||
set -e
|
||||
|
||||
dest_dir=\"$1\"
|
||||
mkdir -p \"\$dest_dir\"
|
||||
|
||||
# Find FFmpeg libraries
|
||||
ffmpeg_libs=($(pkg-config --libs-only-L libavformat libavcodec libswresample libavutil 2>/dev/null | sed 's/-L//g'))
|
||||
|
||||
for libdir in \"\${ffmpeg_libs[@]}\" /usr/lib /usr/local/lib; do
|
||||
if [ -d \"\$libdir\" ]; then
|
||||
for lib in avformat avcodec swresample avutil; do
|
||||
# Try different naming conventions
|
||||
for pattern in \"lib\${lib}.so*\" \"lib\${lib}-*.so*\"; do
|
||||
for file in \$libdir/\$pattern; do
|
||||
if [ -f \"\$file\" ] && [ ! -L \"\$file\" ]; then
|
||||
cp -v \"\$file\" \"\$dest_dir/\" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
done
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
echo \"FFmpeg libraries bundled to \$dest_dir\"
|
||||
"
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
)
|
||||
|
||||
install(CODE "
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_BINARY_DIR}/bundle_ffmpeg_$<CONFIG>.sh \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\"
|
||||
ERROR_QUIET
|
||||
)
|
||||
")
|
||||
endif()
|
||||
endfunction()
|
||||
Reference in new issue
Block a user