Commit f6d927ef authored by Alexander Alekhin's avatar Alexander Alekhin

dnn: avoid conflicts with original caffe.proto

rename caffe.proto => opencv-caffe.proto
parent 75b980ac
......@@ -7,7 +7,7 @@ OCV_OPTION(BUILD_PROTOBUF "Force to build libprotobuf from sources" ON)
OCV_OPTION(PROTOBUF_UPDATE_FILES "Force to rebuild .proto files" OFF)
if(PROTOBUF_UPDATE_FILES)
if(NOT DEFINED Protobuf_PROTOC_EXECUTABLE)
if(NOT COMMAND PROTOBUF_GENERATE_CPP)
find_package(Protobuf QUIET)
endif()
if(DEFINED Protobuf_PROTOC_EXECUTABLE AND EXISTS ${Protobuf_PROTOC_EXECUTABLE})
......@@ -21,7 +21,7 @@ if(NOT BUILD_PROTOBUF AND NOT (DEFINED Protobuf_INCLUDE_DIRS AND DEFINED Protobu
find_package(Protobuf QUIET)
endif()
if(Protobuf_FOUND)
if(Protobuf_FOUND AND NOT BUILD_PROTOBUF)
# nothing
else()
set(Protobuf_LIBRARIES libprotobuf)
......
......@@ -56,14 +56,15 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS
)
if(PROTOBUF_UPDATE_FILES)
file(GLOB proto_files src/tensorflow/*.proto)
list(APPEND proto_files src/caffe/caffe.proto)
file(GLOB proto_files ${CMAKE_CURRENT_SOURCE_DIR}/src/tensorflow/*.proto)
list(APPEND proto_files ${CMAKE_CURRENT_SOURCE_DIR}/src/caffe/opencv-caffe.proto)
set(PROTOBUF_GENERATE_CPP_APPEND_PATH ON) # required for tensorflow
PROTOBUF_GENERATE_CPP(Protobuf_HDRS Protobuf_SRCS ${proto_files})
else()
file(GLOB fw_srcs ${CMAKE_CURRENT_SOURCE_DIR}/misc/tensorflow/*.cc)
file(GLOB fw_hdrs ${CMAKE_CURRENT_SOURCE_DIR}/misc/tensorflow/*.h)
list(APPEND fw_srcs ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe/caffe.pb.cc)
list(APPEND fw_hdrs ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe/caffe.pb.h)
list(APPEND fw_srcs ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe/opencv-caffe.pb.cc)
list(APPEND fw_hdrs ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe/opencv-caffe.pb.h)
list(APPEND Protobuf_SRCS ${fw_srcs})
list(APPEND Protobuf_HDRS ${fw_hdrs})
list(APPEND Protobuf_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe)
......
......@@ -42,8 +42,6 @@
#include "../precomp.hpp"
#ifdef HAVE_PROTOBUF
#include "caffe.pb.h"
#include <iostream>
#include <fstream>
#include <sstream>
......
......@@ -99,7 +99,6 @@
#include <fstream>
#include <vector>
#include "caffe.pb.h"
#include "caffe_io.hpp"
#include "glog_emulator.hpp"
......
......@@ -91,7 +91,7 @@
#define __OPENCV_DNN_CAFFE_IO_HPP__
#ifdef HAVE_PROTOBUF
#include "caffe.pb.h"
#include "opencv-caffe.pb.h"
namespace cv {
namespace dnn {
......
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