[Bro-Dev] Bifcl and CMake

Gregor Maier gregor at icir.org
Thu Dec 9 18:09:51 PST 2010


On 12/9/10 17:50 , Jonathan Siwek wrote:
>> Can you tell CMake to remove the generated output files (if they
>> exist) when an add_custom_command failed?
> 
> I'm not sure there's a special CMake way to do it, but you can try appending " || (rm -f ${bifOutputs} && exit 1)" to the ARGS parameter of the add_custom_command.
> 
> Then when `bifcl` exists with non-zero exit status, the `rm` would get invoked and then the `exit 1` would cause the CMake build to abort.

Cool thanks. That worked.

However, I'm just wondering which shell CMake / make use and whether
that syntax will always work ...

> Want to try it out and put it on the fastpath if it works for you?

I don't think it's urgent (the autoconf based build seems to have the
same issue). I have it in my current branch with some other tweaks to
bifcl. I think it's fine if they all get merged together.

cu
Gregor
-- 
Gregor Maier                                             gregor at icir.org
Int. Computer Science Institute (ICSI)          gregor at icsi.berkeley.edu
1947 Center St., Ste. 600                    http://www.icir.org/gregor/
Berkeley, CA 94704
USA


More information about the bro-dev mailing list