[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    [CMake] custom command with non-zero exit code?
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2014-01-23 22:06:22
Message-ID: CAExHGmQQ8foZ1SNVpfMrtNis_e0aAneyKgDTEvWK4tgAXKSo9g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

[Attachment #5 (text/html)]

<div dir="ltr">Hi,<div><br></div><div>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.</div> <div><br></div><div>Unfortunately the lint tool also \
reports all kinds of warnings it detects and if there&#39;s any warning will generate \
a non-zero exit code. This behaviour is not configurable in any way.</div><div><br> \
</div><div>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.</div> <div><br></div><div>I&#39;m wondering if anybody has come \
across such a situation and wether I&#39;m maybe overlooking a more \
lightweight/easier to understand/simpler solution to the \
issue?</div><div><br></div><div>Andreas</div> </div>



-- 

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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic