I’ve been unable to get this very simple piece of CMake to run as expected:
set(FOO baz$<SEMICOLON>bar)
add_custom_command(
OUTPUT whatever
COMMAND custom-compiler.py --include=${FOO}
)
This is one of the many variations I tried.
My tests included:
- Using the
VERBATIMflag - Using the
COMMAND_EXPAND_LISTSflag - Using literal semi-colons
- Using escaped semi-colons
- Adding double-quotes around the expanded variable
- Adding double-quotes when defining the variable
- Copy-paste whatever hallucination
$LLMgave me
At the end of the day, either the ; are turned into spaces because CMake lists, or they are double-quoted, giving me something like e.g. --include=baz";"bar.
Funniest part of all, this example works otherwise just fine with Ninja, it is only broken when using the Visual Studio generator. Unfortunately, I, for now, need to support this generator.