diff options
author | Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | 2017-11-08 13:10:25 +0100 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2017-11-19 13:41:58 -0800 |
commit | f4da4b7ceb6845fccf28879b411f04dd8a93079c (patch) | |
tree | f32170bddb8975ed325f98e2bd9cd8a2f098b5f8 /meta-oe/recipes-support/opencv | |
parent | f27c6ce6b9b64510587b7e759b35d71fdfd8b29d (diff) | |
download | meta-openembedded-f4da4b7ceb6845fccf28879b411f04dd8a93079c.tar.gz |
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>
Diffstat (limited to 'meta-oe/recipes-support/opencv')
-rw-r--r-- | meta-oe/recipes-support/opencv/opencv/protobuf.patch | 57 | ||||
-rw-r--r-- | meta-oe/recipes-support/opencv/opencv_3.3.bb | 1 |
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 000000000..c63dc142e --- /dev/null +++ b/meta-oe/recipes-support/opencv/opencv/protobuf.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | Upstream-status: Inappropriate [OE specific] | ||
2 | |||
3 | Signed-off-by: Ricardo Ribalda <ricardo.ribalda@gmail.com> | ||
4 | diff --git a/cmake/OpenCVFindLibProtobuf.cmake b/cmake/OpenCVFindLibProtobuf.cmake | ||
5 | index b6ce1e7fd56b..e916ec0df2a6 100644 | ||
6 | --- a/cmake/OpenCVFindLibProtobuf.cmake | ||
7 | +++ b/cmake/OpenCVFindLibProtobuf.cmake | ||
8 | @@ -7,21 +7,21 @@ OCV_OPTION(BUILD_PROTOBUF "Force to build libprotobuf from sources" ON) | ||
9 | OCV_OPTION(PROTOBUF_UPDATE_FILES "Force to rebuild .proto files" OFF) | ||
10 | |||
11 | if(PROTOBUF_UPDATE_FILES) | ||
12 | - if(NOT DEFINED Protobuf_PROTOC_EXECUTABLE) | ||
13 | + if(NOT DEFINED PROTOBUF_PROTOC_EXECUTABLE) | ||
14 | find_package(Protobuf QUIET) | ||
15 | endif() | ||
16 | - if(DEFINED Protobuf_PROTOC_EXECUTABLE AND EXISTS ${Protobuf_PROTOC_EXECUTABLE}) | ||
17 | - message(STATUS "The protocol buffer compiler is found (${Protobuf_PROTOC_EXECUTABLE})") | ||
18 | + if(DEFINED PROTOBUF_PROTOC_EXECUTABLE AND EXISTS ${PROTOBUF_PROTOC_EXECUTABLE}) | ||
19 | + message(STATUS "The protocol buffer compiler is found (${PROTOBUF_PROTOC_EXECUTABLE})") | ||
20 | else() | ||
21 | - message(FATAL_ERROR "The protocol buffer compiler is not found (Protobuf_PROTOC_EXECUTABLE='${Protobuf_PROTOC_EXECUTABLE}')") | ||
22 | + message(FATAL_ERROR "The protocol buffer compiler is not found (PROTOBUF_PROTOC_EXECUTABLE='${PROTOBUF_PROTOC_EXECUTABLE}')") | ||
23 | endif() | ||
24 | endif() | ||
25 | |||
26 | -if(NOT BUILD_PROTOBUF AND NOT (DEFINED Protobuf_INCLUDE_DIRS AND DEFINED Protobuf_LIBRARIES)) | ||
27 | +if(NOT BUILD_PROTOBUF AND NOT (DEFINED PROTOBUF_INCLUDE_DIR AND DEFINED PROTOBUF_LIBRARIES)) | ||
28 | find_package(Protobuf QUIET) | ||
29 | endif() | ||
30 | |||
31 | -if(Protobuf_FOUND) | ||
32 | +if(PROTOBUF_FOUND OR (DEFINED PROTOBUF_INCLUDE_DIR AND DEFINED PROTOBUF_LIBRARIES)) | ||
33 | # nothing | ||
34 | else() | ||
35 | set(Protobuf_LIBRARIES libprotobuf) | ||
36 | diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt | ||
37 | index 2a71568d1a44..c6329a742263 100644 | ||
38 | --- a/modules/dnn/CMakeLists.txt | ||
39 | +++ b/modules/dnn/CMakeLists.txt | ||
40 | @@ -7,7 +7,7 @@ if(DEFINED BUILD_opencv_dnn AND NOT BUILD_opencv_dnn) | ||
41 | endif() | ||
42 | |||
43 | include(${OpenCV_SOURCE_DIR}/cmake/OpenCVFindLibProtobuf.cmake) | ||
44 | -if(NOT Protobuf_FOUND) | ||
45 | +if(NOT PROTOBUF_FOUND) | ||
46 | ocv_module_disable(opencv_dnn) | ||
47 | endif() | ||
48 | |||
49 | @@ -72,7 +72,7 @@ ocv_source_group("Src\\protobuf" FILES ${Protobuf_SRCS} ${Protobuf_HDRS}) | ||
50 | ocv_module_include_directories(include ${Protobuf_INCLUDE_DIRS}) | ||
51 | |||
52 | ocv_glob_module_sources(${Protobuf_SRCS} ${Protobuf_HDRS} ${CBLAS_H_PROXY_PATH}) | ||
53 | -ocv_create_module(${Protobuf_LIBRARIES} ${LAPACK_LIBRARIES}) | ||
54 | +ocv_create_module(${PROTOBUF_LIBRARIES} ${LAPACK_LIBRARIES}) | ||
55 | ocv_add_samples() | ||
56 | ocv_add_accuracy_tests() | ||
57 | 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 bcb17d34f..1c398aacc 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 \ | |||
53 | file://0001-carotene-don-t-use-__asm__-with-aarch64.patch \ | 53 | file://0001-carotene-don-t-use-__asm__-with-aarch64.patch \ |
54 | file://0002-Do-not-enable-asm-with-clang.patch \ | 54 | file://0002-Do-not-enable-asm-with-clang.patch \ |
55 | file://CVE-2017-14136.patch \ | 55 | file://CVE-2017-14136.patch \ |
56 | file://protobuf.patch \ | ||
56 | " | 57 | " |
57 | PV = "3.3+git${SRCPV}" | 58 | PV = "3.3+git${SRCPV}" |
58 | 59 | ||