summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2012-04-08 21:17:23 +0300
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2012-04-08 21:17:23 +0300
commit88bbe920b08714acd974ef30785a45d84e87520c (patch)
tree105a3969d40a6ef00fdf44e610a26e1f22ba8905 /examples
parent3a1b93f26f163cba4bee947208244d092707df60 (diff)
cmake: Add the GL include dirs in the compiler include path in all places where QtOpenGL is used.
This is because qgl.h includes GL headers directly, so unless the GL headers are in the standard include path, this is going to fail.
Diffstat (limited to 'examples')
-rw-r--r--examples/qmlplayer/CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/qmlplayer/CMakeLists.txt b/examples/qmlplayer/CMakeLists.txt
index 80781da..7632145 100644
--- a/examples/qmlplayer/CMakeLists.txt
+++ b/examples/qmlplayer/CMakeLists.txt
@@ -3,6 +3,11 @@ project(qtgst-example-qmlplayer)
if (NOT BUILDING_QTGSTREAMER)
find_package(Qt4 COMPONENTS QtCore QtGui QtDeclarative REQUIRED)
find_package(QtGStreamer REQUIRED)
+ find_package(OpenGL)
+
+ # Use a relative module path to avoid copying FindOpenGLES2.cmake here
+ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules)
+ find_package(OpenGLES2)
if (${CMAKE_VERSION} VERSION_LESS "2.8.6")
find_package(Automoc4 REQUIRED)
@@ -25,8 +30,13 @@ include_directories(${QTGSTREAMER_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${QTGSTREAMER_FLAGS}")
add_definitions(${QTGSTREAMER_DEFINITIONS})
-if (QT_QTOPENGL_FOUND)
+if (QT_QTOPENGL_FOUND AND (OPENGL_FOUND OR OPENGLES2_FOUND))
set(qmlplayer_gl_libs ${QT_QTOPENGL_LIBRARY})
+ if (OPENGLES2_FOUND)
+ include_directories(${OPENGLES2_INCLUDE_DIR})
+ else()
+ include_directories(${OPENGL_INCLUDE_DIR})
+ endif()
else()
add_definitions(-DQMLPLAYER_NO_OPENGL)
endif()