title: Cmake string to get key value pairs from a string list containing key values separated by colon
body: <p>I have a stringlist (input):</p>
  <pre><code>set(MY_LIST &quot;A:1;B:2;C:3&quot;)
  </code></pre>
  <p>I want to fetch the key values using foreach and set them as cmake constants. Something like:</p>
  <pre><code>foreach(ITEM ${MY_LIST})
     SET(&lt;ITEM_A&gt; &lt;value_ofA&gt;)
  endforeach()
  </code></pre>
  <p>So basically i want the end result as but this should be achieved using a forloop:</p>
  <pre><code>SET(A &quot;1&quot;)
  SET(B &quot;2&quot;)
  SET(C &quot;3&quot;)
  </code></pre>
  <p>How can i achieve this by using <strong>foreach</strong> to navigate each string in my list and set the key value pairs as cmake constants?</p>