Skip to contentSkip to conversation

OpenCV bump

PATCH New Samuel Martin 3 participants 15 messages Nov 11, 2013 – Nov 15, 2013

lore
Share & tools
lore
#0 lore raw

cover OpenCV bump

All,

Here is a couple packages bumps and fixes related to OpenCV.

- Patches 1 and 2 are fairly independent of the rest, though still related.

- Patches 3 and 4 are coupled: the new dependency in opencv requires the install rules fix in eigen.

- Patches 5 to 7 just bumps opencv and update a few dependencies.

Yours,
Samuel

Samuel Martin (7):
cmake: bump to version 2.8.12.1
eigen: add C++ toolchain dependency
eigen: fix install rules
opencv: add eigen dependency
opencv: bump to version 2.4.7
opencv: rework V4L/libv4l support
opencv: add Qt5 support

 package/cmake/cmake.mk   |  2 +-
 package/eigen/Config.in  |  4 ++++
 package/eigen/eigen.mk   | 10 ++++++++--
 package/opencv/Config.in | 52 +++++++++++++++++++++++++++++++++++++-----------
 package/opencv/opencv.mk | 33 ++++++++++++++++++++----------
 5 files changed, 76 insertions(+), 25 deletions(-)

--
1.8.4.2

#1 lore raw

PATCH 1/7 cmake: bump to version 2.8.12.1

---
 package/cmake/cmake.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/cmake/cmake.mk +1 -1
index fd1cdd2..cd98ed3 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-CMAKE_VERSION = 2.8.10.2
+CMAKE_VERSION = 2.8.12.1
 CMAKE_SITE = http://www.cmake.org/files/v2.8/
 CMAKE_LICENSE = BSD-3c
 CMAKE_LICENSE_FILES = Copyright.txt
Signature · 1 line
1.8.4.2
#2 lore raw

PATCH 2/7 eigen: add C++ toolchain dependency

In reply to Samuel Martin

As said in its help text, eigen heavily uses C++ features. So, explicit this dependency in the Config.in.

---
 package/eigen/Config.in | 4 ++++
 1 file changed, 4 insertions(+)
package/eigen/Config.in +4 -0
index c7fcde2..e94f9a3 100644
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_EIGEN
 	bool "eigen"
+	depends on BR2_INSTALL_LIBSTDCPP
 	help
 	  Eigen is a C++ template library for linear algebra: vectors,
 	  matrices, and related algorithms. It is versatile, fast, elegant
@@ -11,3 +12,6 @@ config BR2_PACKAGE_EIGEN
 	  template library defined in the headers.
 
 	  http://eigen.tuxfamily.org/
+
+comment "eigen needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
Signature · 1 line
1.8.4.2
#3 lore raw

PATCH 2/7 eigen: add C++ toolchain dependency

Quoted 4 lines · Samuel Martin

As said in its help text, eigen heavily uses C++ features. So, explicit this dependency in the Config.in.

Quoted 23 lines
---
  package/eigen/Config.in | 4 ++++
  1 file changed, 4 insertions(+)
package/eigen/Config.in +4 -0
index c7fcde2..e94f9a3 100644
@@ -1,5 +1,6 @@
  config BR2_PACKAGE_EIGEN
  	bool "eigen"
+	depends on BR2_INSTALL_LIBSTDCPP
  	help
  	  Eigen is a C++ template library for linear algebra: vectors,
  	  matrices, and related algorithms. It is versatile, fast, elegant
@@ -11,3 +12,6 @@ config BR2_PACKAGE_EIGEN
  	  template library defined in the headers.
 
  	  http://eigen.tuxfamily.org/
+
+comment "eigen needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#4 lore raw

PATCH 3/7 eigen: fix install rules

In reply to Samuel Martin

Eigen provides a set of headers well-supported (in the Eigen directory), and another one provided release "as-is", ie. with no real support according to the README.txt; though other package may depend on these headers.

Also, remove unnecessary files from installation:
- CMakeLists.txt files since the package does not use the cmake infra;
- doc sources;
- test and bench sources.

---
 package/eigen/eigen.mk | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
package/eigen/eigen.mk +8 -2
index 5abd464..63e21e9 100644
@@ -16,8 +16,14 @@ EIGEN_INSTALL_TARGET = NO
 # This package only consists of headers that need to be
 # copied over to the sysroot for compile time use
 define EIGEN_INSTALL_STAGING_CMDS
-	$(RM) -r $(STAGING_DIR)/usr/include/Eigen
-	cp -a $(@D)/Eigen $(STAGING_DIR)/usr/include/
+	for d in Eigen unsupported ; do \
+		$(RM) -r $(STAGING_DIR)/usr/include/$${d} ; \
+		rsync -ar --exclude=CMakeLists.txt \
+			--exclude=test \
+			--exclude=bench \
+			--exclude=doc \
+			$(@D)/$${d} $(STAGING_DIR)/usr/include/ ; \
+	done
 endef
 
 $(eval $(generic-package))
Signature · 1 line
1.8.4.2
#5 lore raw

PATCH 3/7 eigen: fix install rules

Dear Samuel Martin,

package/eigen/eigen.mk EIGEN_INSTALL_TARGET = NO · line 20

Quoted 12 lines · Samuel Martin
package/eigen/eigen.mk +2 -2
index 5abd464..63e21e9 100644
@@ -16,8 +16,14 @@ EIGEN_INSTALL_TARGET = NO
 # This package only consists of headers that need to be
 # copied over to the sysroot for compile time use
 define EIGEN_INSTALL_STAGING_CMDS
-	$(RM) -r $(STAGING_DIR)/usr/include/Eigen
-	cp -a $(@D)/Eigen $(STAGING_DIR)/usr/include/
+	for d in Eigen unsupported ; do \
+		$(RM) -r $(STAGING_DIR)/usr/include/$${d} ; \

Isn't it a bit "rude" to remove $(STAGING_DIR)/usr/include/unsupported ? I mean, this directory name doesn't seem very Eigen specific. Even though it's unlikely, there might be other things installed in there.

package/eigen/eigen.mk EIGEN_INSTALL_TARGET = NO · line 26

Quoted 6 lines
package/eigen/eigen.mk +6 -0
+		rsync -ar --exclude=CMakeLists.txt \
+			--exclude=test \
+			--exclude=bench \
+			--exclude=doc \
+			$(@D)/$${d} $(STAGING_DIR)/usr/include/ ; \
+	done

I must say I'm not overly enthusiastic about this solution. No way to have a proper make install, or cmake stuff working for this package?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#6 lore raw

PATCH 3/7 eigen: fix install rules

Quoted 22 lines · Thomas Petazzoni

Dear Samuel Martin,

package/eigen/eigen.mk EIGEN_INSTALL_TARGET = NO · line 20

Quoted 12 lines · Samuel Martin
package/eigen/eigen.mk +2 -2
index 5abd464..63e21e9 100644
@@ -16,8 +16,14 @@ EIGEN_INSTALL_TARGET = NO
  # This package only consists of headers that need to be
  # copied over to the sysroot for compile time use
  define EIGEN_INSTALL_STAGING_CMDS
-	$(RM) -r $(STAGING_DIR)/usr/include/Eigen
-	cp -a $(@D)/Eigen $(STAGING_DIR)/usr/include/
+	for d in Eigen unsupported ; do \
+		$(RM) -r $(STAGING_DIR)/usr/include/$${d} ; \

Isn't it a bit "rude" to remove $(STAGING_DIR)/usr/include/unsupported ? I mean, this directory name doesn't seem very Eigen specific. Even though it's unlikely, there might be other things installed in there.

Quoted 9 lines

package/eigen/eigen.mk EIGEN_INSTALL_TARGET = NO · line 26

Quoted 6 lines
package/eigen/eigen.mk +6 -0
+		rsync -ar --exclude=CMakeLists.txt \
+			--exclude=test \
+			--exclude=bench \
+			--exclude=doc \
+			$(@D)/$${d} $(STAGING_DIR)/usr/include/ ; \
+	done

I must say I'm not overly enthusiastic about this solution. No way to have a proper make install, or cmake stuff working for this package?

I had a quick look, and it looks like the cmake infra should work for
this package. I guess Matt Weber originally didn't use it because nothing needs to be compiled anyway, and you don't want to compile the tests.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#7 lore raw

PATCH 3/7 eigen: fix install rules

Thomas, Arnout, all,

Eigen is one of the rare package that does not support in-source-tree build. But this can be worked around quite easily.

Also, after a (not so) quick look at the cmake from the eigen package, most of the
check/test/bench/doc/... builds can be disabled, but not all (need to be confirmed).

BTW, Thomas, what is the status of your work on out-of-source-tree build?

2013/11/12 Arnout Vandecappelle <[email protected]>

Quoted 25 lines · Thomas Petazzoni
Quoted 15 lines

Dear Samuel Martin,

On Mon, 11 Nov 2013 22:00:09 +0100, Samuel Martin wrote:

diff --git a/package/eigen/eigen.mk b/package/eigen/eigen.mk

Quoted 9 lines

index 5abd464..63e21e9 100644

package/eigen/eigen.mk +0 -2
@@ -16,8 +16,14 @@ EIGEN_INSTALL_TARGET = NO
  # This package only consists of headers that need to be
  # copied over to the sysroot for compile time use
  define EIGEN_INSTALL_STAGING_CMDS
-       $(RM) -r $(STAGING_DIR)/usr/include/Eigen
-       cp -a $(@D)/Eigen $(STAGING_DIR)/usr/include/
Quoted 9 lines

package/eigen/eigen.mk EIGEN_INSTALL_TARGET = NO · line 28

Quoted 3 lines
package/eigen/eigen.mk +2 -0
+       for d in Eigen unsupported ; do \
+               $(RM) -r $(STAGING_DIR)/usr/include/$${d} ; \
 

Isn't it a bit "rude" to remove $(STAGING_DIR)/usr/include/unsupported ? I mean, this directory name doesn't seem very Eigen specific. Even though it's unlikely, there might be other things installed in there.

Quoted 16 lines

Indeed.

Quoted 11 lines

+ rsync -ar --exclude=CMakeLists.txt \

package/eigen/eigen.mk EIGEN_INSTALL_TARGET = NO · line 28

Quoted 6 lines
package/eigen/eigen.mk +5 -0
+                       --exclude=test \
+                       --exclude=bench \
+                       --exclude=doc \
+                       $(@D)/$${d} $(STAGING_DIR)/usr/include/ ; \
+       done
 

I must say I'm not overly enthusiastic about this solution. No way to have a proper make install, or cmake stuff working for this package?

We might wonder why using a "heavy" build-system like CMake just to install a couple
of header.

That's true among the build-system I know/use I do prefer CMake, and in past I already
got patches refused because I moved them to the cmake infra... Anyway, it just surprises me a bit that Thomas plays the devil advocate for CMake, who
usually prefers simple/light solutions ;-)

Quoted 4 lines

I had a quick look, and it looks like the cmake infra should work for
this package. I guess Matt Weber originally didn't use it because nothing needs to be compiled anyway, and you don't want to compile the tests.

I think so as well.

Regards,

Signature · 4 lines
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20131112/4239c576/attachment.html>
#8 lore raw

PATCH 3/7 eigen: fix install rules

2013/11/12 Samuel Martin <[email protected]>

Quoted 6 lines

Thomas, Arnout, all,

Eigen is one of the rare package that does not support in-source-tree build.
But this can be worked around quite easily.

Quoted 28 lines

Also, after a (not so) quick look at the cmake from the eigen package, most of the
check/test/bench/doc/... builds can be disabled, but not all (need to be confirmed).

BTW, Thomas, what is the status of your work on out-of-source-tree build?

2013/11/12 Arnout Vandecappelle <[email protected]>

Quoted 19 lines · Thomas Petazzoni
Quoted 18 lines

Dear Samuel Martin,

On Mon, 11 Nov 2013 22:00:09 +0100, Samuel Martin wrote:

diff --git a/package/eigen/eigen.mk b/package/eigen/eigen.mk

package/eigen/eigen.mk EIGEN_INSTALL_TARGET = NO · line 20

Quoted 11 lines

index 5abd464..63e21e9 100644

package/eigen/eigen.mk +1 -2
@@ -16,8 +16,14 @@ EIGEN_INSTALL_TARGET = NO
  # This package only consists of headers that need to be
  # copied over to the sysroot for compile time use
  define EIGEN_INSTALL_STAGING_CMDS
-       $(RM) -r $(STAGING_DIR)/usr/include/Eigen
-       cp -a $(@D)/Eigen $(STAGING_DIR)/usr/include/
+       for d in Eigen unsupported ; do \
 

Installing the unsupported directory was mainly for opencv.

Since, I rejected the opencv patch, there no need anymore for this one, so, I rejected it too.
If someone someday needs it, it will still be in the ml archive and in patchwork.

Regards,

Signature · 4 lines
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20131115/0a607dc1/attachment-0001.html>
#9 lore raw

PATCH 4/7 opencv: add eigen dependency

In reply to Samuel Martin
---
 package/opencv/Config.in | 1 +
 package/opencv/opencv.mk | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
package/opencv/Config.in +1 -0
index 146011a..5b970e8 100644
@@ -1,6 +1,7 @@
 menuconfig BR2_PACKAGE_OPENCV
 	bool "opencv"
 	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_EIGEN
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_USE_WCHAR
 	help
package/opencv/opencv.mk +2 -2
index b9ed8cb..8556272 100644
@@ -88,7 +88,7 @@ OPENCV_CONF_OPT += \
 	-DWITH_CUBLAS=OFF         \
 	-DWITH_CUDA=OFF           \
 	-DWITH_CUFFT=OFF          \
-	-DWITH_EIGEN=OFF          \
+	-DWITH_EIGEN=ON           \
 	-DWITH_IMAGEIO=OFF        \
 	-DWITH_IPP=OFF            \
 	-DWITH_JASPER=OFF         \
@@ -103,7 +103,7 @@ OPENCV_CONF_OPT += \
 	-DWITH_XIMEA=OFF          \
 	-DWITH_XINE=OFF
 
-OPENCV_DEPENDENCIES += zlib
+OPENCV_DEPENDENCIES += zlib eigen
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_FFMPEG),y)
 OPENCV_CONF_OPT += -DWITH_FFMPEG=ON
Signature · 1 line
1.8.4.2
#10 lore raw

PATCH 4/7 opencv: add eigen dependency

Dear Samuel Martin,

package/opencv/Config.in line 4

Quoted 4 lines · Samuel Martin

menuconfig BR2_PACKAGE_OPENCV

package/opencv/Config.in +1 -0
 	bool "opencv"
 	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_EIGEN

Any reason to make it mandatory?

I'm sorry but I'm going to be a bit angry again. I've asked you many, many, many times to write more descriptive commit logs. And once again, several of your patches have just a one line title, with no explanation whatsoever about *why* you're doing the change.

It would be really nice if you could review all your patches before you post them, and ask yourself the question: is the reason why I'm doing this going to be obvious for the reviewer? If the answer is even on the slightly unsure side, then it means you need to expand with a more detailed commit log, or more comments in the code.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#11 lore raw

PATCH 4/7 opencv: add eigen dependency

2013/11/11 Thomas Petazzoni <[email protected]>

Quoted 10 lines

Dear Samuel Martin,

Quoted 4 lines · Samuel Martin

menuconfig BR2_PACKAGE_OPENCV
bool "opencv"
select BR2_PACKAGE_ZLIB
+ select BR2_PACKAGE_EIGEN

Any reason to make it mandatory?

After checking with some opencv developers, eigen support does not bring that much
(neither in term of features, nor perfs).

So I've rejected it.

Quoted 20 lines

I'm sorry but I'm going to be a bit angry again. I've asked you many, many, many times to write more descriptive commit logs. And once again, several of your patches have just a one line title, with no explanation whatsoever about *why* you're doing the change.

It would be really nice if you could review all your patches before you post them, and ask yourself the question: is the reason why I'm doing this going to be obvious for the reviewer? If the answer is even on the slightly unsure side, then it means you need to expand with a more detailed commit log, or more comments in the code.

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

Signature · 4 lines
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20131115/2401e6ab/attachment.html>
#12 lore raw

PATCH 5/7 opencv: bump to version 2.4.7

In reply to Samuel Martin

This patch bumps OpenCV version without adding support for Qt5 though OpenCV support both Qt4 and Qt5 since this 2.4.6 release. This will be addressed in others patches.

This patch also does:
- add new modules options and update existing ones;
- clean redundant C++ dependency (in the Qt knob);
- add license details;
- explicitly disable python support to avoid being confuse by the one from the host.

---
 package/opencv/Config.in | 12 +++++++++---
 package/opencv/opencv.mk | 21 +++++++++++++++------
 2 files changed, 24 insertions(+), 9 deletions(-)
package/opencv/Config.in +9 -3
index 5b970e8..bd466ca 100644
@@ -98,6 +98,13 @@ config BR2_PACKAGE_OPENCV_LIB_STITCHING
 	help
 	  Include opencv_stitching module into the OpenCV build.
 
+config BR2_PACKAGE_OPENCV_LIB_SUPERRES
+	bool "superres"
+	default y
+	help
+	  Include opencv_superres "super resolution" - module into the OpenCV
+	  build.
+
 config BR2_PACKAGE_OPENCV_LIB_TS
 	bool "ts (touchscreen)"
 	default y
@@ -170,14 +177,13 @@ config BR2_PACKAGE_OPENCV_WITH_PNG
 	  Use shared libpng from the target system.
 
 config BR2_PACKAGE_OPENCV_WITH_QT
-	bool "qt backend support"
-	depends on BR2_INSTALL_LIBSTDCPP
+	bool "qt4 backend support"
 	depends on !BR2_avr32 # qt
 	select BR2_PACKAGE_QT
 	select BR2_PACKAGE_QT_STL
 	default y
 	help
-	  Use Qt with STL support
+	  Use Qt4 with STL support
 
 config BR2_PACKAGE_OPENCV_WITH_TIFF
 	bool "tiff support"
package/opencv/opencv.mk +15 -6
index 8556272..c53d984 100644
@@ -4,10 +4,11 @@
 #
 ################################################################################
 
-OPENCV_VERSION = 2.4.2
+OPENCV_VERSION = 2.4.7
 OPENCV_SITE    = http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/$(OPENCV_VERSION)
-OPENCV_SOURCE  = OpenCV-$(OPENCV_VERSION).tar.bz2
 OPENCV_INSTALL_STAGING = YES
+OPENCV_LICENSE = BSD-3c
+OPENCV_LICENSE_FILES = doc/license.txt
 
 OPENCV_CONF_OPT += \
 	-DCMAKE_BUILD_TYPE=$(if $(BR2_ENABLE_DEBUG),Debug,Release)   \
@@ -19,6 +20,7 @@ OPENCV_CONF_OPT += \
 	-DBUILD_TESTS=$(if $(BR2_PACKAGE_OPENCV_BUILD_TESTS),ON,OFF) \
 	-DBUILD_PERF_TESTS=$(if $(BR2_PACKAGE_OPENCV_BUILD_PERF_TESTS),ON,OFF) \
 	-DBUILD_WITH_DEBUG_INFO=OFF             \
+	-DINSTALL_CREATE_DISTRIB=OFF            \
 	-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=OFF \
 	-DCMAKE_SKIP_RPATH=OFF                  \
 	-DCMAKE_USE_RELATIVE_PATHS=OFF          \
@@ -47,13 +49,19 @@ OPENCV_CONF_OPT += \
 	-DBUILD_opencv_nonfree=$(if $(BR2_PACKAGE_OPENCV_LIB_NONFREE),ON,OFF)   \
 	-DBUILD_opencv_objdetect=$(if $(BR2_PACKAGE_OPENCV_LIB_OBJDETECT),ON,OFF) \
 	-DBUILD_opencv_photo=$(if $(BR2_PACKAGE_OPENCV_LIB_PHOTO),ON,OFF)       \
-	-DBUILD_opencv_python=OFF                                               \
 	-DBUILD_opencv_stitching=$(if $(BR2_PACKAGE_OPENCV_LIB_STITCHING),ON,OFF) \
+	-DBUILD_opencv_superres=$(if $(BR2_PACKAGE_OPENCV_LIB_SUPERRES),ON,OFF) \
 	-DBUILD_opencv_ts=$(if $(BR2_PACKAGE_OPENCV_LIB_TS),ON,OFF)             \
 	-DBUILD_opencv_video=$(if $(BR2_PACKAGE_OPENCV_LIB_VIDEO),ON,OFF)       \
 	-DBUILD_opencv_videostab=$(if $(BR2_PACKAGE_OPENCV_LIB_VIDEOSTAB),ON,OFF) \
 	-DBUILD_opencv_world=OFF
 
+# Explicitly disable python to avoid confusing OpenCV, which comes with its
+# own implementation of the Python detection CMake module.
+OPENCV_CONF_OPT += \
+	-DBUILD_opencv_python=OFF \
+	-DPYTHON_EXECUTABLE=OFF
+
 # Hardware support options.
 #
 # * PowerPC support is turned off since its only effect is altering CFLAGS,
@@ -94,6 +102,7 @@ OPENCV_CONF_OPT += \
 	-DWITH_JASPER=OFF         \
 	-DWITH_OPENEXR=OFF        \
 	-DWITH_OPENGL=OFF         \
+	-DWITH_OPENMP=OFF         \
 	-DWITH_OPENNI=OFF         \
 	-DWITH_PVAPI=OFF          \
 	-DWITH_QUICKTIME=OFF      \
@@ -141,7 +150,7 @@ OPENCV_CONF_OPT += -DWITH_PNG=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT),y)
-OPENCV_CONF_OPT += -DWITH_QT=ON
+OPENCV_CONF_OPT += -DWITH_QT=4
 OPENCV_DEPENDENCIES += qt
 else
 OPENCV_CONF_OPT += -DWITH_QT=OFF
@@ -155,10 +164,10 @@ OPENCV_CONF_OPT += -DWITH_TIFF=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_V4L),y)
-OPENCV_CONF_OPT += -DWITH_V4L=ON
+OPENCV_CONF_OPT += -DWITH_V4L=ON -DWITH_LIBV4L=ON
 OPENCV_DEPENDENCIES += libv4l
 else
-OPENCV_CONF_OPT += -DWITH_V4L=OFF
+OPENCV_CONF_OPT += -DWITH_V4L=OFF -DWITH_LIBV4L=OFF
 endif
 
 # Installation hooks:
Signature · 1 line
1.8.4.2
#13 lore raw

PATCH 6/7 opencv: rework V4L/libv4l support

In reply to Samuel Martin

Starting with the 2.4.7 release, for V4L support, OpenCV does not requires a libv4l dependency for its V4L support.

SO, it now provides 2 distincts knobs for this: WITH_V4L and a new
one: WITH_LIBV4L.

This patch takes advantage of this new knob and libv4l support is now automatically enabled if only the libv4l package is enabled.

---
 package/opencv/Config.in | 11 ++++++-----
 package/opencv/opencv.mk | 10 +++++++---
 2 files changed, 13 insertions(+), 8 deletions(-)
package/opencv/Config.in +6 -5
index bd466ca..a4342da 100644
@@ -193,14 +193,15 @@ config BR2_PACKAGE_OPENCV_WITH_TIFF
 
 config BR2_PACKAGE_OPENCV_WITH_V4L
 	bool "v4l support"
-	depends on BR2_LARGEFILE
-	depends on BR2_TOOLCHAIN_HAS_THREADS
-	select BR2_PACKAGE_LIBV4L
 	help
 	  Enable Video 4 Linux support.
 
-comment "v4l support needs a toolchain w/ largefile, threads"
-	depends on !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS
+	  If the package libv4l is enabled, its support is automatically enabled.
+
+if BR2_PACKAGE_OPENCV_WITH_V4L && !(BR2_LARGEFILE && BR2_TOOLCHAIN_HAS_THREADS)
+comment "libv4l support will be disabled."
+comment "libv4l support needs a toolchain w/ largefile, threads"
+endif
 
 comment "Install options"
 
package/opencv/opencv.mk +7 -3
index c53d984..bbaba72 100644
@@ -164,10 +164,14 @@ OPENCV_CONF_OPT += -DWITH_TIFF=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_V4L),y)
-OPENCV_CONF_OPT += -DWITH_V4L=ON -DWITH_LIBV4L=ON
-OPENCV_DEPENDENCIES += libv4l
+OPENCV_CONF_OPT += \
+	-DWITH_V4L=ON \
+	-DWITH_LIBV4L=$(if $(BR2_PACKAGE_LIBV4L),ON,OFF)
+OPENCV_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBV4L),libv4l)
 else
-OPENCV_CONF_OPT += -DWITH_V4L=OFF -DWITH_LIBV4L=OFF
+OPENCV_CONF_OPT += \
+	-DWITH_V4L=OFF \
+	-DWITH_LIBV4L=OFF
 endif
 
 # Installation hooks:
Signature · 1 line
1.8.4.2
#14 lore raw

PATCH 7/7 opencv: add Qt5 support

In reply to Samuel Martin

Starting with the 2.4.6 release, OpenCV supports both Qt4 and Qt5, but only one can be enable at the same time.

Since Buildroot does not support Qt4/Qt5 co-existence, we keep the Qt support knob as a boolean, but make it depend on BR2_PACKAGE_QT or BR2_PACKAGE_QT5, and automatically uses the enabled one.

Note that we usually use 'select ...' to express the dependencies between packages, but in this case, we cannot since the Qt4/Qt5 co-existence exclusion is not handled by a simple choice, but by a dependency. This makes impossible using 'select ...' for the Qt support knob without triggering a circular dependency at the kconfig level.

Besides, we already use 'depends on ...' to express the dependencies with some "big" packages (like xorg or libgtk2). qt or qt5* packages are fairly big. So, I don't think it will hurt that much to use a 'depends on ...' statement in this case.

---
 package/opencv/Config.in | 32 ++++++++++++++++++++++++++------
 package/opencv/opencv.mk |  4 ++--
 2 files changed, 28 insertions(+), 8 deletions(-)
package/opencv/Config.in +26 -6
index a4342da..656d6b8 100644
@@ -177,13 +177,33 @@ config BR2_PACKAGE_OPENCV_WITH_PNG
 	  Use shared libpng from the target system.
 
 config BR2_PACKAGE_OPENCV_WITH_QT
-	bool "qt4 backend support"
-	depends on !BR2_avr32 # qt
-	select BR2_PACKAGE_QT
-	select BR2_PACKAGE_QT_STL
-	default y
+	bool "qt support"
+	depends on (BR2_PACKAGE_QT && !BR2_avr32) || \
+		(BR2_PACKAGE_QT5 && BR2_USE_MMU && BR2_INET_IPV6 && \
+		BR2_TOOLCHAIN_HAS_THREADS)
+	select BR2_PACKAGE_QT_STL             if BR2_PACKAGE_QT
+	select BR2_PACKAGE_QT5BASE            if BR2_PACKAGE_QT5
+	select BR2_PACKAGE_QT5BASE_CONCURRENT if BR2_PACKAGE_QT5
+	select BR2_PACKAGE_QT5BASE_TEST       if BR2_PACKAGE_QT5
+	select BR2_PACKAGE_QT5BASE_GUI        if BR2_PACKAGE_QT5
+	select BR2_PACKAGE_QT5BASE_WIDGETS    if BR2_PACKAGE_QT5
 	help
-	  Use Qt4 with STL support
+	  Enable Qt support for OpenCV.
+
+	  If Qt4 is already enabled, then use Qt4 with STL support.
+
+	  If Qt5 is already enabled, then use Qt5 with the following components:
+	  base, concurrent, test, gui and widgets.
+
+if !BR2_PACKAGE_QT && !BR2_PACKAGE_QT5
+comment "qt support with Qt4 needs qt"
+
+comment "qt support with Qt5 needs qt5"
+	depends on BR2_USE_MMU && BR2_INET_IPV6 && BR2_TOOLCHAIN_HAS_THREADS
+
+comment "qt support with Qt5 needs a toolchain w/ wchar, IPv6, theads"
+	depends on !BR2_USE_MMU || !BR2_INET_IPV6 || !BR2_TOOLCHAIN_HAS_THREADS
+endif
 
 config BR2_PACKAGE_OPENCV_WITH_TIFF
 	bool "tiff support"
package/opencv/opencv.mk +2 -2
index bbaba72..d4565ca 100644
@@ -150,8 +150,8 @@ OPENCV_CONF_OPT += -DWITH_PNG=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT),y)
-OPENCV_CONF_OPT += -DWITH_QT=4
-OPENCV_DEPENDENCIES += qt
+OPENCV_CONF_OPT += -DWITH_QT=$(if $(BR2_PACKAGE_QT),4,5)
+OPENCV_DEPENDENCIES += $(if $(BR2_PACKAGE_QT),qt,qt5base)
 else
 OPENCV_CONF_OPT += -DWITH_QT=OFF
 endif
Signature · 1 line
1.8.4.2