Escape quotes inside a variable

This commit is contained in:
Pedro Navarro
2018-12-19 14:04:57 -08:00
parent f860440775
commit 2c00ab7ee0

View File

@@ -36,6 +36,7 @@ foreach (_cacheVariable ${_cachedVariableNames})
get_property(_type CACHE "${_cacheVariable}" PROPERTY TYPE)
get_property(_advanced CACHE "${_cacheVariable}" PROPERTY ADVANCED)
get_property(_help_string CACHE "${_cacheVariable}" PROPERTY HELPSTRING)
string(REPLACE "\"" "\\\"" ${_cacheVariable} "${${_cacheVariable}}")
if (NOT "${_type}" STREQUAL "UNINITIALIZED" AND NOT "${_type}" STREQUAL "STATIC")
file(APPEND ${CMAKE_CHECKS_CACHE_FILE} "set(${_cacheVariable} \"${${_cacheVariable}}\" CACHE ${_type} \"${_help_string}\")\n")
if (${_advanced})