Skip to content

Commit edadcfa

Browse files
committed
cmake: add option to workaround issue observed with old CMake
CMake message contains this: "Invalid escape sequence \"
1 parent ce20efb commit edadcfa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cmake/OpenCVDownload.cmake

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,12 @@ function(ocv_download)
156156
TIMEOUT 600
157157
STATUS status
158158
LOG __log)
159-
string(LENGTH "${__log}" __log_length)
160-
if(__log_length LESS 65536)
161-
string(REPLACE "\n" "\n# " __log "${__log}")
162-
ocv_download_log("# ${__log}\n")
159+
if(NOT OPENCV_SKIP_FILE_DOWNLOAD_DUMP) # workaround problem with old CMake versions: "Invalid escape sequence"
160+
string(LENGTH "${__log}" __log_length)
161+
if(__log_length LESS 65536)
162+
string(REPLACE "\n" "\n# " __log "${__log}")
163+
ocv_download_log("# ${__log}\n")
164+
endif()
163165
endif()
164166
if(NOT status EQUAL 0)
165167
set(msg_level FATAL_ERROR)

0 commit comments

Comments
 (0)