File tree Expand file tree Collapse file tree 6 files changed +8
-10
lines changed Expand file tree Collapse file tree 6 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ OCV_OPTION(BUILD_PROTOBUF "Force to build libprotobuf from sources" ON)
7
7
OCV_OPTION (PROTOBUF_UPDATE_FILES "Force to rebuild .proto files" OFF )
8
8
9
9
if (PROTOBUF_UPDATE_FILES )
10
- if (NOT DEFINED Protobuf_PROTOC_EXECUTABLE )
10
+ if (NOT COMMAND PROTOBUF_GENERATE_CPP )
11
11
find_package (Protobuf QUIET )
12
12
endif ()
13
13
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
21
21
find_package (Protobuf QUIET )
22
22
endif ()
23
23
24
- if (Protobuf_FOUND )
24
+ if (Protobuf_FOUND AND NOT BUILD_PROTOBUF )
25
25
# nothing
26
26
else ()
27
27
set (Protobuf_LIBRARIES libprotobuf )
Original file line number Diff line number Diff line change @@ -56,14 +56,15 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS
56
56
)
57
57
58
58
if (PROTOBUF_UPDATE_FILES )
59
- file (GLOB proto_files src/tensorflow/*.proto )
60
- list (APPEND proto_files src/caffe/caffe.proto )
59
+ file (GLOB proto_files ${CMAKE_CURRENT_SOURCE_DIR} /src/tensorflow/*.proto )
60
+ list (APPEND proto_files ${CMAKE_CURRENT_SOURCE_DIR} /src/caffe/opencv-caffe.proto )
61
+ set (PROTOBUF_GENERATE_CPP_APPEND_PATH ON ) # required for tensorflow
61
62
PROTOBUF_GENERATE_CPP (Protobuf_HDRS Protobuf_SRCS ${proto_files} )
62
63
else ()
63
64
file (GLOB fw_srcs ${CMAKE_CURRENT_SOURCE_DIR} /misc/tensorflow/*.cc )
64
65
file (GLOB fw_hdrs ${CMAKE_CURRENT_SOURCE_DIR} /misc/tensorflow/*.h )
65
- list (APPEND fw_srcs ${CMAKE_CURRENT_SOURCE_DIR} /misc/caffe/caffe.pb.cc )
66
- list (APPEND fw_hdrs ${CMAKE_CURRENT_SOURCE_DIR} /misc/caffe/caffe.pb.h )
66
+ list (APPEND fw_srcs ${CMAKE_CURRENT_SOURCE_DIR} /misc/caffe/opencv- caffe.pb.cc )
67
+ list (APPEND fw_hdrs ${CMAKE_CURRENT_SOURCE_DIR} /misc/caffe/opencv- caffe.pb.h )
67
68
list (APPEND Protobuf_SRCS ${fw_srcs} )
68
69
list (APPEND Protobuf_HDRS ${fw_hdrs} )
69
70
list (APPEND Protobuf_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} /misc/caffe )
Original file line number Diff line number Diff line change 42
42
#include " ../precomp.hpp"
43
43
44
44
#ifdef HAVE_PROTOBUF
45
- #include " caffe.pb.h"
46
-
47
45
#include < iostream>
48
46
#include < fstream>
49
47
#include < sstream>
Original file line number Diff line number Diff line change 99
99
#include < fstream>
100
100
#include < vector>
101
101
102
- #include " caffe.pb.h"
103
102
#include " caffe_io.hpp"
104
103
#include " glog_emulator.hpp"
105
104
Original file line number Diff line number Diff line change 91
91
#define __OPENCV_DNN_CAFFE_IO_HPP__
92
92
#ifdef HAVE_PROTOBUF
93
93
94
- #include " caffe.pb.h"
94
+ #include " opencv- caffe.pb.h"
95
95
96
96
namespace cv {
97
97
namespace dnn {
File renamed without changes.
You can’t perform that action at this time.
0 commit comments