summaryrefslogtreecommitdiff
path: root/tests/compilation/CompilationTests_CMakeLists.txt
blob: ccfc8651c5c71e8d49580857273de77aef60273f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 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.9)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

find_package(Boost 1.39 REQUIRED)
find_package(Qt4or5 COMPONENTS Core REQUIRED)

include(QtGStreamerConfigCommon)
include(MacroCXXCompilationTest)

set(CMAKE_REQUIRED_LIBRARIES ${QTGSTREAMER_LIBRARY} ${QTGLIB_LIBRARY} ${Qt4or5_Core_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()

include(HandleImportedTargetsInCMakeRequiredLibraries)
handle_imported_targets_in_cmake_required_libraries(CMAKE_REQUIRED_LIBRARIES)

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