cmake: add option to workaround issue observed with old CMake
authorAlexander Alekhin <alexander.alekhin@intel.com>
Tue, 12 Dec 2017 15:56:09 +0000 (18:56 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Tue, 12 Dec 2017 16:00:42 +0000 (19:00 +0300)
CMake message contains this: "Invalid escape sequence \"

cmake/OpenCVDownload.cmake

index 7b40639..f660502 100644 (file)
@@ -156,10 +156,12 @@ function(ocv_download)
          TIMEOUT 600
          STATUS status
          LOG __log)
-    string(LENGTH "${__log}" __log_length)
-    if(__log_length LESS 65536)
-      string(REPLACE "\n" "\n# " __log "${__log}")
-      ocv_download_log("# ${__log}\n")
+    if(NOT OPENCV_SKIP_FILE_DOWNLOAD_DUMP)  # workaround problem with old CMake versions: "Invalid escape sequence"
+      string(LENGTH "${__log}" __log_length)
+      if(__log_length LESS 65536)
+        string(REPLACE "\n" "\n# " __log "${__log}")
+        ocv_download_log("# ${__log}\n")
+      endif()
     endif()
     if(NOT status EQUAL 0)
       set(msg_level FATAL_ERROR)