Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
89b82e79
Commit
89b82e79
authored
Sep 13, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15449 from mshabunin:cmake-download-params
parents
48fa39f6
9d4f0162
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
OpenCVDownload.cmake
cmake/OpenCVDownload.cmake
+14
-5
No files found.
cmake/OpenCVDownload.cmake
View file @
89b82e79
...
@@ -22,6 +22,9 @@ set(OPENCV_DOWNLOAD_PATH "${OpenCV_SOURCE_DIR}/.cache" CACHE PATH "${HELP_OPENCV
...
@@ -22,6 +22,9 @@ set(OPENCV_DOWNLOAD_PATH "${OpenCV_SOURCE_DIR}/.cache" CACHE PATH "${HELP_OPENCV
set
(
OPENCV_DOWNLOAD_LOG
"
${
OpenCV_BINARY_DIR
}
/CMakeDownloadLog.txt"
)
set
(
OPENCV_DOWNLOAD_LOG
"
${
OpenCV_BINARY_DIR
}
/CMakeDownloadLog.txt"
)
set
(
OPENCV_DOWNLOAD_WITH_CURL
"
${
OpenCV_BINARY_DIR
}
/download_with_curl.sh"
)
set
(
OPENCV_DOWNLOAD_WITH_CURL
"
${
OpenCV_BINARY_DIR
}
/download_with_curl.sh"
)
set
(
OPENCV_DOWNLOAD_WITH_WGET
"
${
OpenCV_BINARY_DIR
}
/download_with_wget.sh"
)
set
(
OPENCV_DOWNLOAD_WITH_WGET
"
${
OpenCV_BINARY_DIR
}
/download_with_wget.sh"
)
set
(
OPENCV_DOWNLOAD_TRIES_LIST 1 CACHE STRING
"List of download tries"
)
# a list
set
(
OPENCV_DOWNLOAD_PARAMS INACTIVITY_TIMEOUT 60 TIMEOUT 600 CACHE STRING
"Download parameters to be passed to file(DOWNLAOD ...)"
)
mark_as_advanced
(
OPENCV_DOWNLOAD_TRIES_LIST OPENCV_DOWNLOAD_PARAMS
)
# Init download cache directory and log file and helper scripts
# Init download cache directory and log file and helper scripts
if
(
NOT EXISTS
"
${
OPENCV_DOWNLOAD_PATH
}
"
)
if
(
NOT EXISTS
"
${
OPENCV_DOWNLOAD_PATH
}
"
)
...
@@ -154,11 +157,17 @@ function(ocv_download)
...
@@ -154,11 +157,17 @@ function(ocv_download)
# Download
# Download
if
(
NOT EXISTS
"
${
CACHE_CANDIDATE
}
"
)
if
(
NOT EXISTS
"
${
CACHE_CANDIDATE
}
"
)
ocv_download_log
(
"#cmake_download
\"
${
CACHE_CANDIDATE
}
\"
\"
${
DL_URL
}
\"
"
)
ocv_download_log
(
"#cmake_download
\"
${
CACHE_CANDIDATE
}
\"
\"
${
DL_URL
}
\"
"
)
foreach
(
try
${
OPENCV_DOWNLOAD_TRIES_LIST
}
)
ocv_download_log
(
"#try
${
try
}
"
)
file
(
DOWNLOAD
"
${
DL_URL
}
"
"
${
CACHE_CANDIDATE
}
"
file
(
DOWNLOAD
"
${
DL_URL
}
"
"
${
CACHE_CANDIDATE
}
"
INACTIVITY_TIMEOUT 60
TIMEOUT 600
STATUS status
STATUS status
LOG __log
)
LOG __log
${
OPENCV_DOWNLOAD_PARAMS
}
)
if
(
status EQUAL 0
)
break
()
endif
()
message
(
STATUS
"Try
${
try
}
failed"
)
endforeach
()
if
(
NOT OPENCV_SKIP_FILE_DOWNLOAD_DUMP
)
# workaround problem with old CMake versions: "Invalid escape sequence"
if
(
NOT OPENCV_SKIP_FILE_DOWNLOAD_DUMP
)
# workaround problem with old CMake versions: "Invalid escape sequence"
string
(
LENGTH
"
${
__log
}
"
__log_length
)
string
(
LENGTH
"
${
__log
}
"
__log_length
)
if
(
__log_length LESS 65536
)
if
(
__log_length LESS 65536
)
...
@@ -195,8 +204,8 @@ For details please refer to the download log file:
...
@@ -195,8 +204,8 @@ For details please refer to the download log file:
${
OPENCV_DOWNLOAD_LOG
}
${
OPENCV_DOWNLOAD_LOG
}
"
)
"
)
# write helper scripts for failed downloads
# write helper scripts for failed downloads
file
(
APPEND
"
${
OPENCV_DOWNLOAD_WITH_CURL
}
"
"curl --output
\"
${
CACHE_CANDIDATE
}
\"
\"
${
DL_URL
}
\"\n
"
)
file
(
APPEND
"
${
OPENCV_DOWNLOAD_WITH_CURL
}
"
"curl --
create-dirs --
output
\"
${
CACHE_CANDIDATE
}
\"
\"
${
DL_URL
}
\"\n
"
)
file
(
APPEND
"
${
OPENCV_DOWNLOAD_WITH_WGET
}
"
"wget -O
\"
${
CACHE_CANDIDATE
}
\"
\"
${
DL_URL
}
\"\n
"
)
file
(
APPEND
"
${
OPENCV_DOWNLOAD_WITH_WGET
}
"
"
mkdir -p $(dirname
${
CACHE_CANDIDATE
}
) &&
wget -O
\"
${
CACHE_CANDIDATE
}
\"
\"
${
DL_URL
}
\"\n
"
)
return
()
return
()
endif
()
endif
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment