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
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

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake