File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,13 @@ if(NOT WITH_PROTOBUF)
6
6
return ()
7
7
endif ()
8
8
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 )
9
+ if (CMAKE_HOST_UNIX )
10
+ ocv_option (BUILD_PROTOBUF "Force to build libprotobuf from sources" OFF )
11
+ ocv_option (PROTOBUF_UPDATE_FILES "Force rebuilding .proto files (protoc should be available)" ON )
12
+ else ()
13
+ ocv_option (BUILD_PROTOBUF "Force to build libprotobuf from sources" ON )
14
+ ocv_option (PROTOBUF_UPDATE_FILES "Force rebuilding .proto files (protoc should be available)" OFF )
15
+ endif ()
11
16
12
17
function (get_protobuf_version version include )
13
18
file (STRINGS "${include} /google/protobuf/stubs/common.h" ver REGEX "#define GOOGLE_PROTOBUF_VERSION [0-9]+" )
@@ -23,7 +28,9 @@ if(BUILD_PROTOBUF)
23
28
set (HAVE_PROTOBUF TRUE )
24
29
else ()
25
30
unset (Protobuf_VERSION CACHE )
26
- hunter_add_package (Protobuf )
31
+ if (CMAKE_HOST_UNIX )
32
+ hunter_add_package (Protobuf )
33
+ endif ()
27
34
find_package (Protobuf QUIET )
28
35
29
36
# Backwards compatibility
63
70
endif ()
64
71
65
72
if (HAVE_PROTOBUF AND PROTOBUF_UPDATE_FILES AND NOT COMMAND PROTOBUF_GENERATE_CPP )
66
- hunter_add_package (Protobuf )
73
+ if (CMAKE_HOST_UNIX )
74
+ hunter_add_package (Protobuf )
75
+ endif ()
67
76
find_package (Protobuf QUIET )
68
77
if (NOT COMMAND PROTOBUF_GENERATE_CPP )
69
78
message (FATAL_ERROR "PROTOBUF_GENERATE_CPP command is not available" )
Original file line number Diff line number Diff line change @@ -89,7 +89,11 @@ else()
89
89
set (__lapack_libraries ${LAPACK_LIBRARIES} )
90
90
endif ()
91
91
92
- set (libs protobuf::libprotobuf ${LAPACK_LIBRARIES} )
92
+ if (CMAKE_HOST_UNIX )
93
+ set (libs protobuf::libprotobuf ${LAPACK_LIBRARIES} )
94
+ else ()
95
+ set (libs libprotobuf ${LAPACK_LIBRARIES} )
96
+ endif ()
93
97
94
98
if (OPENCV_DNN_OPENCL AND HAVE_OPENCL )
95
99
list (APPEND include_dirs ${OPENCL_INCLUDE_DIRS} )
You can’t perform that action at this time.
0 commit comments