Ver Fonte

package/opencv3: use external protobuf instead of bundled one

Since version 3.3.0 and its commit
https://github.com/opencv/opencv/commit/1c4c58d1b5b7430463281e8c8072e04245f561b0,
opencv3 bundles its own copy of protobuf. Instead of using the bundled
protobuf library, this commit disables building protobuf
(BUILD_PROTOBUF=OFF) and instead uses the protobuf Buildroot package
(using the WITH_PROTOBUF=ON/OFF option).

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Fabrice Fontaine há 5 anos atrás
pai
commit
31c68a449e
2 ficheiros alterados com 20 adições e 0 exclusões
  1. 12 0
      package/opencv3/Config.in
  2. 8 0
      package/opencv3/opencv3.mk

+ 12 - 0
package/opencv3/Config.in

@@ -307,6 +307,18 @@ config BR2_PACKAGE_OPENCV3_WITH_PNG
 	help
 	help
 	  Use shared libpng from the target system.
 	  Use shared libpng from the target system.
 
 
+config BR2_PACKAGE_OPENCV3_WITH_PROTOBUF
+	bool "protobuf support"
+	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # protobuf
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # protobuf
+	select BR2_PACKAGE_PROTOBUF
+	help
+	  Use shared protobuf from the target system.
+
+comment "protobuf support needs a toolchain w/ gcc >= 4.8"
+	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+
 config BR2_PACKAGE_OPENCV3_WITH_TIFF
 config BR2_PACKAGE_OPENCV3_WITH_TIFF
 	bool "tiff support"
 	bool "tiff support"
 	select BR2_PACKAGE_TIFF
 	select BR2_PACKAGE_TIFF

+ 8 - 0
package/opencv3/opencv3.mk

@@ -193,6 +193,7 @@ OPENCV3_CONF_OPTS += \
 	-DBUILD_JPEG=OFF \
 	-DBUILD_JPEG=OFF \
 	-DBUILD_OPENEXR=OFF \
 	-DBUILD_OPENEXR=OFF \
 	-DBUILD_PNG=OFF \
 	-DBUILD_PNG=OFF \
+	-DBUILD_PROTOBUF=OFF \
 	-DBUILD_TIFF=OFF \
 	-DBUILD_TIFF=OFF \
 	-DBUILD_ZLIB=OFF \
 	-DBUILD_ZLIB=OFF \
 	-DINSTALL_C_EXAMPLES=OFF \
 	-DINSTALL_C_EXAMPLES=OFF \
@@ -288,6 +289,13 @@ else
 OPENCV3_CONF_OPTS += -DWITH_PNG=OFF
 OPENCV3_CONF_OPTS += -DWITH_PNG=OFF
 endif
 endif
 
 
+ifeq ($(BR2_PACKAGE_OPENCV3_WITH_PROTOBUF),y)
+OPENCV3_CONF_OPTS += -DWITH_PROTOBUF=ON
+OPENCV3_DEPENDENCIES += protobuf
+else
+OPENCV3_CONF_OPTS += -DWITH_PROTOBUF=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_OPENCV3_WITH_QT5),y)
 ifeq ($(BR2_PACKAGE_OPENCV3_WITH_QT5),y)
 OPENCV3_CONF_OPTS += -DWITH_QT=5
 OPENCV3_CONF_OPTS += -DWITH_QT=5
 OPENCV3_DEPENDENCIES += qt5base
 OPENCV3_DEPENDENCIES += qt5base