Skip to content

Commit b3a42c8

Browse files
committed
hunter: disable external download when building with Hunter
The only package that is allowed to use `ocv_download()` is `IPPICV` as it is tricked to use the Hunter provided file.
1 parent 5b35f0b commit b3a42c8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmake/OpenCVDownload.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ endfunction()
8686

8787
function(ocv_download)
8888
cmake_parse_arguments(DL "UNPACK;RELATIVE_URL" "FILENAME;HASH;DESTINATION_DIR;ID;STATUS" "URL" ${ARGN})
89+
if(HUNTER_ENABLED)
90+
if (DL_ID STREQUAL "IPPICV")
91+
message(DEBUG "ocv_download(): IPPICV allowed while using Hunter, continue")
92+
else()
93+
message(FATAL_ERROR "ocv_download(): downloading external resources not allowed while bulding with Hunter. Args: ${ARGV}")
94+
endif()
95+
endif()
8996

9097
function(ocv_download_log)
9198
file(APPEND "${OPENCV_DOWNLOAD_LOG}" "${ARGN}\n")

0 commit comments

Comments
 (0)