<div class="gmail_quote">On Fri, Sep 21, 2012 at 1:58 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, Sep 21, 2012 at 1:44 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
> You should avoid using FORCE in the first place.<br>
><br>
> :-)<br>
><br>
><br>
> But if you have to use it, then you should provide the type and<br>
> documentation along with the call that uses FORCE. If you have multiple<br>
> calls that require this information, consider using variables to eliminate<br>
> the duplication and reference the variables from the multiple calls.<br>
<br>
</div>I am using FORCE to do this:<br>
<br>
<a href="http://www.itk.org/Wiki/CMake/Tutorials/SettingVariableGroups" target="_blank">http://www.itk.org/Wiki/CMake/Tutorials/SettingVariableGroups</a><br>
<br>
You can see that my set(...FORCE...) call occurs inside of a foreach:<br>
<br>
set(${_var} OFF CACHE BOOL "test" FORCE)<br>
<br>
I guess to use your suggestion of making a variable that stores the<br>
docstring once and referencing it from multiple places I would have to<br>
use the CMake map emulation for this<br>
(<a href="http://www.cmake.org/Wiki/CMake:VariablesListsStrings#Emulating_maps" target="_blank">http://www.cmake.org/Wiki/CMake:VariablesListsStrings#Emulating_maps</a>)<br>
? Sound like the right thing to do? Or is there an entirely better way<br>
to go about this :) ?<br>
<br>
Thanks,<br>
<br>
David<br>
</blockquote></div><br><div><br></div><div>Well, if ${_var} is already a cache variable, you can retrieve it's HELPSTRING property to see what was set as the original doc string. But if it's not, then there won't be one, and you'll be adding an undocumented option...</div>
<div><br></div><div> <a href="http://cmake.org/cmake/help/v2.8.9/cmake.html#section_PropertiesonCacheEntries">http://cmake.org/cmake/help/v2.8.9/cmake.html#section_PropertiesonCacheEntries</a></div><div><br></div><div><br>
</div>