|
|
|
@ -9,9 +9,11 @@ if(${PROTOBUF_FOUND} AND EXISTS ${PROTOBUF_PROTOC_EXECUTABLE}) |
|
|
|
|
file(GLOB PROTO_FILES src/*.proto) |
|
|
|
|
PROTOBUF_GENERATE_CPP(PROTO_HDRS PROTO_SRCS ${PROTO_FILES}) |
|
|
|
|
set(HAVE_PROTOBUF ON) |
|
|
|
|
add_definitions(-DHAVE_PROTOBUF 1) |
|
|
|
|
else() |
|
|
|
|
message(STATUS "PROTOBUF not found. Caffe import function will be disabled.") |
|
|
|
|
set(HAVE_PROTOBUF OFF) |
|
|
|
|
set(PROTOBUF_LIBRARIES "") |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
endmacro(_dnn_find_protobuf) |
|
|
|
@ -23,15 +25,8 @@ set(OPENCV_MODULE_IS_PART_OF_WORLD OFF) |
|
|
|
|
|
|
|
|
|
ocv_add_module(dnn opencv_imgproc opencv_core opencv_highgui WRAP python matlab) |
|
|
|
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-shadow -Wno-parentheses) |
|
|
|
|
if(HAVE_PROTOBUF) |
|
|
|
|
add_definitions(-DHAVE_PROTOBUF 1) |
|
|
|
|
ocv_glob_module_sources(${PROTO_SRCS} ${PROTO_HDRS}) |
|
|
|
|
ocv_source_group("Src\\protobuf" FILES ${PROTO_SRCS} ${PROTO_HDRS}) |
|
|
|
|
else() |
|
|
|
|
file(GLOB NON_CAFFE_SOURCES "src/*.cpp" "src/layers/*.cpp") |
|
|
|
|
file(GLOB NON_CAFFE_HEADERS "src/*.hpp" "src/layers/*.hpp") |
|
|
|
|
ocv_set_module_sources(HEADERS ${NON_CAFFE_HEADERS} SOURCES ${NON_CAFFE_SOURCES}) |
|
|
|
|
endif() |
|
|
|
|
ocv_module_include_directories(include src/caffe ${PROTOBUF_INCLUDE_DIR}) |
|
|
|
|
|
|
|
|
|
ocv_create_module(${PROTOBUF_LIBRARIES}) |
|
|
|
|