Hi there,
I am quite new to CMake and can see some weird benaviors. Also I could see similar issues of people to this kind of problem but could not see a good solution.
Hopefully, someone can help.
Suppose I use add_custom_command in the following way:
set(flags “-c -t -o”)
add_custom_command(COMMAND ${CMAKE_C_COMPILER} ${flags} /EP xx.c > xx.i )
On windows this will generate the following:
“\cl.exe” “-c -t -o” /EP xx.c > xx.i
when u build with microsoft VS you get an error saying it can’t open file “-c -t -o”.
This is due to the fact that cmake puts those quotes around the flags string variable.
The question is how do I get rid of those quotes and what is the right way to use this command.
Remark: you could say: do not use quotes when you define flags but in real flow I get flags via get_property() which seems to have those quotes in there.
Thanks
Serge