<div dir="ltr">Hi!<div><br></div><div>You can do something like:</div><div><br></div><div><div>---------------------------</div><div></div><div>set(my_list alpha beta gamma)</div><div><br></div><div>message(STATUS "my_list: ${my_list}")</div>
<div><br></div><div># This converts a list into a newline-separated string.<br></div><div>set(res "")</div><div>foreach(x ${my_list})</div><div> set(res "${res}${x}\n")</div><div>endforeach()</div><div>
<br></div><div>message(STATUS "res:\n${res}")</div></div><div><div>---------------------------</div><div></div></div><div><br></div><div>One nice feature of this solution is that it does not rely on the fact that a list is a semicolon-separated string.</div>
<div><br></div><div>When executing this using cmake -P nameOfScript.cmake, you will get the following output:</div><div><br></div><div>---------------------------</div><div><div>-- my_list: alpha;beta;gamma</div><div>-- res:</div>
<div>alpha</div><div>beta</div><div>gamma</div></div><div>---------------------------</div><div><br></div><div>Sincerely,</div><div> Anders Lindgren</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Jun 4, 2014 at 9:17 PM, Rick McGuire <span dir="ltr"><<a href="mailto:object.rexx@gmail.com" target="_blank">object.rexx@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I'm working on a custom NSIS template where I wish to accumulate a set of NSIS commands in a list and then insert those commands into the template file using a variable.<div><br></div><div>I'm able to get the variable substituted, but unfortunately, the list is getting inserted as a single line with semicolons inserted between the list elements. I need to have this inserted as a series of lines rather than a single line. Is there someway to control this substitution? Or as an alternative, is it possible to convert a list of strings into a single string with inserted newlines?</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>Rick</div></font></span></div>
<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</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>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</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>
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></blockquote></div><br></div>