Re: [CMake] Return code from CMake script

2012-06-22 Thread Kent Williams
If CMake is running a script via -P, doesn't it return a non-zero status if there's any error? I'd think it would be sufficient to run to the end of the script if everything works fine, but have something like if(something_went_wrong) message(FATAL_ERROR "¡OH NO! ¡SUCEDIO ALGO TERRIBLE!!!") end

Re: [CMake] Return code from CMake script

2012-06-22 Thread Pere Mato Vila
On Jun 22, 2012, at 4:25 PM, David Cole wrote: As an alternative (workaround), perhaps you could write the status value into a file that you inspect after CMake returns? Unfortunately this is not possible because who calls by script is ctest. Then it should definitely be possible. I meant

Re: [CMake] Return code from CMake script

2012-06-22 Thread David Cole
On Fri, Jun 22, 2012 at 10:15 AM, Pere Mato Vila wrote: > Thanks very much for you prompt answer. > > > As an alternative (workaround), perhaps you could write the status value > into a file that you inspect after CMake returns? > > > Unfortunately this is not possible because who calls by scr

Re: [CMake] Return code from CMake script

2012-06-22 Thread Pere Mato Vila
Thanks very much for you prompt answer. As an alternative (workaround), perhaps you could write the status value into a file that you inspect after CMake returns? Unfortunately this is not possible because who calls by script is ctest. Cheers, Pere ---

Re: [CMake] Return code from CMake script

2012-06-22 Thread David Cole
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 re

[CMake] Return code from CMake script

2012-06-22 Thread Pere Mato Vila
Hi, Perhaps this is a trivial question. Is there a way to return a specific error code from a CMake script ( -P 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 proc