2015-03-08 11:42:23 -07:00
|
|
|
cmake_minimum_required (VERSION 2.8.11)
|
|
|
|
project (libff)
|
|
|
|
|
2015-07-18 16:15:01 -07:00
|
|
|
find_package(FFmpeg REQUIRED
|
2015-03-08 11:42:23 -07:00
|
|
|
COMPONENTS avcodec avfilter avdevice avutil swscale avformat swresample)
|
|
|
|
|
|
|
|
include_directories(${FFMPEG_INCLUDE_DIRS})
|
|
|
|
|
2015-03-23 19:10:04 -07:00
|
|
|
if(WIN32 AND NOT MINGW)
|
2015-03-08 11:42:23 -07:00
|
|
|
include_directories(../w32-pthreads)
|
|
|
|
add_definitions(-Dinline=__inline)
|
2015-03-23 19:10:04 -07:00
|
|
|
endif(WIN32 AND NOT MINGW)
|
2015-03-08 11:42:23 -07:00
|
|
|
|
|
|
|
set(libff_HEADERS
|
|
|
|
libff/ff-callbacks.h
|
|
|
|
libff/ff-circular-queue.h
|
|
|
|
libff/ff-clock.h
|
|
|
|
libff/ff-frame.h
|
|
|
|
libff/ff-packet-queue.h
|
2015-03-18 22:25:58 -07:00
|
|
|
libff/ff-threading.h
|
2015-03-08 11:42:23 -07:00
|
|
|
libff/ff-timer.h
|
2015-03-27 22:48:04 -07:00
|
|
|
libff/ff-util.h
|
2015-03-08 11:42:23 -07:00
|
|
|
#
|
|
|
|
libff/ff-demuxer.h
|
|
|
|
#
|
|
|
|
libff/ff-decoder.h)
|
|
|
|
|
|
|
|
set(libff_SOURCES
|
|
|
|
libff/ff-callbacks.c
|
|
|
|
libff/ff-circular-queue.c
|
|
|
|
libff/ff-clock.c
|
|
|
|
libff/ff-packet-queue.c
|
|
|
|
libff/ff-timer.c
|
2015-03-27 22:48:04 -07:00
|
|
|
libff/ff-util.c
|
2015-03-08 11:42:23 -07:00
|
|
|
#
|
|
|
|
libff/ff-demuxer.c
|
|
|
|
#
|
|
|
|
libff/ff-decoder.c
|
|
|
|
libff/ff-audio-decoder.c
|
|
|
|
libff/ff-video-decoder.c)
|
|
|
|
|
2015-03-18 22:25:58 -07:00
|
|
|
if (WIN32)
|
|
|
|
list(APPEND libff_SOURCES
|
|
|
|
libff/ff-threading-windows.c)
|
|
|
|
else(WIN32)
|
|
|
|
list(APPEND libff_SOURCES
|
|
|
|
libff/ff-threading-posix.c)
|
|
|
|
endif(WIN32)
|
|
|
|
|
2015-03-08 11:42:23 -07:00
|
|
|
add_library (libff STATIC
|
|
|
|
${libff_HEADERS}
|
|
|
|
${libff_SOURCES})
|
|
|
|
|
|
|
|
target_include_directories(libff
|
|
|
|
PUBLIC .)
|
|
|
|
|
|
|
|
if(NOT MSVC)
|
|
|
|
if(NOT MINGW)
|
|
|
|
target_compile_options(libff PRIVATE -fPIC)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2015-03-27 22:46:56 -07:00
|
|
|
target_link_libraries (libff
|
|
|
|
${FFMPEG_LIBRARIES})
|