summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2013-06-07 14:32:54 +0300
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2013-06-09 19:20:26 +0300
commit0f718aebd7805d291c8afa357cef7748e9813adf (patch)
treec6025be1de882be12225b18f9177d0826fc9bfd7
parent42015febada2f0122409db9a85c3948f6892b02f (diff)
examples: Fix make examples_distcheck with Qt5
-rw-r--r--examples/CMakeLists.txt3
-rw-r--r--examples/RunExamplesDistCheck.cmake10
-rw-r--r--examples/appsink-src/appsink-src.pro7
-rw-r--r--examples/player/player.pro8
-rw-r--r--examples/qmlplayer/qmlplayer.pro8
-rw-r--r--examples/recorder/recorder.pro8
-rw-r--r--examples/voip/voip.pro8
7 files changed, 43 insertions, 9 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 2176826..e983adc 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -3,6 +3,7 @@ macro(example_distcheck example)
${CMAKE_COMMAND}
-DCMAKE_BUILD_TOOL=${CMAKE_BUILD_TOOL}
-DQT_QMAKE_EXECUTABLE=${QT_QMAKE_EXECUTABLE}
+ -DQT_VERSION=${QT_VERSION}
-DBINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}
-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DEXAMPLE=${example}
@@ -31,5 +32,5 @@ example_distcheck(voip)
if (Qt4or5_Quick1_FOUND)
add_subdirectory(qmlplayer)
+ example_distcheck(qmlplayer)
endif()
-example_distcheck(qmlplayer)
diff --git a/examples/RunExamplesDistCheck.cmake b/examples/RunExamplesDistCheck.cmake
index 92ab406..369773e 100644
--- a/examples/RunExamplesDistCheck.cmake
+++ b/examples/RunExamplesDistCheck.cmake
@@ -1,10 +1,14 @@
-macro (run_check tool tool_name)
+function (run_check tool tool_name)
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${BINARY_DIR}/build-${EXAMPLE}-${tool_name})
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${BINARY_DIR}/build-${EXAMPLE}-${tool_name})
- execute_process(COMMAND ${tool} ${SOURCE_DIR}/${EXAMPLE}
+ if (${tool_name} STREQUAL "cmake")
+ set(arguments "-DQT_VERSION=${QT_VERSION}")
+ endif()
+
+ execute_process(COMMAND ${tool} ${SOURCE_DIR}/${EXAMPLE} ${arguments}
WORKING_DIRECTORY ${BINARY_DIR}/build-${EXAMPLE}-${tool_name}
RESULT_VARIABLE ${tool_name}_RESULT
)
@@ -26,7 +30,7 @@ macro (run_check tool tool_name)
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${BINARY_DIR}/build-${EXAMPLE}-${tool_name})
-endmacro()
+endfunction()
message("##### Running CMAKE on ${EXAMPLE} example #####")
run_check(${CMAKE_COMMAND} cmake)
diff --git a/examples/appsink-src/appsink-src.pro b/examples/appsink-src/appsink-src.pro
index 300da80..2176b39 100644
--- a/examples/appsink-src/appsink-src.pro
+++ b/examples/appsink-src/appsink-src.pro
@@ -10,7 +10,12 @@ CONFIG += silent
CONFIG += link_pkgconfig
# Now tell qmake to link to QtGStreamer and also use its include path and Cflags.
-PKGCONFIG += QtGStreamer-0.10 QtGStreamerUtils-0.10
+contains(QT_VERSION, ^4\\..*) {
+ PKGCONFIG += QtGStreamer-0.10 QtGStreamerUtils-0.10
+}
+contains(QT_VERSION, ^5\\..*) {
+ PKGCONFIG += Qt5GStreamer-0.10 Qt5GStreamerUtils-0.10
+}
# Recommended if you are using g++ 4.5 or later. Must be removed for other compilers.
#QMAKE_CXXFLAGS += -std=c++0x
diff --git a/examples/player/player.pro b/examples/player/player.pro
index 3adde0b..199afd1 100644
--- a/examples/player/player.pro
+++ b/examples/player/player.pro
@@ -10,7 +10,13 @@ CONFIG += silent
CONFIG += link_pkgconfig
# Now tell qmake to link to QtGStreamer and also use its include path and Cflags.
-PKGCONFIG += QtGStreamer-0.10 QtGStreamerUi-0.10
+contains(QT_VERSION, ^4\\..*) {
+ PKGCONFIG += QtGStreamer-0.10 QtGStreamerUi-0.10
+}
+contains(QT_VERSION, ^5\\..*) {
+ PKGCONFIG += Qt5GStreamer-0.10 Qt5GStreamerUi-0.10
+ QT += widgets
+}
# Recommended if you are using g++ 4.5 or later. Must be removed for other compilers.
#QMAKE_CXXFLAGS += -std=c++0x
diff --git a/examples/qmlplayer/qmlplayer.pro b/examples/qmlplayer/qmlplayer.pro
index 4d7bfd6..fa52049 100644
--- a/examples/qmlplayer/qmlplayer.pro
+++ b/examples/qmlplayer/qmlplayer.pro
@@ -10,7 +10,13 @@ CONFIG += silent
CONFIG += link_pkgconfig
# Now tell qmake to link to QtGStreamer and also use its include path and Cflags.
-PKGCONFIG += QtGStreamer-0.10 QtGStreamerUi-0.10
+contains(QT_VERSION, ^4\\..*) {
+ PKGCONFIG += QtGStreamer-0.10 QtGStreamerUi-0.10
+}
+contains(QT_VERSION, ^5\\..*) {
+ PKGCONFIG += Qt5GStreamer-0.10 Qt5GStreamerUi-0.10
+ QT += widgets
+}
# Recommended if you are using g++ 4.5 or later. Must be removed for other compilers.
#QMAKE_CXXFLAGS += -std=c++0x
diff --git a/examples/recorder/recorder.pro b/examples/recorder/recorder.pro
index e31c7e4..c5d51bb 100644
--- a/examples/recorder/recorder.pro
+++ b/examples/recorder/recorder.pro
@@ -10,7 +10,13 @@ CONFIG += silent
CONFIG += link_pkgconfig
# Now tell qmake to link to QtGStreamer and also use its include path and Cflags.
-PKGCONFIG += QtGStreamer-0.10
+contains(QT_VERSION, ^4\\..*) {
+ PKGCONFIG += QtGStreamer-0.10
+}
+contains(QT_VERSION, ^5\\..*) {
+ PKGCONFIG += Qt5GStreamer-0.10
+ QT += widgets
+}
# Recommended if you are using g++ 4.5 or later. Must be removed for other compilers.
#QMAKE_CXXFLAGS += -std=c++0x
diff --git a/examples/voip/voip.pro b/examples/voip/voip.pro
index 07169e5..2d8ff03 100644
--- a/examples/voip/voip.pro
+++ b/examples/voip/voip.pro
@@ -10,7 +10,13 @@ CONFIG += silent
CONFIG += link_pkgconfig
# Now tell qmake to link to QtGStreamer and also use its include path and Cflags.
-PKGCONFIG += QtGStreamer-0.10 QtGStreamerUi-0.10
+contains(QT_VERSION, ^4\\..*) {
+ PKGCONFIG += QtGStreamer-0.10 QtGStreamerUi-0.10
+}
+contains(QT_VERSION, ^5\\..*) {
+ PKGCONFIG += Qt5GStreamer-0.10 Qt5GStreamerUi-0.10
+ QT += widgets
+}
# Recommended if you are using g++ 4.5 or later. Must be removed for other compilers.
#QMAKE_CXXFLAGS += -std=c++0x