cmake: don't include protobuf on disabled DNN module
authorAlexander Alekhin <alexander.alekhin@intel.com>
Mon, 31 Jul 2017 11:18:59 +0000 (14:18 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Mon, 31 Jul 2017 11:18:59 +0000 (14:18 +0300)
modules/dnn/CMakeLists.txt

index 8b335ad..2a71568 100644 (file)
@@ -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)