summaryrefslogtreecommitdiff
path: root/examples/player/CMakeLists.txt
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2013-06-07 13:12:02 +0300
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2013-06-09 19:20:26 +0300
commit42015febada2f0122409db9a85c3948f6892b02f (patch)
treea4af717f525da8177963ce488a9a60d32e59f906 /examples/player/CMakeLists.txt
parent51687fe4408bd3aa6f7a88c7eebb0b6ffd2e98c7 (diff)
cmake: Replace QtHelpers by a better FindQt4or5 script
This script makes use of qt4_use_modules and qt5_use_modules, which allow us to get rid of QT_* variables in cmake code and also do things right by defining all the necessary include directories and required Qt defines as well as compiler flags. This also allows us to support both Qt4 and Qt5 in the examples when compiled standalone without much effort.
Diffstat (limited to 'examples/player/CMakeLists.txt')
-rw-r--r--examples/player/CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/player/CMakeLists.txt b/examples/player/CMakeLists.txt
index b0d49ba..c6f4872 100644
--- a/examples/player/CMakeLists.txt
+++ b/examples/player/CMakeLists.txt
@@ -1,7 +1,13 @@
project(qtgst-example-player)
if (NOT BUILDING_QTGSTREAMER)
- find_package(QtGStreamer REQUIRED)
+ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules)
+ find_package(Qt4or5 COMPONENTS Core Gui Widgets REQUIRED)
+ if (${QT_VERSION} STREQUAL "5")
+ find_package(Qt5GStreamer REQUIRED)
+ else()
+ find_package(QtGStreamer REQUIRED)
+ endif()
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
@@ -14,3 +20,4 @@ set(player_SOURCES main.cpp player.cpp mediaapp.cpp)
add_executable(player ${player_SOURCES})
target_link_libraries(player ${QTGSTREAMER_UI_LIBRARIES})
+qt4or5_use_modules(player Core Gui Widgets)