[CMake] CMake not parsing quotes properly for VS compiler flags.

Luke Snape ldjsnape at gmail.com
Thu May 3 03:59:10 EDT 2012


Hello,

I am adding some custom compiler options to a VS2008 project containing paths with spaces. As such, I require double quotes around the argument name to ensure the spaces in the path are not interpreted as individual compiler flags. e.g:

set (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} /MyCustomTool:\"$(SolutionDir)\")

The quotes are being removed from the argument. If you put \\\"$(SolutionDir)\\\" then you get MyCustomTool:\"$(SolutionDir)". Better, but still won't compile correctly!

If anyone knows how I can work around this issue I would be very grateful!

Many Thanks,

Luke


More information about the CMake mailing list