[CMake] Return code from CMake script

David Cole david.cole at kitware.com
Fri Jun 22 10:09:41 EDT 2012


Presently, there is no way to do that. It would be a reasonable feature
request to add an "EXIT_STATUS" or "EXIT_CODE" parameter to the message
command to enable this functionality.

As an alternative (workaround), perhaps you could write the status value
into a file that you inspect after CMake returns?


HTH,
David


On Fri, Jun 22, 2012 at 9:24 AM, Pere Mato Vila <Pere.Mato at cern.ch> wrote:

> Hi,
>
>  Perhaps this is a trivial question. Is there a way to return a specific
> error code from a CMake script ( -P <file> option)?  The only way I know to
> return a failure is by calling message(FATAL_ERROR ...) and this returns rc
> = 1, but I would like to return the error I got from the underlying process
> execution.
>  Cheers,
>
>
>                                Pere
>
> -------------------------------------------------------------
> Pere Mato  CERN, PH Department, CH 1211 Geneva 23, Switzerland
>          e-mail: pere.mato at cern.ch      tel: +41 22 76 78696
>          fax:  +41 22 76 68792            gsm: +41 76 48 70855
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120622/5427d760/attachment.htm>


More information about the CMake mailing list