custom command with non-zero exit code?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

custom command with non-zero exit code?

Andreas Pakulat-2

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?



Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: