From e7b54ce8e909c221b2496e33a6f57320cdde30fd Mon Sep 17 00:00:00 2001 From: Vladislav Sovrasov Date: Thu, 24 Aug 2017 15:49:25 +0300 Subject: [PATCH] dnn_modern: disable module if protobuf compiler not found --- modules/dnn_modern/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/dnn_modern/CMakeLists.txt b/modules/dnn_modern/CMakeLists.txt index 1b8efd929..49afa0ad3 100644 --- a/modules/dnn_modern/CMakeLists.txt +++ b/modules/dnn_modern/CMakeLists.txt @@ -81,6 +81,12 @@ add_definitions(-DCNN_NO_SERIALIZATION -DCNN_USE_CAFFE_CONVERTER) # this is not needed anymore. find_package(Protobuf QUIET) +if(NOT ${Protobuf_FOUND}) + message(STATUS "Module opencv_dnn_modern disabled because Protobuf is not found") + ocv_module_disable(dnn_modern) + return() +endif() + if(DEFINED PROTOBUF_PROTOC_EXECUTABLE AND EXISTS ${PROTOBUF_PROTOC_EXECUTABLE}) execute_process(COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} caffe.proto --cpp_out=./ WORKING_DIRECTORY ${TINYDNN_INCLUDE_DIRS}/tiny_dnn/io/caffe)