<div class="gmail_quote">On Thu, Apr 30, 2009 at 8:41 PM, Bill O&#39;Hara <span dir="ltr">&lt;<a href="mailto:billtohara@gmail.com">billtohara@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for the suggestion - a useful trick to have. I&#39;d love an automatic way to trigger it though rather than having to run make rebuild_cache or thiis unset of the variable.</blockquote><div><br>You could simply do this...<br>
<br>unset(FOO_LIBRARY CACHE)<br>find_library(FOO ...)<br><br>In addition to slowing you down on every configure, this has the unfortunate side effect, however, of making it impossible for the user to edit the cache entry from within the CMake cache editor since it will be immediately unset on the next configure.  This may not be a big issue for you though.<br>
<br>If you needed the ability for users to change cache entries, I suppose you could use a couple of variables....<br><br>find_library(FOO_LIBRARY_OVERRIDE ...)<br>unset(FOO_LIBRARY_NO_EDIT)<br>find_library(FOO_LIBRARY_NO_EDIT ...)<br>
mark_as_advanced(FOO_LIBRARY_NO_EDIT)<br>if(FOO_LIBRARY_OVERRIDE)<br>   set(FOO_LIBRARY ${FOO_LIBRARY_OVERRIDE})<br>else()<br>   set(FOO_LIBRARY ${FOO_LIBRARY_NO_EDIT})<br>endif()<br># link against ${FOO_LIBRARY})<br><br>
</div></div><br>-- <br>Philip Lowman<br>