Escape the dollar sign, like so:<div><br><div>install(CODE "<br>execute_process(COMMAND my_script<br> RESULT_VARIABLE ret_val)<br>MESSAGE(\"install return value is \${ret_val}\")<br>")<br>
<br></div><div>As you had it, ${ret_val} is being evaluated at cmake configure time, and there is just an empty string in the generated file that runs at install time... Escaping the "$" allows evaluation as you intend at install time.</div>
<div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">On Mon, Sep 6, 2010 at 10:05 AM, Jacob Avraham <span dir="ltr"><<a href="mailto:jacob@compass-eos.com">jacob@compass-eos.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
I'm trying to get a return value of a script that I runs from execute_process() command,<br>
as part of an install() command, and I don't see that the return variable is getting any value.<br>
I'm doing something like:<br>
install(CODE "<br>
execute_process(COMMAND my_script<br>
RESULT_VARIABLE ret_val)<br>
MESSAGE(\"install return value is ${ret_val}\")<br>
")<br>
<br>
It does work when not included in an install CODE segment.<br>
<br>
Any idea how to get the make to abort when my_script fails?<br>
<br>
Thanks,<br>
<br>
Jacob<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div></div>