<div dir="ltr">That depends. Do you want it to be easy or hard to diagnose the failure... :-) (I suppose you could concoct a case where leaving the file would make it easier to diagnose and another case where deleting it would make it easier...)<br>
<br>CMake didn&#39;t write the file, why should it delete it?<br>Shouldn&#39;t the tool that returned the -1 delete the partially written file on a failure...?<br><br>One reason I can think of why CMake shouldn&#39;t be responsible for this is that a custom command may generate *many* files, only one of which might be reasonable to delete on a tool failure.<br>
<br>So..... I think CMake is correct in *not* deleting custom command output files on custom command failure.<br><br>Discussion welcome, though.<br><br>Cheers,<br>David<br><br><br><div class="gmail_quote">On Thu, Oct 16, 2008 at 5:46 PM, James Bigler <span dir="ltr">&lt;<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">So what happens when add_custom_command returns non zero?<br>
<br>
Is the output file supposed to be removed?<br>
<br>
I have a command that returns -1, but happens to leave a partially<br>
written file. &nbsp;Should CMake delete the file for me when the command<br>
fails?<br>
<br>
Thanks,<br>
James<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><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>