summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/opencv/opencv/download.patch
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2020-03-01 08:33:02 +0800
committerArmin Kuster <akuster808@gmail.com>2020-03-15 13:30:34 -0700
commit861e85453dc8b8249c0318bc9b4f48018abe0f3e (patch)
treea0d22b3671efd5a00833e58563d9325dc5eb5e02 /meta-oe/recipes-support/opencv/opencv/download.patch
parent112aea3cedf827c82357241a6a1edfb32a9570a2 (diff)
downloadmeta-openembedded-861e85453dc8b8249c0318bc9b4f48018abe0f3e.tar.gz
opencv: abort configure if we need to download
OpenCV's habit of downloading files during do_configure is bad form (as it becomes impossible to do offline builds), so add an option to error out if a download would be needed. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/opencv/opencv/download.patch')
-rw-r--r--meta-oe/recipes-support/opencv/opencv/download.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/opencv/opencv/download.patch b/meta-oe/recipes-support/opencv/opencv/download.patch
new file mode 100644
index 000000000..fa8db8807
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/opencv/download.patch
@@ -0,0 +1,32 @@
1This CMake module will download files during do_configure. This is bad as it
2means we can't do offline builds.
3
4Add an option to disallow downloads by emitting a fatal error.
5
6Upstream-Status: Pending
7Signed-off-by: Ross Burton <ross.burton@intel.com>
8
9diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake
10index cdc47ad2cb..74573f45a2 100644
11--- a/cmake/OpenCVDownload.cmake
12+++ b/cmake/OpenCVDownload.cmake
13@@ -14,6 +14,7 @@
14 # RELATIVE_URL - if set, then URL is treated as a base, and FILENAME will be appended to it
15 # Note: uses OPENCV_DOWNLOAD_PATH folder as cache, default is <opencv>/.cache
16
17+set(OPENCV_ALLOW_DOWNLOADS ON CACHE BOOL "Allow downloads")
18 set(HELP_OPENCV_DOWNLOAD_PATH "Cache directory for downloaded files")
19 if(DEFINED ENV{OPENCV_DOWNLOAD_PATH})
20 set(OPENCV_DOWNLOAD_PATH "$ENV{OPENCV_DOWNLOAD_PATH}" CACHE PATH "${HELP_OPENCV_DOWNLOAD_PATH}")
21@@ -153,6 +154,11 @@ function(ocv_download)
22
23 # Download
24 if(NOT EXISTS "${CACHE_CANDIDATE}")
25+ if(NOT OPENCV_ALLOW_DOWNLOADS)
26+ message(FATAL_ERROR "Not going to download ${DL_FILENAME}")
27+ return()
28+ endif()
29+
30 ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"")
31 file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}"
32 INACTIVITY_TIMEOUT 60