I have a use-case where I want to pass an argument to a command executed via CMakes execute_process should contain a ;. Now a semicolon is used as the list delimiter in CMake variables and execute_process expects a list of arguments for the COMMAND argument. No matter which escaping I tried, it always seems to split the argument with the semicolon into two arguments.
Is there any escape sequence or other trick to ensure that the semicolon will make it as command to the process?
Example:
set (args "foo" "bar" "\"with;semicolon\n""
execute_process (COMMAND ${args})
This tends to lauch the process like
foo bar "with semicolon"
Expected behaviour would be launching it like
foo bar "with;semicolon"
Edit: I know why this happens, other questions like How do I make a list in CMake with the semicolon value? describe the issue and the limitations well. My question is more towards a possible specific solution that works with execute_process as I don't see any of the known workarounds solve this particular issue