Result variable behaviour for execute_process() different from docs
In the documentation for execute_process()
, it says the following:
RESULT_VARIABLE
The variable will be set to contain the result of running the processes. This will be an integer return code from the last child or a string describing an error condition.
What I've observed, however, is that the result variable is empty when a command succeeds, but according to the docs, it would seem that it should instead have the value 0, which is the usual integer return code indicating success. The odd thing is, looking at the CMake code, it looks like it should be getting an integer value here, so it's not clear how the result variable is ending up empty.
I'm testing on OS X at the moment, but I'm pretty sure I've seen it on Linux and other platforms too. Also note that changing the existing behaviour has the potential to break existing projects, so this one may require changing the docs to match the behaviour rather than fixing a bug in the code.