1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 05:23:51 +00:00
openmw-tes3mp/extern/ogre-ffmpeg-videoplayer/CMakeLists.txt
scrawl eb1c24ffe6 Refactor video player engine to get rid of MWSound dependencies
- Split video player to separate source files.
 - Move video player engine sources to extern/ (repository will be set up on github soon).
 - Audio is handled in a MovieAudioFactory, implemented by the user (here in MWSound subsystem).
 - Handle conversion of unsupported channel layouts via ffmpeg's swresample.
2014-10-22 22:33:32 +02:00

38 lines
1.2 KiB
CMake

set(OGRE_FFMPEG_VIDEOPLAYER_LIBRARY "ogre-ffmpeg-videoplayer")
# Sources
set(OGRE_FFMPEG_VIDEOPLAYER_SOURCE_FILES
videoplayer.cpp
videostate.cpp
videodefs.hpp
libavwrapper.cpp
audiodecoder.cpp
)
# Find FFMPEG
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE SWRESAMPLE AVRESAMPLE)
unset(FFMPEG_LIBRARIES CACHE)
find_package(FFmpeg)
if ( NOT AVCODEC_FOUND OR NOT AVFORMAT_FOUND OR NOT AVUTIL_FOUND OR NOT SWSCALE_FOUND )
message(FATAL_ERROR "FFmpeg component required, but not found!")
endif()
set(VIDEO_FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${SWSCALE_LIBRARIES})
if( SWRESAMPLE_FOUND )
add_definitions(-DHAVE_LIBSWRESAMPLE)
set(VIDEO_FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${SWRESAMPLE_LIBRARIES})
else()
if( AVRESAMPLE_FOUND )
set(VIDEO_FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${AVRESAMPLE_LIBRARIES})
else()
message(FATAL_ERROR "Install either libswresample (FFmpeg) or libavresample (Libav).")
endif()
endif()
include_directories(${FFMPEG_INCLUDE_DIRS})
add_library(${OGRE_FFMPEG_VIDEOPLAYER_LIBRARY} STATIC ${OGRE_FFMPEG_VIDEOPLAYER_SOURCE_FILES})
target_link_libraries(${OGRE_FFMPEG_VIDEOPLAYER_LIBRARY} ${VIDEO_FFMPEG_LIBRARIES})
link_directories(${CMAKE_CURRENT_BINARY_DIR})