Commit e7b54ce8 authored by Vladislav Sovrasov's avatar Vladislav Sovrasov

dnn_modern: disable module if protobuf compiler not found

parent f953e690
...@@ -81,6 +81,12 @@ add_definitions(-DCNN_NO_SERIALIZATION -DCNN_USE_CAFFE_CONVERTER) ...@@ -81,6 +81,12 @@ add_definitions(-DCNN_NO_SERIALIZATION -DCNN_USE_CAFFE_CONVERTER)
# this is not needed anymore. # this is not needed anymore.
find_package(Protobuf QUIET) 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}) if(DEFINED PROTOBUF_PROTOC_EXECUTABLE AND EXISTS ${PROTOBUF_PROTOC_EXECUTABLE})
execute_process(COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} caffe.proto --cpp_out=./ execute_process(COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} caffe.proto --cpp_out=./
WORKING_DIRECTORY ${TINYDNN_INCLUDE_DIRS}/tiny_dnn/io/caffe) WORKING_DIRECTORY ${TINYDNN_INCLUDE_DIRS}/tiny_dnn/io/caffe)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment