zeus migration: opencv: Fix warning applying this patch

https://jira.digi.com/browse/DEL-7013

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2020-04-16 11:29:44 +02:00
parent f01a336d43
commit 2d3fbfc3d2
1 changed files with 9 additions and 4 deletions

View File

@ -1,10 +1,15 @@
This CMake module will download files during do_configure. This is bad as it
means we can't do offline builds.
From: Arturo Buzarra <arturo.buzarra@digi.com>
Date: Thu, 16 Apr 2020 09:15:06 +0200
Subject: [PATCH] This CMake module will download files during do_configure.
This is bad as it means we can't do offline builds.
Add an option to disallow downloads by emitting a fatal error.
Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
cmake/OpenCVDownload.cmake | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake
index 63cf6d3238..4acf477f70 100644
@ -13,13 +18,13 @@ index 63cf6d3238..4acf477f70 100644
@@ -14,6 +14,7 @@
# RELATIVE_URL - if set, then URL is treated as a base, and FILENAME will be appended to it
# Note: uses OPENCV_DOWNLOAD_PATH folder as cache, default is <opencv>/.cache
+set(OPENCV_ALLOW_DOWNLOADS ON CACHE BOOL "Allow downloads")
set(HELP_OPENCV_DOWNLOAD_PATH "Cache directory for downloaded files")
if(DEFINED ENV{OPENCV_DOWNLOAD_PATH})
set(OPENCV_DOWNLOAD_PATH "$ENV{OPENCV_DOWNLOAD_PATH}" CACHE PATH "${HELP_OPENCV_DOWNLOAD_PATH}")
@@ -156,6 +157,11 @@ function(ocv_download)
# Download
if(NOT EXISTS "${CACHE_CANDIDATE}")
+ if(NOT OPENCV_ALLOW_DOWNLOADS)