package/opencv: add qt5 support
authorSamuel Martin <s.martin49@gmail.com>
Sun, 5 Jul 2015 21:54:46 +0000 (23:54 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 6 Jul 2015 09:50:00 +0000 (11:50 +0200)
Starting with the 2.4.6 release, OpenCV supports either Qt4 or Qt5 as GUI
toolkit, so add Qt5 in the GUI toolkit choice.

When Qt4 is enabled (and thus Qt5 is hidden and disabled), no need to
show a comment stating "Qt5 support needs Qt5", because Qt5 is not
selectable.

Conversely, when Qt5 is enabled and Qt4 is not, then no need to show a
comment stating "Qt4 support needs Qt4", because enabling Qt4 would
disable Qt5.

So, we only show the comments when neither toolkit is enabled.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
[yann.morin.1998@free.fr: split-out the Qt5 hunk from the
 switch-selects-to-depends hunk]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/opencv/Config.in
package/opencv/opencv.mk

index 5dd39ca8da03e24169721ec465298b32a9fa7355..5e8f189457d39c47951ed0f34e293a4e75df5807 100644 (file)
@@ -81,7 +81,21 @@ config BR2_PACKAGE_OPENCV_WITH_QT
 
 comment "qt4 support needs qt"
        depends on BR2_USE_MMU # qt
-       depends on !BR2_PACKAGE_QT
+       depends on !BR2_PACKAGE_QT && !BR2_PACKAGE_QT5
+
+config BR2_PACKAGE_OPENCV_WITH_QT5
+       bool "qt5"
+       depends on BR2_PACKAGE_QT5
+       select BR2_PACKAGE_QT5BASE
+       select BR2_PACKAGE_QT5BASE_CONCURRENT
+       select BR2_PACKAGE_QT5BASE_GUI
+       select BR2_PACKAGE_QT5BASE_WIDGETS
+       help
+         Use Qt5 with base, concurrent, test, gui and widgets components, as GUI
+         toolkit.
+
+comment "qt5 support needs qt5"
+       depends on !BR2_PACKAGE_QT && !BR2_PACKAGE_QT5
 
 endchoice
 
index 0e5cf7746c99a032b0a671d18f328d32602312fa..98e1614f2a33a549905a2e79bd220c6146410a62 100644 (file)
@@ -266,11 +266,18 @@ else
 OPENCV_CONF_OPTS += -DWITH_PNG=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT)$(BR2_PACKAGE_OPENCV_WITH_QT5),)
+OPENCV_CONF_OPTS += -DWITH_QT=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT),y)
 OPENCV_CONF_OPTS += -DWITH_QT=4
 OPENCV_DEPENDENCIES += qt
-else
-OPENCV_CONF_OPTS += -DWITH_QT=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT5),y)
+OPENCV_CONF_OPTS += -DWITH_QT=5
+OPENCV_DEPENDENCIES += qt5base
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_TIFF),y)