Spent half an hour trying to figure out how to escape a semicolon in CMAKE_ARGS. It's a nasty problem, whenever the variable value is used to set another variable, the semicolon character becomes a list separator, so the number of escapes depends on the number of variable expansions... The solution is to use the generator expression $<SEMICOLON>... (only for CMake 3.3+).
If you have a fediverse account, you can quote this note from your own instance. Search https://mk.absturztau.be/notes/ai4v2l6wko6g02ns on your instance and quote it. (Note that quoting is not supported in Mastodon.)