On 04.06.2014 21:17, Rick McGuire wrote:
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.

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?


string(REPLACE ";" "\n" MY_OUTPUT "${MY_INPUT}") might work.
If the input uses semicolons for something other than list item separation it might be easier to not set up the content as a list at all. Otherwise those semicolons might have to be escaped and you might have to use REGEX REPLACE instead of REPLACE so that it only replaces unescaped semicolons.

Nils

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to