aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>2017-11-08 13:10:25 +0100
committerArmin Kuster <akuster808@gmail.com>2017-11-19 13:41:58 -0800
commitf4da4b7ceb6845fccf28879b411f04dd8a93079c (patch)
treef32170bddb8975ed325f98e2bd9cd8a2f098b5f8
parentf27c6ce6b9b64510587b7e759b35d71fdfd8b29d (diff)
downloadmeta-openembedded-f4da4b7ceb6845fccf28879b411f04dd8a93079c.zip
meta-openembedded-f4da4b7ceb6845fccf28879b411f04dd8a93079c.tar.gz
meta-openembedded-f4da4b7ceb6845fccf28879b411f04dd8a93079c.tar.bz2
opencv: Use OE built Protobuf
When dnn is enabled via PACKAGECONFIG it requires protobuf and protobuf-native. This patch modifies cmake files to detect properly protobuf. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-support/opencv/opencv/protobuf.patch57
-rw-r--r--meta-oe/recipes-support/opencv/opencv_3.3.bb1
2 files changed, 58 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/opencv/opencv/protobuf.patch b/meta-oe/recipes-support/opencv/opencv/protobuf.patch
new file mode 100644
index 0000000..c63dc14
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/opencv/protobuf.patch
@@ -0,0 +1,57 @@
+Upstream-status: Inappropriate [OE specific]
+
+Signed-off-by: Ricardo Ribalda <ricardo.ribalda@gmail.com>
+diff --git a/cmake/OpenCVFindLibProtobuf.cmake b/cmake/OpenCVFindLibProtobuf.cmake
+index b6ce1e7fd56b..e916ec0df2a6 100644
+--- a/cmake/OpenCVFindLibProtobuf.cmake
++++ b/cmake/OpenCVFindLibProtobuf.cmake
+@@ -7,21 +7,21 @@ OCV_OPTION(BUILD_PROTOBUF "Force to build libprotobuf from sources" ON)
+ OCV_OPTION(PROTOBUF_UPDATE_FILES "Force to rebuild .proto files" OFF)
+
+ if(PROTOBUF_UPDATE_FILES)
+- if(NOT DEFINED Protobuf_PROTOC_EXECUTABLE)
++ if(NOT DEFINED PROTOBUF_PROTOC_EXECUTABLE)
+ find_package(Protobuf QUIET)
+ endif()
+- if(DEFINED Protobuf_PROTOC_EXECUTABLE AND EXISTS ${Protobuf_PROTOC_EXECUTABLE})
+- message(STATUS "The protocol buffer compiler is found (${Protobuf_PROTOC_EXECUTABLE})")
++ if(DEFINED PROTOBUF_PROTOC_EXECUTABLE AND EXISTS ${PROTOBUF_PROTOC_EXECUTABLE})
++ message(STATUS "The protocol buffer compiler is found (${PROTOBUF_PROTOC_EXECUTABLE})")
+ else()
+- message(FATAL_ERROR "The protocol buffer compiler is not found (Protobuf_PROTOC_EXECUTABLE='${Protobuf_PROTOC_EXECUTABLE}')")
++ message(FATAL_ERROR "The protocol buffer compiler is not found (PROTOBUF_PROTOC_EXECUTABLE='${PROTOBUF_PROTOC_EXECUTABLE}')")
+ endif()
+ endif()
+
+-if(NOT BUILD_PROTOBUF AND NOT (DEFINED Protobuf_INCLUDE_DIRS AND DEFINED Protobuf_LIBRARIES))
++if(NOT BUILD_PROTOBUF AND NOT (DEFINED PROTOBUF_INCLUDE_DIR AND DEFINED PROTOBUF_LIBRARIES))
+ find_package(Protobuf QUIET)
+ endif()
+
+-if(Protobuf_FOUND)
++if(PROTOBUF_FOUND OR (DEFINED PROTOBUF_INCLUDE_DIR AND DEFINED PROTOBUF_LIBRARIES))
+ # nothing
+ else()
+ set(Protobuf_LIBRARIES libprotobuf)
+diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt
+index 2a71568d1a44..c6329a742263 100644
+--- a/modules/dnn/CMakeLists.txt
++++ b/modules/dnn/CMakeLists.txt
+@@ -7,7 +7,7 @@ if(DEFINED BUILD_opencv_dnn AND NOT BUILD_opencv_dnn)
+ endif()
+
+ include(${OpenCV_SOURCE_DIR}/cmake/OpenCVFindLibProtobuf.cmake)
+-if(NOT Protobuf_FOUND)
++if(NOT PROTOBUF_FOUND)
+ ocv_module_disable(opencv_dnn)
+ endif()
+
+@@ -72,7 +72,7 @@ ocv_source_group("Src\\protobuf" FILES ${Protobuf_SRCS} ${Protobuf_HDRS})
+ ocv_module_include_directories(include ${Protobuf_INCLUDE_DIRS})
+
+ ocv_glob_module_sources(${Protobuf_SRCS} ${Protobuf_HDRS} ${CBLAS_H_PROXY_PATH})
+-ocv_create_module(${Protobuf_LIBRARIES} ${LAPACK_LIBRARIES})
++ocv_create_module(${PROTOBUF_LIBRARIES} ${LAPACK_LIBRARIES})
+ ocv_add_samples()
+ ocv_add_accuracy_tests()
+ ocv_add_perf_tests()
diff --git a/meta-oe/recipes-support/opencv/opencv_3.3.bb b/meta-oe/recipes-support/opencv/opencv_3.3.bb
index bcb17d3..1c398aa 100644
--- a/meta-oe/recipes-support/opencv/opencv_3.3.bb
+++ b/meta-oe/recipes-support/opencv/opencv_3.3.bb
@@ -53,6 +53,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
file://0001-carotene-don-t-use-__asm__-with-aarch64.patch \
file://0002-Do-not-enable-asm-with-clang.patch \
file://CVE-2017-14136.patch \
+ file://protobuf.patch \
"
PV = "3.3+git${SRCPV}"