Changeset View
Changeset View
Standalone View
Standalone View
cmake/modules/SanitizeHelper.cmake
- This file was added.
# Sanitize a variable according to cmake rules | |||||
# https://cmake.org/cmake/help/v3.10/manual/cmake-language.7.html#variable-references | |||||
# The NUL and ';' characters cannot be escaped in this context (see CMP0053) | |||||
macro(sanitize_variable RAW_VAR SANITIZED_VAR) | |||||
string(REGEX REPLACE | |||||
"([^a-zA-Z0-9/_.+-])" "\\\\\\1" ${SANITIZED_VAR} "${RAW_VAR}") | |||||
endmacro() | |||||
No newline at end of file |