Fixed problem with backslashes in embedded build information.

This commit is contained in:
Andrey Kamaev 2012-04-06 20:03:21 +00:00
parent dcadc4f8fb
commit 99b24f77c5

View File

@ -108,9 +108,8 @@ set(OPENCV_BUILD_INFO_FILE "${OpenCV_BINARY_DIR}/version_string.tmp")
file(REMOVE "${OPENCV_BUILD_INFO_FILE}")
function(ocv_output_status msg)
message(STATUS "${msg}")
if(msg MATCHES "\"")
string(REPLACE "\"" "\\\"" msg "${msg}")
endif()
string(REPLACE "\\" "\\\\" msg "${msg}")
string(REPLACE "\"" "\\\"" msg "${msg}")
file(APPEND "${OPENCV_BUILD_INFO_FILE}" "\"${msg}\\n\"\n")
endfunction()