mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-05 02:50:46 +00:00
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>
This commit is contained in:
committed by
Armin Kuster
parent
f27c6ce6b9
commit
f4da4b7ceb
@@ -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()
|
||||
@@ -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}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user