<div class="gmail_quote">On Wed, Jun 22, 2011 at 4:24 PM, Hauke Heibel <span dir="ltr">&lt;<a href="mailto:hauke.heibel@googlemail.com">hauke.heibel@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Jun 22, 2011 at 10:09 PM, Michael Hertling &lt;<a href="mailto:mhertling@online.de">mhertling@online.de</a>&gt; wrote:<br>
&gt; You might use -DMY_VARIABLE=&quot;${ARGUMENTS}&quot; without VERBATIM, and<br>
&gt; SEPARATE_ARGUMENTS(MY_VARIABLE) in Foo.cmake. This doesn&#39;t prevent<br>
&gt; the list&#39;s conversion, but seems a bit smarter than a FOREACH loop.<br>
<br>
</div>I considered this but since MY_VARIABLE contains paths which may<br>
contain white spaces, I explicitly chose the asterisk because it<br>
cannot be part of a path.<br>
<br>
Nonetheless thanks for the reply.<br>
<font color="#888888"><br>
- Hauke<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br><br>We use a similar technique in the ExternalProject module with a parameter we call LIST_SEPARATOR.<br><br>The idea is that you can encode a list with an arbitrary string of your choosing that is not otherwise in your input list (like you&#39;ve chosen the asterisk) into a string that contains no semi-colons. And then decode it with a string replace operation just before using it.<br>
<br>The code used in ExternalProject looks like this:<br>  get_property(sep TARGET ${name} PROPERTY _EP_LIST_SEPARATOR)<br>  if(sep AND command)<br>    string(REPLACE &quot;${sep}&quot; &quot;\\;&quot; command &quot;${command}&quot;)<br>
  endif()<br><br>It ends up lookin like this at the calling point:<br>ExternalProject_Add(proj<br>  ...<br>
  LIST_SEPARATOR ::<br>  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=&lt;INSTALL_DIR&gt;<br>             -DTEST_LIST:STRING=A::B::C<br>  ...<br>)<br><br>I think that&#39;s the best you can do, even though you called it a hack in the original posting. :-)<br>
<br>Let me know if you come up with a non-hack. I&#39;d be curious to see it...<br><br>HTH,<br>David<br><br>