configure_file() needs a way to skip some placeholders
I made use of the configure_file()
function to move from an input file.xml.in
to the related output file.xml
.
My requirement was to have only a subset of the variables present in the input file replaced by the related values in the output one.
For example:
<tag>@VarToBeReplaced@</tag>
<tag>@VarToBeNOTReplaced@</tag>
should be translated to
<tag>VarValue</tag>
<tag>@VarToBeNOTReplaced@</tag>
I worked around the issue by:
- using the
${placeholder}
syntax for the variables that I did not want to replace - defining a cached variable (i.e.
set(placeholder "@placeholder@")
for each one)
I suggest to add a way to skip the replacement of some variables, for example escaping the @
charcather in the input file and having the escaping removed in the output one.
Edited by Ghost User