Are you using "FILE(WRITE"...?<div><br></div><div>What version of CMake?</div><div><br></div><div>This should work. Send the CMake code snippet you are using to try to do this so that we can see what might be wrong.</div>
<div><br></div><div>If using older CMake (2.4.something) then you may have to do:</div><div> set(DOLLAR "$")</div><div> file(WRITE blah "${DOLLAR}{varNameHere}")</div><div><br></div><div>...but escaping the "$" inside a string literal has worked for quite some time now... I'd like to know if you have a different use case or are just seeing older-versioned CMake behavior.</div>
<div><br></div><div><br><br><div class="gmail_quote">On Wed, Sep 30, 2009 at 3:54 AM, <span dir="ltr"><<a href="mailto:fred.antares@free.fr">fred.antares@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">Quoting Marcel Loose <<a href="mailto:loose@astron.nl">loose@astron.nl</a>>:<br>
<br>
> On Wed, 2009-09-30 at 09:28 +0200, <a href="mailto:fred.antares@free.fr">fred.antares@free.fr</a> wrote:<br>
> > Quoting Jeroen Dierckx <<a href="mailto:jeroen.dierckx@gmail.com">jeroen.dierckx@gmail.com</a>>:<br>
> ><br>
> > > On Wed, Sep 30, 2009 at 8:32 AM, <<a href="mailto:fred.antares@free.fr">fred.antares@free.fr</a>> wrote:<br>
> > ><br>
> > > > Hi,<br>
> > > ><br>
> > > > I've seen a previous discussion on this subject, but unfortunately,<br>
> none of<br>
> > > > the<br>
> > > > given solutions (as described on<br>
> > > > <a href="http://www.cmake.org/Wiki/CMake:VariablesListsStrings" target="_blank">http://www.cmake.org/Wiki/CMake:VariablesListsStrings</a>) seem to work in<br>
> my<br>
> > > > case.<br>
> > > ><br>
> > > > I'm using CMake to generate an XML config file, and one of the tags<br>
> must<br>
> > > > have an<br>
> > > > argument as follows: args="${serverConfigChanged}". The XML is used by<br>
> > > > CruiseControl, and unfortunately, it uses the same variable syntax as<br>
> > > > CMake. I<br>
> > > > tried almost every combination of escaping, double dollars, but<br>
> couldn't<br>
> > > > get the<br>
> > > > correct output.<br>
> > > ><br>
> > > > Is there some way to achieve that directly from the CMakeList.txt, or<br>
> > > > should I<br>
> > > > do that in the generator code ?<br>
> > > ><br>
><br>
> Hi Jeroen,<br>
><br>
> What about:<br>
><br>
> file(WRITE /tmp/dummy.xml "args=\"\${serverConfigChanged}\"\n")<br>
><br>
> That works for me. You must escape the double quotes (") and the dollar<br>
> sign ($).<br>
><br>
> Best regards,<br>
> Marcel Loose.<br>
><br>
><br>
<br>
</div></div>Unfortunately, it doesn't work. I already tried escaping the dollar sign and the<br>
result in that case is args="".<br>
<br>
Fred<br>
<div><div></div><div class="h5"><br>
<br>
_______________________________________________<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></div>