Skip to content

Commit bdf51c3

Browse files
committed
contrib: fix protobuf usage
1 parent e9cd99d commit bdf51c3

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

modules/cnn_3dobj/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
set(BUILD_opencv_cnn_3dobj_INIT OFF) # Must be disabled by default - requires custom build of Caffe.
2+
13
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
24

35
find_package(Caffe)
@@ -8,7 +10,9 @@ else()
810
message(STATUS "Caffe: NO")
911
endif()
1012

11-
find_package(Protobuf)
13+
if(NOT BUILD_PROTOBUF)
14+
find_package(Protobuf)
15+
endif()
1216
if(Protobuf_FOUND)
1317
message(STATUS "Protobuf: YES")
1418
set(HAVE_PROTOBUF 1)

modules/cnn_3dobj/FindProtobuf.cmake

Lines changed: 0 additions & 10 deletions
This file was deleted.

modules/dnn_modern/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ add_definitions(-DCNN_NO_SERIALIZATION -DCNN_USE_CAFFE_CONVERTER)
7979

8080
# NOTE: In case that proto files already exist,
8181
# this is not needed anymore.
82-
find_package(Protobuf QUIET)
82+
if(NOT BUILD_PROTOBUF)
83+
find_package(Protobuf QUIET)
84+
endif()
8385

8486
if(NOT ${Protobuf_FOUND})
8587
message(STATUS "Module opencv_dnn_modern disabled because Protobuf is not found")

0 commit comments

Comments
 (0)