title: Looping over a string list
body: <p>I would like to loop over list of items, given in a string. As required by CMake, the items are separated by semicolons. The following</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  
  FOREACH(LETTER "a;b;c")
    MESSAGE("&lt;&lt;${LETTER}&gt;&gt;")
  ENDFOREACH()
  </code></pre>
  
  <p>interpretes the string <code>"a;b;c"</code> as string literal. In contrast, when assigning <code>"a;b;c"</code> to a variable first, all works out as expected.</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  
  SET(MYLIST "a;b;c")
  FOREACH(LETTER ${MYLIST})
    MESSAGE("&lt;&lt;${LETTER}&gt;&gt;")
  ENDFOREACH()
  </code></pre>
  
  <p>Is this the recommended way for looping over a list or is there a more elegant solution?</p>