1cmake_minimum_required(VERSION 3.3) 2 3include(FindPkgConfig) 4if(!${PKG_CONFIG_FOUND}) 5 MESSAGE(FATAL_ERROR "pkg-config required. Please install it") 6 return ("Error - pkg-config not found") 7endif() 8 9pkg_check_modules(GSTREAMER gstreamer-1.0>=1.6 gstreamer-video-1.0>=1.6 REQUIRED) 10 11find_package(Qt5Core REQUIRED) 12find_package(Qt5Widgets REQUIRED) 13find_package(Qt5Qml REQUIRED) 14find_package(Qt5Quick REQUIRED) 15 16set (SRC_LIST main.cpp) 17qt5_add_resources(RESOURCES qmlsink.qrc) 18link_directories(${GSTREAMER_LIBRARY_DIRS}) 19include_directories (${GSTREAMER_INCLUDE_DIRS}) 20add_executable(qml-example ${SRC_LIST} ${RESOURCES}) 21target_link_libraries (qml-example ${GSTREAMER_LIBRARIES}) 22qt5_use_modules(qml-example Core Widgets Qml Quick) 23 24