# This is a cmake project file that is used to run the compilation tests.
# We misuse cmake here by running tests with the try_compile command and basing
# the result of the whole test suite on the cmake exit status.

cmake_minimum_required(VERSION 2.8)
find_package(QtGStreamer REQUIRED)
include(MacroCXXCompilationTest)

set(CMAKE_REQUIRED_LIBRARIES ${QTGSTREAMER_LIBRARIES})
set(CMAKE_REQUIRED_INCLUDES ${QTGSTREAMER_INCLUDES})
set(CMAKE_REQUIRED_DEFINITIONS ${QTGSTREAMER_DEFINITIONS})
set(CMAKE_REQUIRED_FLAGS "${QTGSTREAMER_FLAGS}")

if (QTGSTREAMER_STATIC)
    find_package(GStreamer REQUIRED)
    find_package(GStreamerPluginsBase COMPONENTS interfaces REQUIRED)
    set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
                                 ${GSTREAMER_LIBRARY}
                                 ${GSTREAMER_INTERFACES_LIBRARY})
endif()

message("********* Begin running compilation tests *********")
include(CompilationTests.cmake)
evaluate_cxx_compilation_test_results()
message("********* Finished running compilation tests *********")
