Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/cmake')
-rw-r--r--build_files/cmake/Modules/FindFFmpeg.cmake6
-rw-r--r--build_files/cmake/platform/platform_apple.cmake1
-rw-r--r--build_files/cmake/platform/platform_unix.cmake36
3 files changed, 22 insertions, 21 deletions
diff --git a/build_files/cmake/Modules/FindFFmpeg.cmake b/build_files/cmake/Modules/FindFFmpeg.cmake
index 0765c1dc901..5f506a33e13 100644
--- a/build_files/cmake/Modules/FindFFmpeg.cmake
+++ b/build_files/cmake/Modules/FindFFmpeg.cmake
@@ -33,6 +33,8 @@ if(NOT FFMPEG_FIND_COMPONENTS)
avfilter
avformat
avutil
+ swscale
+ swresample
)
endif()
@@ -50,9 +52,9 @@ foreach(_component ${FFMPEG_FIND_COMPONENTS})
string(TOUPPER ${_component} _upper_COMPONENT)
find_library(FFMPEG_${_upper_COMPONENT}_LIBRARY
NAMES
- ${_upper_COMPONENT}
+ ${_component}
HINTS
- ${LIBDIR}/ffmpeg
+ ${_ffmpeg_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 15bd02230c3..929be0c93f7 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -173,6 +173,7 @@ 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 0aaec3083a3..dce78fb0c8e 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -178,26 +178,24 @@ endif()
if(WITH_CODEC_FFMPEG)
if(EXISTS ${LIBDIR})
- # 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")
+ 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")
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)