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
2df03459
Commit
2df03459
authored
Aug 01, 2018
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: add download helper scripts
parent
47e3e89e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
OpenCVDownload.cmake
cmake/OpenCVDownload.cmake
+10
-4
No files found.
cmake/OpenCVDownload.cmake
View file @
2df03459
...
...
@@ -20,16 +20,19 @@ if(DEFINED ENV{OPENCV_DOWNLOAD_PATH})
endif
()
set
(
OPENCV_DOWNLOAD_PATH
"
${
OpenCV_SOURCE_DIR
}
/.cache"
CACHE PATH
"
${
HELP_OPENCV_DOWNLOAD_PATH
}
"
)
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_WGET
"
${
OpenCV_BINARY_DIR
}
/download_with_wget.sh"
)
# Init download cache directory and log file
# Init download cache directory and log file
and helper scripts
if
(
NOT EXISTS
"
${
OPENCV_DOWNLOAD_PATH
}
"
)
file
(
MAKE_DIRECTORY
${
OPENCV_DOWNLOAD_PATH
}
)
endif
()
if
(
NOT EXISTS
"
${
OPENCV_DOWNLOAD_PATH
}
/.gitignore"
)
file
(
WRITE
"
${
OPENCV_DOWNLOAD_PATH
}
/.gitignore"
"*
\n
"
)
endif
()
file
(
WRITE
"
${
OPENCV_DOWNLOAD_LOG
}
"
"use_cache
\"
${
OPENCV_DOWNLOAD_PATH
}
\"\n
"
)
file
(
WRITE
"
${
OPENCV_DOWNLOAD_LOG
}
"
"#use_cache
\"
${
OPENCV_DOWNLOAD_PATH
}
\"\n
"
)
file
(
REMOVE
"
${
OPENCV_DOWNLOAD_WITH_CURL
}
"
)
file
(
REMOVE
"
${
OPENCV_DOWNLOAD_WITH_WGET
}
"
)
function
(
ocv_download
)
cmake_parse_arguments
(
DL
"UNPACK;RELATIVE_URL"
"FILENAME;HASH;DESTINATION_DIR;ID;STATUS"
"URL"
${
ARGN
}
)
...
...
@@ -103,7 +106,7 @@ function(ocv_download)
endif
()
# Log all calls to file
ocv_download_log
(
"do_
${
mode
}
\"
${
DL_FILENAME
}
\"
\"
${
DL_HASH
}
\"
\"
${
DL_URL
}
\"
\"
${
DL_DESTINATION_DIR
}
\"
"
)
ocv_download_log
(
"
#
do_
${
mode
}
\"
${
DL_FILENAME
}
\"
\"
${
DL_HASH
}
\"
\"
${
DL_URL
}
\"
\"
${
DL_DESTINATION_DIR
}
\"
"
)
# ... and to console
set
(
__msg_prefix
""
)
if
(
DL_ID
)
...
...
@@ -191,6 +194,9 @@ function(ocv_download)
For details please refer to the download log file:
${
OPENCV_DOWNLOAD_LOG
}
"
)
# write helper scripts for failed downloads
file
(
APPEND
"
${
OPENCV_DOWNLOAD_WITH_CURL
}
"
"curl --output
\"
${
CACHE_CANDIDATE
}
\"
\"
${
DL_URL
}
\"\n
"
)
file
(
APPEND
"
${
OPENCV_DOWNLOAD_WITH_WGET
}
"
"wget -O
\"
${
CACHE_CANDIDATE
}
\"
\"
${
DL_URL
}
\"\n
"
)
return
()
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