Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Martin <s.martin49@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v8 6/7] package/opencv: add opengl support
Date: Sun,  5 Jul 2015 11:40:28 +0200	[thread overview]
Message-ID: <1436089229-21103-7-git-send-email-s.martin49@gmail.com> (raw)
In-Reply-To: <1436089229-21103-1-git-send-email-s.martin49@gmail.com>

In OpenCV, OpenGL is only used by highgui module.

OpenGL support is done using extensions from 3rd party framework: either
Qt5OpenGL with Qt5 (with GL support only, not GLES); or gtkglext (which
is not available in Buildroot) with gtk2

So, make OpenGL knob a sub-option of the Qt5 support option.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

---
changes v7->v8:
- fix dependencies (Yann)
- update a/r/t tags

changes v6->v7:
- rework comment as sugessted by Yann
- move opengl option close to the gui toolkit choice

changes v5->v6:
- update comments (Yann)

changes v4->v5:
- new patch
---
 package/opencv/Config.in | 22 +++++++++++++++++++++-
 package/opencv/opencv.mk |  7 +++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/package/opencv/Config.in b/package/opencv/Config.in
index 776fa6d..273b00f 100644
--- a/package/opencv/Config.in
+++ b/package/opencv/Config.in
@@ -52,9 +52,10 @@ config BR2_PACKAGE_OPENCV_LIB_HIGHGUI
 	  Include opencv_highgui (high-level gui and media i/o) module into the
 	  OpenCV build.
 
+if BR2_PACKAGE_OPENCV_LIB_HIGHGUI
+
 choice
 	prompt "gui toolkit"
-	depends on BR2_PACKAGE_OPENCV_LIB_HIGHGUI
 	help
 	  GUI toolkit for opencv_highgui module.
 
@@ -140,6 +141,25 @@ comment "qt5 support needs qt5"
 
 endchoice
 
+config BR2_PACKAGE_OPENCV_WITH_OPENGL
+	bool "opengl support"
+	# OpenGL support done using Qt5OpenGL, so depends on WITH_QT5
+	depends on BR2_PACKAGE_OPENCV_WITH_QT5
+	# OpenGL support requires Qt5OpenGL with GL support, not GLES
+	depends on BR2_PACKAGE_QT5_GL_AVAILABLE
+	depends on BR2_PACKAGE_HAS_LIBGL
+	select BR2_PACKAGE_QT5BASE_OPENGL
+	help
+	  Enable OpenGL for UI.
+
+comment "opengl support needs an OpenGL provider"
+	depends on BR2_PACKAGE_OPENCV_WITH_QT5
+	depends on !BR2_PACKAGE_QT5_GL_AVAILABLE || \
+		!BR2_PACKAGE_HAS_LIBGL
+
+endif # BR2_PACKAGE_OPENCV_LIB_HIGHGUI
+
+
 config BR2_PACKAGE_OPENCV_LIB_IMGCODECS
 	bool "imgcodecs"
 	select BR2_PACKAGE_OPENCV_LIB_IMGPROC
diff --git a/package/opencv/opencv.mk b/package/opencv/opencv.mk
index c788aeb..bb1bcd8 100644
--- a/package/opencv/opencv.mk
+++ b/package/opencv/opencv.mk
@@ -264,6 +264,13 @@ else
 OPENCV_CONF_OPTS += -DWITH_JPEG=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_OPENGL),y)
+OPENCV_CONF_OPTS += -DWITH_OPENGL=ON
+OPENCV_DEPENDENCIES += libgl
+else
+OPENCV_CONF_OPTS += -DWITH_OPENGL=OFF
+endif
+
 OPENCV_CONF_OPTS += -DWITH_OPENMP=$(if $(BR2_GCC_ENABLE_OPENMP),ON,OFF)
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_PNG),y)
-- 
2.4.5

  parent reply	other threads:[~2015-07-05  9:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-05  9:40 [Buildroot] [PATCH v8 0/7] OpenCV bump Samuel Martin
2015-07-05  9:40 ` [Buildroot] [PATCH v8 1/7] package/opencv: add a choice for selecting gstreamer support Samuel Martin
2015-07-05 12:51   ` Thomas Petazzoni
2015-07-05  9:40 ` [Buildroot] [PATCH v8 2/7] package/opencv: add gstreamer-1.x support Samuel Martin
2015-07-05  9:49   ` Yann E. MORIN
2015-07-05 12:51   ` Thomas Petazzoni
2015-07-05  9:40 ` [Buildroot] [PATCH v8 3/7] package/opencv: add a choice for selecting the gui toolkit Samuel Martin
2015-07-05 12:53   ` Thomas Petazzoni
2015-07-05 12:56     ` Samuel Martin
2015-07-05  9:40 ` [Buildroot] [PATCH v8 4/7] package/opencv: add qt5 support Samuel Martin
2015-07-05 12:57   ` Thomas Petazzoni
2015-07-05 13:01     ` Samuel Martin
2015-07-05 13:33       ` Thomas Petazzoni
2015-07-05  9:40 ` [Buildroot] [PATCH v8 5/7] package/opencv: add gtk3 support Samuel Martin
2015-07-05 12:59   ` Thomas Petazzoni
2015-07-05 13:07     ` Samuel Martin
2015-07-05  9:40 ` Samuel Martin [this message]
2015-07-05  9:40 ` [Buildroot] [PATCH v8 7/7] package/vlc: add opencv support Samuel Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436089229-21103-7-git-send-email-s.martin49@gmail.com \
    --to=s.martin49@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox