2014-10-22 20:11:03 +00:00
|
|
|
set(OGRE_FFMPEG_VIDEOPLAYER_LIBRARY "ogre-ffmpeg-videoplayer")
|
|
|
|
|
|
|
|
# Sources
|
|
|
|
|
|
|
|
set(OGRE_FFMPEG_VIDEOPLAYER_SOURCE_FILES
|
2014-10-24 19:19:17 +00:00
|
|
|
videoplayer.cpp
|
|
|
|
videostate.cpp
|
|
|
|
videodefs.hpp
|
2014-10-22 20:11:03 +00:00
|
|
|
libavwrapper.cpp
|
|
|
|
audiodecoder.cpp
|
2014-10-22 20:41:05 +00:00
|
|
|
audiofactory.hpp
|
2014-10-22 20:11:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# 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})
|
|
|
|
|
2014-10-24 19:19:17 +00:00
|
|
|
# Find Boost
|
|
|
|
set(BOOST_COMPONENTS thread)
|
|
|
|
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
|
2014-10-22 20:11:03 +00:00
|
|
|
add_library(${OGRE_FFMPEG_VIDEOPLAYER_LIBRARY} STATIC ${OGRE_FFMPEG_VIDEOPLAYER_SOURCE_FILES})
|
2014-10-24 19:19:17 +00:00
|
|
|
target_link_libraries(${OGRE_FFMPEG_VIDEOPLAYER_LIBRARY} ${VIDEO_FFMPEG_LIBRARIES} ${Boost_LIBRARIES})
|
2014-10-22 20:11:03 +00:00
|
|
|
|
|
|
|
link_directories(${CMAKE_CURRENT_BINARY_DIR})
|