[CMake] Double quotes being removed Windows removing compiler flags

David Cole david.cole at kitware.com
Wed Jul 11 12:47:36 EDT 2012


The syntax in your original post is incorrect.

  set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} /Test1:"Test1")

should be:

  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Test1:\"Test1\"")

i.e., to CMake, the set call should look like two arguments here: the
variable name and a double quoted string with any nested quotes escaped
with a \ character

The C and CXX flags variables are all single string values with multiple
flags separated by spaces. With your original syntax, all the spaces get
turned into semi-colons because there are multiple (more than just 2)
arguments to the set command.


HTH,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120711/7d35be59/attachment.htm>


More information about the CMake mailing list