INCLUDE_DIRECTORIES( ${FFMPEG_INCLUDE_DIRS} )
LINK_DIRECTORIES(${FFMPEG_LIBRARY_DIRS})
SET(TARGET_EXTERNAL_LIBRARIES ${FFMPEG_LIBRARIES} )


IF(FFMPEG_LIBSWSCALE_FOUND)

    INCLUDE_DIRECTORIES( ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS} ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS}/libswscale )

    ADD_DEFINITIONS(-DUSE_SWSCALE)

    SET(TARGET_EXTERNAL_LIBRARIES ${FFMPEG_LIBRARIES} ${FFMPEG_LIBSWSCALE_LIBRARIES})

ENDIF()

ADD_DEFINITIONS(-D__STDC_CONSTANT_MACROS)

# MESSAGE("FFMPEG_LIBAVFORMAT_INCLUDE_DIRS = "  ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} )
# MESSAGE("FFMPEG_LIBAVDEVICE_INCLUDE_DIRS = "  ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} )
# MESSAGE("FFMPEG_LIBAVCODEC_INCLUDE_DIRS = "  ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} )
# MESSAGE("FFMPEG_LIBAVUTIL_INCLUDE_DIRS = "  ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} )
# MESSAGE("FFMPEG_LIBRARIES = "  ${FFMPEG_LIBRARIES} )

SET(TARGET_SRC 
    FFmpegClocks.cpp
    FFmpegDecoderAudio.cpp
    FFmpegDecoder.cpp
    FFmpegDecoderVideo.cpp
    FFmpegImageStream.cpp
    FFmpegAudioStream.cpp
    FFmpegParameters.cpp
    ReaderWriterFFmpeg.cpp
)

SET(TARGET_H
    BoundedMessageQueue.hpp
    FFmpegClocks.hpp
    FFmpegDecoderAudio.hpp
    FFmpegDecoder.hpp
    FFmpegDecoderVideo.hpp
    FFmpegHeaders.hpp
    FFmpegPacket.hpp
    FFmpegImageStream.hpp
    FFmpegAudioStream.hpp
    FFmpegParameters.hpp
    MessageQueue.hpp
)

IF(CMAKE_COMPILER_IS_GNUCXX)
    # Remove -pedantic flag as it barfs on ffmoeg headers
   STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()

#### end var setup  ###
SETUP_PLUGIN(ffmpeg ffmpeg)

IF(MSVC)
    SET_TARGET_PROPERTIES(${TARGET_DEFAULT_PREFIX}ffmpeg PROPERTIES LINK_FLAGS "/OPT:NOREF")
ENDIF(MSVC)
