CMake and configure_file: what if I need $ONLY instead of @ONLY?

Viewed 1331

As from the documentation of configure_file, it has an useful @ONLY parameter used to:

Restrict variable replacement to references of the form @VAR@. This is useful for configuring scripts that use ${VAR} syntax.

So far so good.

Now I'm in the case where I've a file that contains both @FOO@ and ${BAR} and I want to replace S{BAR} with a variable that comes from my CMakeLists.tx. On the other side I don't want that configure_file tries to replace @FOO@.
In other terms, I need something like a $ONLY parameter that works as @ONLY but for the opposite case.

Is there any chance I can do that with what I have right now?
I tried putting backslashes in front of my @, but this way I obtain a file that contains a couple of \@ and this is not exactly what I need.

1 Answers
Related