[CMake] How to get exit status of failing custom_command?

Marcel Loose loose at astron.nl
Fri Jun 26 03:02:28 EDT 2009


Thanks Tyler,

I'll look into it. But it could very well be that I made a mistake in
one of my CMakeLists.txt (or CMake macro) files, since this happened
while I was developing those. At the moment I cannot reproduce the
error.

Best regards,
Marcel Loose.


On Thu, 2009-06-25 at 15:25 -0700, Tyler Roscoe wrote:
> On Thu, Jun 25, 2009 at 11:55:50PM +0200, Marcel Loose wrote:
> > No, I'm not sure. I deduced that the command 'cmake -E copy ...' failed,
> > because the file was not present in the destination directory, which (by
> > the way) needed to be created. So maybe cmake does not return with an
> > error status when the file copy fails?
> 
> Hmm...
> 
> [tylermr at alta:~]$ cmake -E copy tmp.cmake /path/to/nowhere
> Error copying file "tmp.cmake" to "/path/to/nowhere".
> [tylermr at alta:~]$ echo $?
> 1
> 
> [tylermr at alta:~]$ cmake -E copy tmp.cmake /tmp
> [tylermr at alta:~]$ echo $?
> 0
> 
> That looks reasonable. You must have something else going on.
> 
> tyler



More information about the CMake mailing list