Commit bdf51c3a authored by Alexander Alekhin's avatar Alexander Alekhin

contrib: fix protobuf usage

parent e9cd99d9
set(BUILD_opencv_cnn_3dobj_INIT OFF) # Must be disabled by default - requires custom build of Caffe.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
find_package(Caffe)
......@@ -8,7 +10,9 @@ else()
message(STATUS "Caffe: NO")
endif()
find_package(Protobuf)
if(NOT BUILD_PROTOBUF)
find_package(Protobuf)
endif()
if(Protobuf_FOUND)
message(STATUS "Protobuf: YES")
set(HAVE_PROTOBUF 1)
......
# Protobuf package for CNN Triplet training
unset(Protobuf_FOUND)
find_library(Protobuf_LIBS NAMES protobuf
HINTS
/usr/local/lib)
if(Protobuf_LIBS)
set(Protobuf_FOUND 1)
endif()
......@@ -79,7 +79,9 @@ add_definitions(-DCNN_NO_SERIALIZATION -DCNN_USE_CAFFE_CONVERTER)
# NOTE: In case that proto files already exist,
# this is not needed anymore.
find_package(Protobuf QUIET)
if(NOT BUILD_PROTOBUF)
find_package(Protobuf QUIET)
endif()
if(NOT ${Protobuf_FOUND})
message(STATUS "Module opencv_dnn_modern disabled because Protobuf is not found")
......
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