[CMake] custom command with non-zero exit code?

Andreas Pakulat apaku at gmx.de
Thu Jan 23 17:06:22 EST 2014


Hi,

I have a custom command to copy over some javascript files from the source
to the build tree and along with that run them through a javascript lint
tool. The main point of the lint is to catch syntax errors and the like
early on.

Unfortunately the lint tool also reports all kinds of warnings it detects
and if there's any warning will generate a non-zero exit code. This
behaviour is not configurable in any way.

This creates a problem since the commands for add_custom_command seem to be
required to generate a 0 exit code, understandably. My current solution to
that is a cmake script that uses execute_process along with message(
FATAL_ERROR ) if the exit code indicates actual errors in the javascript
files. This is then called from add_custom_command.

I'm wondering if anybody has come across such a situation and wether I'm
maybe overlooking a more lightweight/easier to understand/simpler solution
to the issue?

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140123/0a466bec/attachment.html>


More information about the CMake mailing list