Skip to content

Commit b76c23c

Browse files
author
Al-Nuaimi Ibraheem
committed
Use hunter protobuf
1 parent 5073d65 commit b76c23c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cmake/OpenCVFindProtobuf.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ if(NOT WITH_PROTOBUF)
66
return()
77
endif()
88

9-
ocv_option(BUILD_PROTOBUF "Force to build libprotobuf from sources" ON)
10-
ocv_option(PROTOBUF_UPDATE_FILES "Force rebuilding .proto files (protoc should be available)" OFF)
9+
ocv_option(BUILD_PROTOBUF "Force to build libprotobuf from sources" OFF)
10+
ocv_option(PROTOBUF_UPDATE_FILES "Force rebuilding .proto files (protoc should be available)" ON)
1111

1212
function(get_protobuf_version version include)
1313
file(STRINGS "${include}/google/protobuf/stubs/common.h" ver REGEX "#define GOOGLE_PROTOBUF_VERSION [0-9]+")
@@ -23,6 +23,7 @@ if(BUILD_PROTOBUF)
2323
set(HAVE_PROTOBUF TRUE)
2424
else()
2525
unset(Protobuf_VERSION CACHE)
26+
hunter_add_package(Protobuf)
2627
find_package(Protobuf QUIET)
2728

2829
# Backwards compatibility
@@ -62,6 +63,7 @@ else()
6263
endif()
6364

6465
if(HAVE_PROTOBUF AND PROTOBUF_UPDATE_FILES AND NOT COMMAND PROTOBUF_GENERATE_CPP)
66+
hunter_add_package(Protobuf)
6567
find_package(Protobuf QUIET)
6668
if(NOT COMMAND PROTOBUF_GENERATE_CPP)
6769
message(FATAL_ERROR "PROTOBUF_GENERATE_CPP command is not available")

modules/dnn/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ else()
8989
set(__lapack_libraries ${LAPACK_LIBRARIES})
9090
endif()
9191

92-
set(libs libprotobuf ${LAPACK_LIBRARIES})
92+
set(libs protobuf::libprotobuf ${LAPACK_LIBRARIES})
9393

9494
if(OPENCV_DNN_OPENCL AND HAVE_OPENCL)
9595
list(APPEND include_dirs ${OPENCL_INCLUDE_DIRS})

0 commit comments

Comments
 (0)