<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head></head><body><div style="font-size: 12pt; font-family: Calibri,sans-serif;"><div id="htc_header">----- Reply message -----<br>From: "j s" <j.s4403@gmail.com><br>To: "Michael Wild" <themiwi@gmail.com><br>Cc: "CMake mailing list" <cmake@cmake.org><br>Subject: [CMake] write file if different?<br>Date: Wed, May 29, 2013 20:44</div></div><br><pre style="word-wrap: break-word; white-space: pre-wrap;">On Wed, May 29, 2013 at 2:32 AM, Michael Wild <themiwi@gmail.com> wrote:
>
> On 28.05.2013 22:07, Matthew Woehlke wrote:
> > Is there a built-in way to write a string to a file (a la FILE(WRITE))
> > that will only write the file if the content would be different? (Or
> > does FILE(WRITE) already work this way despite no obvious hint in the
> > documentation that it does?)
> >
> > Right now I am writing to a temporary file and running cmake -E
> > copy_if_different, then removing the temporary file, but this seems
> > inelegant and I am wondering if there is a better solution.
> >
You can always use the rsync command, which is available for all
systems, including Windows.
</pre><pre style="word-wrap: break-word; white-space: pre-wrap;">That's probably the worst possible solution... CMake has everything that iy required to accomplish this built-in, so adding a unnecessary dependency that is only needed by the build system is a really bad idea...</pre></body></html>