diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-01-12 21:07:40 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-01-12 21:07:40 +0300 |
commit | e594f23a27fe01a1b34345a25914ce7defe9c62a (patch) | |
tree | 80976ba734f4482819a932d82b7317f60d40ae49 /build_files/cmake | |
parent | fa8c2c78857989c23262915921722cf69399d58d (diff) |
Revert "CMake: use FFmpeg find module on Linux"
This reverts commit 62a0de1673302fb7f15fe06efaf6f0f97d92d240. Linux buildbot
is giving link errors.
Diffstat (limited to 'build_files/cmake')
-rw-r--r-- | build_files/cmake/Modules/FindFFmpeg.cmake | 6 | ||||
-rw-r--r-- | build_files/cmake/platform/platform_apple.cmake | 1 | ||||
-rw-r--r-- | build_files/cmake/platform/platform_unix.cmake | 36 |
3 files changed, 21 insertions, 22 deletions
diff --git a/build_files/cmake/Modules/FindFFmpeg.cmake b/build_files/cmake/Modules/FindFFmpeg.cmake index 5f506a33e13..0765c1dc901 100644 --- a/build_files/cmake/Modules/FindFFmpeg.cmake +++ b/build_files/cmake/Modules/FindFFmpeg.cmake @@ -33,8 +33,6 @@ if(NOT FFMPEG_FIND_COMPONENTS) avfilter avformat avutil - swscale - swresample ) endif() @@ -52,9 +50,9 @@ foreach(_component ${FFMPEG_FIND_COMPONENTS}) string(TOUPPER ${_component} _upper_COMPONENT) find_library(FFMPEG_${_upper_COMPONENT}_LIBRARY NAMES - ${_component} + ${_upper_COMPONENT} HINTS - ${_ffmpeg_SEARCH_DIRS} + ${LIBDIR}/ffmpeg PATH_SUFFIXES lib64 lib ) diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake index 929be0c93f7..15bd02230c3 100644 --- a/build_files/cmake/platform/platform_apple.cmake +++ b/build_files/cmake/platform/platform_apple.cmake @@ -173,7 +173,6 @@ if(WITH_IMAGE_OPENEXR) endif() if(WITH_CODEC_FFMPEG) - set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg) set(FFMPEG_FIND_COMPONENTS avcodec avdevice avformat avutil mp3lame ogg opus swresample swscale diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index dce78fb0c8e..0aaec3083a3 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -178,24 +178,26 @@ endif() if(WITH_CODEC_FFMPEG) if(EXISTS ${LIBDIR}) - set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg) - # Override FFMPEG components to also include static library dependencies. - # included with precompiled libraries. - set(FFMPEG_FIND_COMPONENTS - avcodec avdevice avformat avutil - mp3lame ogg opus swresample swscale - theora theoradec theoraenc vorbis vorbisenc - vorbisfile vpx x264 xvidcore) - elseif(FFMPEG) - # Old cache variable used for root dir, convert to new standard. - set(FFMPEG_ROOT_DIR ${FFMPEG}) - endif() - find_package(FFmpeg) - - if(NOT FFMPEG_FOUND) - set(WITH_CODEC_FFMPEG OFF) - message(STATUS "FFmpeg not found, disabling it") + # For precompiled lib directory, all ffmpeg dependencies are in the same folder + file(GLOB ffmpeg_libs ${LIBDIR}/ffmpeg/lib/*.a ${LIBDIR}/sndfile/lib/*.a) + set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory") + set(FFMPEG_LIBRARIES ${ffmpeg_libs} ${ffmpeg_libs} CACHE STRING "FFMPEG Libraries") + else() + set(FFMPEG /usr CACHE PATH "FFMPEG Directory") + set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries") endif() + + mark_as_advanced(FFMPEG) + + # lame, but until we have proper find module for ffmpeg + set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include) + if(EXISTS "${FFMPEG}/include/ffmpeg/") + list(APPEND FFMPEG_INCLUDE_DIRS "${FFMPEG}/include/ffmpeg") + endif() + # end lameness + + mark_as_advanced(FFMPEG_LIBRARIES) + set(FFMPEG_LIBPATH ${FFMPEG}/lib) endif() if(WITH_FFTW3) |