STRING:REPLACE¶
This generator expression belongs to the String Transformations family. See that section for related generator expressions.
Syntax¶
$<STRING:REPLACE[,(STRING|REGEX)],string,match_string,replace_string>
Added in version 4.3.
Replace all occurrences of match_string in the string with
replace_string.
The match_string can be of two different types:
STRINGmatch_stringis a literal string and match will be done by simple string comparison. This is the default.REGEXmatch_stringis a regular expression. Match this regular_expression as many times as possible and substitute thereplace_stringfor the match in thestring.The
replace_stringmay refer to parenthesis-delimited subexpressions of the match using \1, \2, ..., \9. Note that two backslashes (\\1) are required in CMake code to get a backslash through argument parsing.