[CMake] what happens when add_custom_command returns non zero

David Cole david.cole at kitware.com
Mon Oct 20 12:55:27 EDT 2008


On Thu, Oct 16, 2008 at 6:03 PM, James Bigler <jamesbigler at gmail.com> wrote:

> I'll grant you that I believe the tool should remove the partially
> written file, but the tool is out of my hands.
>
> So let's say I do this for a work around.
>
> 1. Set the output file as a temporary file.
> 2. Add a second command that moves the temporary file to the desired
> output file.
>
> Questions:
>
> 1. Can CMake help me generate a temporary file name by either giving
> me one or helping me find the temporary directory I could put a
> temporary file into?


$ENV{TMPDIR} or $ENV{TMP} combined with "if(EXISTS" is about the only help
CMake can give you right now w.r.t. a temp file name...


2. Will CMake stop processing the commands of a custom target once the
> previous command produces an error?  The help page doesn't say one way
> or the other.


Not sure. I'd have to experiment or dig into the code. Your own experiment
would probably give you quicker results....


HTH,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081020/1fe4e4ed/attachment.htm>


More information about the CMake mailing list