Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 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() |