Skip to content

Commit d29c299

Browse files
committed
cmake: additional messages on download errors
1 parent f0e3431 commit d29c299

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

cmake/OpenCVDownload.cmake

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,28 @@ function(ocv_download)
167167
set(${DL_STATUS} FALSE PARENT_SCOPE)
168168
set(msg_level WARNING)
169169
endif()
170-
message(${msg_level} "${__msg_prefix}Download failed: ${status}")
170+
if(status MATCHES "Couldn't resolve host name")
171+
message(STATUS "
172+
=======================================================================
173+
Couldn't download files from the Internet.
174+
Please check the Internet access on this host.
175+
=======================================================================
176+
")
177+
elseif(status MATCHES "Couldn't connect to server")
178+
message(STATUS "
179+
=======================================================================
180+
Couldn't connect to server from the Internet.
181+
Perhaps direct connections are not allowed in the current network.
182+
To use proxy please check/specify these environment variables:
183+
- http_proxy/https_proxy
184+
- and/or HTTP_PROXY/HTTPS_PROXY
185+
=======================================================================
186+
")
187+
endif()
188+
message(${msg_level} "${__msg_prefix}Download failed: ${status}
189+
For details please refer to the download log file:
190+
${OPENCV_DOWNLOAD_LOG}
191+
")
171192
return()
172193
endif()
173194

0 commit comments

Comments
 (0)