From cbced23de45a691fbfa440c89091895e8504c79c Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 31 Jul 2017 14:18:59 +0300 Subject: [PATCH] cmake: don't include protobuf on disabled DNN module --- modules/dnn/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt index 8b335ad67c..2a71568d1a 100644 --- a/modules/dnn/CMakeLists.txt +++ b/modules/dnn/CMakeLists.txt @@ -2,6 +2,10 @@ if(WINRT) ocv_module_disable(dnn) endif() +if(DEFINED BUILD_opencv_dnn AND NOT BUILD_opencv_dnn) + return() +endif() + include(${OpenCV_SOURCE_DIR}/cmake/OpenCVFindLibProtobuf.cmake) if(NOT Protobuf_FOUND) ocv_module_disable(opencv_dnn)