[oe-commits] [meta-openembedded] 31/41: opencv: Use OE built Protobuf

git at git.openembedded.org git at git.openembedded.org
Sun Nov 19 22:17:41 UTC 2017


This is an automated email from the git hooks/post-receive script.

armin_kuster pushed a commit to branch master
in repository meta-openembedded.

commit f4da4b7ceb6845fccf28879b411f04dd8a93079c
Author: Ricardo Ribalda Delgado <ricardo.ribalda at gmail.com>
AuthorDate: Wed Nov 8 13:10:25 2017 +0100

    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 at gmail.com>
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
 .../recipes-support/opencv/opencv/protobuf.patch   | 57 ++++++++++++++++++++++
 meta-oe/recipes-support/opencv/opencv_3.3.bb       |  1 +
 2 files changed, 58 insertions(+)

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 at 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}"
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list