opencv/cmake/mirrors/gitcode.cmake

86 lines
3.9 KiB
CMake
Raw Normal View History

######
# Download via commit id
######
# Tengine
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
ocv_update(TENGINE_PKG_MD5_GITCODE 1b5908632b557275cd6e85b0c03f9690)
ocv_update(TENGINE_PKG_MD5_ORIGINAL 23f61ebb1dd419f1207d8876496289c5) # same as tengine_md5sum for TENGINE commit of e89cf8870de2ff0a80cfe626c0b52b2a16fb302e
# NVIDIA_OPTICAL_FLOW
ocv_update(NVIDIA_OPTICAL_FLOW_PKG_MD5_GITCODE 8d5b7eeb24d6ca9c6bcfdff4196d5b47)
ocv_update(NVIDIA_OPTICAL_FLOW_PKG_MD5_ORIGINAL a73cd48b18dcc0cc8933b30796074191)
# TIM-VX
ocv_update(TIM-VX_PKG_MD5_GITCODE 3f2a548b40b170668aaa60d4f60ba40b)
ocv_update(TIM-VX_PKG_MD5_ORIGINAL 92619cc4498014ac7a09834d5e33ebd5)
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
######
# Download from release page
#####
# TBB
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
ocv_update(TBB_RELEASE_GITCODE "v2020.2")
ocv_update(TBB_PKG_NAME_GITCODE "tbb-${TBB_RELEASE_GITCODE}")
ocv_update(TBB_PKG_MD5_GITCODE 4eeafdf16a90cb66e39a31c8d6c6804e)
ocv_update(TBB_PKG_MD5_ORIGINAL 5af6f6c2a24c2043e62e47205e273b1f) # same as OPENCV_TBB_RELEASE_MD5 for TBB release of v2020.2
# ADE
2022-09-16 16:02:56 +08:00
ocv_update(ADE_RELEASE_GITCODE "v0.1.2a")
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
ocv_update(ADE_PKG_NAME_GITCODE "ade-${ADE_RELEASE_GITCODE}")
2022-09-16 16:02:56 +08:00
ocv_update(ADE_PKG_MD5_GITCODE 6c8015a886a98fd8a67635431fa171d8)
ocv_update(ADE_PKG_MD5_ORIGINAL fa4b3e25167319cb0fa9432ef8281945) # same as ade_md5 for ADE release of v0.1.2a
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
#
# Replace download links for packages in opencv/opencv_3rdparty:
# 1. Extract repo owner and repo name from DL_URL.
# 2. Put repo owner and repo name into the placeholders of new DL_URL.
#
macro(ocv_download_url_gitcode_usercontent OWNER)
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
string(REPLACE "/" ";" DL_URL_split ${DL_URL})
list(GET DL_URL_split 5 __COMMIT_ID)
list(GET DL_URL_split 6 __PKG_NAME)
set(DL_URL "https://gitcode.net/${OWNER}/opencv_3rdparty/-/raw/${__COMMIT_ID}/")
if(__PKG_NAME)
set(DL_URL "${DL_URL}${__PKG_NAME}/")
endif()
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
endmacro()
#
# Replace download links and checksums for archives/releases in other repositories:
# 1. Check if versions matched. If not matched, download from github instead.
# 2. Extract repo owner and repo name from DL_URL.
# 3. Put repo owner and repo name into the placeholders of new DL_URL.
# 4. Replace DL_HASH with the one downloaded from gitcode.net.
#
macro(ocv_download_url_gitcode_archive_commit_id)
if(DL_HASH STREQUAL "${${DL_ID}_PKG_MD5_ORIGINAL}")
string(REPLACE "/" ";" DL_URL_split ${DL_URL})
list(GET DL_URL_split 3 __OWNER)
list(GET DL_URL_split 4 __REPO_NAME)
set(DL_URL "https://gitcode.net/mirrors/${__OWNER}/${__REPO_NAME}/-/archive/")
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
set(DL_HASH "${${DL_ID}_PKG_MD5_GITCODE}")
else()
message(WARNING "Package ${DL_ID} from mirror gitcode.net is outdated and will be downloaded from github.com instead.")
endif()
endmacro()
macro(ocv_download_url_gitcode_archive_release SUBDIR)
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
if(DL_HASH STREQUAL "${${DL_ID}_PKG_MD5_ORIGINAL}")
string(REPLACE "/" ";" DL_URL_split ${DL_URL})
list(GET DL_URL_split 3 __OWNER)
list(GET DL_URL_split 4 __REPO_NAME)
set(DL_URL "https://gitcode.net/${__OWNER}/${__REPO_NAME}/-/archive/${${DL_ID}_RELEASE_GITCODE}/${__REPO_NAME}-")
set(DL_HASH "${${DL_ID}_PKG_MD5_GITCODE}")
set(${SUBDIR} "${${DL_ID}_PKG_NAME_GITCODE}" PARENT_SCOPE)
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
else()
message(WARNING "Package ${DL_ID} from mirror gitcode.net is outdated and will be downloaded from github.com instead.")
endif()
endmacro()
if((DL_ID STREQUAL "FFMPEG") OR (DL_ID STREQUAL "IPPICV") OR (DL_ID STREQUAL "data") OR (DL_ID STREQUAL "xfeatures2d/boostdesc") OR (DL_ID STREQUAL "xfeatures2d/vgg"))
ocv_download_url_gitcode_usercontent(opencv)
elseif(DL_ID STREQUAL "wechat_qrcode")
ocv_download_url_gitcode_usercontent(mirrors/WeChatCV)
elseif((DL_ID STREQUAL "TENGINE") OR (DL_ID STREQUAL "NVIDIA_OPTICAL_FLOW") OR (DL_ID STREQUAL "TIM-VX"))
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
ocv_download_url_gitcode_archive_commit_id()
elseif(DL_ID STREQUAL "TBB")
ocv_download_url_gitcode_archive_release(OPENCV_TBB_SUBDIR)
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
elseif(DL_ID STREQUAL "ADE")
ocv_download_url_gitcode_archive_release(ade_subdir)
Merge pull request #21531 from fengyuentau:add_3rdparty_mirrors Support downloading 3rdparty resources from Gitcode & Gitlab-style mirrors * replace github.com with gitcode.net for ocv_download * replace raw.githubusercontent.com with gitcode.net for ocv_download * rename funtions and remove some comments * add options for custom mirrors, which simply replace domain github.com & githubusercontent.com * run ocv_init_download once; replace DL_URL with mirrored one when calling ocv_download * fix for empty download links when not using mirror * fix bugs: set(.. .. PARENT_SCOPE) for ocv_init_download; correct macro names for replace github archives and raw githubusercontent * adjusted mirror swapping impl: replace with mirrored link before each ocv_download; update md5sum for archives * fix a bug: macro invoked with incorrect arguments by non-set vars * enclose if statement * workable impl * shorten the var names of two key options * scalable implementation of downloading from mirror and using custom mirror * improve ocv_init_download help message * fix the different extracted directory name in case of ADE & TBB which are downloaded from release page * improve help message printing * Download ADE & TBB using commit ids instead of from release pages * support custom mirrors on downloading archives * improve hints * add missing parentheses * reset ocv_download calls * mirror support implementation using ocv_cmake_hook & ocv_cmake_hook_append * move ocv_init_download into cmake/OpenCVDownload.cmake * move ocv_cmake_hook before checking CMake cache * improve hints when not fetching as git repo * add WORKING_DIRECTORY in execute_process in ocv_init_download * use OPENCV_DOWNLOAD_MIRROR_ID * add custom.cmake for custom mirror * detect github origin * fix broken var name * download from github by default if custom tbb is set * add checksum checks for gitcode.cmake before replacing urls and checksums * add checksum checks for custom.cmake before replacing urls and checkusms * use description specify instead of set for messages in custom.cmake; use warning message for warnings * updates and fixes
2022-03-18 17:50:21 +08:00
else()
message(STATUS "ocv_download: Unknown download ID ${DL_ID} for using mirror gitcode.net. Use original source instead.")
endif()