<div dir="auto"><div dir="auto">Hi Petr,</div><div dir="auto"><br></div><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 9, 2019, 09:57 Petr Kmoch <<a href="mailto:petr.kmoch@gmail.com">petr.kmoch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Hi Ellon.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 9 Oct 2019 at 09:51, Ellon Paiva <<a href="mailto:ellonpaiva@gmail.com" target="_blank" rel="noreferrer">ellonpaiva@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi there,<br>
<br>
I was wondering if there was a way to recover the help text passed to an <br>
option to be used later below in the same CMake script.<br>
<br>
I saw that the help text goes into a comment before the option on the <br>
CMakeCache.txt, but is it stored in any recoverable variable during the <br>
script processing ?<br>
<br></blockquote><div><br></div><div>Since option() just creates a cache variable, you should be able to retrieve that variable's HELPSTRING property ( <a href="https://cmake.org/cmake/help/latest/prop_cache/HELPSTRING.html" target="_blank" rel="noreferrer">https://cmake.org/cmake/help/latest/prop_cache/HELPSTRING.html</a> ):</div><div><br></div><div> option(SampleOpt "Help")<br></div><div> get_property(result CACHE SampleOpt PROPERTY HELPSTRING)</div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif">Awesome, thanks! </span><br></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><font face="sans-serif">Another somehow related question: is there a way to recover the name of all options defined in a project?</font></div><div dir="auto"><font face="sans-serif"><br></font></div><div dir="auto"><font face="sans-serif">Ellon</font></div><div dir="auto"><font face="sans-serif"><br></font></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>Petr<br></div></div></div>
</blockquote></div></div></div>