; is parsed as %3B

I need to set the link attribute “force symbol refenece” in vs, and I need to set more than one. I found a solution on the internet.
set_target_properties(target PROPERTIES LINK_FLAGS “/INCLUDE:TEST1;TEST2”)
But in vs it parses out as TEST1%3BTEST2, how do I solve this problem.

Semicolon is special in CMake (it is the list separator), so things like this happening aren’t that surprising. As for this, target_link_options(target PRIVATE "SHELL:/INCLUDE:TEST1;TEST2") may work. If not, try replacing ; with $<SEMICOLON> (with and without the SHELL: prefix).

1 Like