[CMake] NSIS template variable substitution.

Nils Gladitz nilsgladitz at gmail.com
Wed Jun 4 15:34:12 EDT 2014


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



More information about the CMake mailing list