package/qt: Add optional support for OpenGL
authorBernd Kuhls <bernd.kuhls@t-online.de>
Sun, 12 Jun 2016 20:07:18 +0000 (22:07 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 12 Jun 2016 20:25:59 +0000 (22:25 +0200)
OpenGL support is only available for the desktop variant of Qt4 and not
the embedded one: http://code.qt.io/cgit/qt/qt.git/tree/configure#n6612

This patch is needed to fix a compile error with libv4l which depends
on OpenGL support if qt4 is used by libv4l as optional dependency.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/qt/Config.in
package/qt/qt.mk

index 0ab8417b86da4f41749375b5f9847c39f8370228..14b13cec20a451861346fbd0d3519dd1ed6875e1 100644 (file)
@@ -350,6 +350,24 @@ config BR2_PACKAGE_QT_PHONON_BACKEND
          Build the platform Phonon plugin.
          If unsure, say n.
 
+choice
+       prompt "OpenGL API"
+       help
+         Select OpenGL API.
+
+config BR2_PACKAGE_QT_OPENGL_NONE
+       bool "No OpenGL support"
+
+comment "Desktop OpenGL not available (needs Qt standard (X11))"
+       depends on !BR2_PACKAGE_QT_X11
+
+config BR2_PACKAGE_QT_OPENGL_GL_DESKTOP
+       bool "Desktop OpenGL"
+       depends on BR2_PACKAGE_HAS_LIBGL
+       depends on BR2_PACKAGE_QT_X11
+       help
+         Use desktop OpenGL.
+
 config BR2_PACKAGE_QT_OPENGL_ES
        bool "OpenGL ES v2.x support"
        depends on BR2_PACKAGE_HAS_LIBGLES
@@ -357,6 +375,8 @@ config BR2_PACKAGE_QT_OPENGL_ES
        help
          Enable the OpenGL ES v2.x support.
 
+endchoice
+
 endif
 
 config BR2_PACKAGE_QT_DBUS
index f29a6714bc12f3c921661fcc92c17f41ac5f7e0d..d56fe7e2e83916a234f4b4b3c2c022bb58868bc2 100644 (file)
@@ -336,6 +336,9 @@ QT_DEPENDENCIES += libgles libegl
 QT_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags egl`
 QT_CXXFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags egl`
 QT_LDFLAGS += `$(PKG_CONFIG_HOST_BINARY) --libs egl`
+else ifeq ($(BR2_PACKAGE_QT_OPENGL_GL_DESKTOP),y)
+QT_CONFIGURE_OPTS += -opengl desktop
+QT_DEPENDENCIES += libgl
 else
 QT_CONFIGURE_OPTS += -no-opengl
 endif