So what happens when add_custom_command returns non zero? Is the output file supposed to be removed? I have a command that returns -1, but happens to leave a partially written file. Should CMake delete the file for me when the command fails? Thanks, James