title: cmake list append for compiler flags yields bogus results?
body: <p>I need to add various flags to my C and C++ compile lines in my CMake files (CMake 2.8.10.2).  I see some people use <code>add_definitions</code> but from what I can see that is intended for preprocessor flags (<code>-D</code>).  I have some flags that I don't want passed to the preprocessor.</p>
  
  <p>So I've been trying to modify <code>CMAKE_C_FLAGS</code> and <code>CMAKE_CXX_FLAGS</code>.  I see that some people were using something like:</p>
  
  <pre><code>set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -new -flags -here")
  </code></pre>
  
  <p>but then I read in the cmake docs that this is less efficient, and the right way to do it is to use <code>list(APPEND ...)</code>, like this:</p>
  
  <pre><code>list(APPEND CMAKE_C_FLAGS -new -flags -here)
  </code></pre>
  
  <p>However, when I do this my compile line contains the flags separated by semicolons and is a syntax error.  I read that this is now lists are stored internally, but I figured this would be taken care of by cmake when I used the variable.  This seems so basic; am I doing something wrong?  I mean, what the heck good are these lists if they can't be used unless you happen to want a semicolon-separated list of values (and who wants that, other than I guess Windows %PATH% settings or something)?  Should I be using the quoted version even though the docs suggest it's less efficient/appropriate?</p>