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.<br><br><br><div class="gmail_quote">On Thu, Apr 30, 2009 at 5:16 PM, Philip Lowman <span dir="ltr">&lt;<a href="mailto:philip@yhbt.com">philip@yhbt.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;"><div class="gmail_quote"><div class="im">2009/4/30 Bill O&#39;Hara <span dir="ltr">&lt;<a href="mailto:billtohara@gmail.com" target="_blank">billtohara@gmail.com</a>&gt;</span><br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks - I wasn&#39;t sure I was explaining very clearly! I think &quot;retriggering find_library&quot; is a far more concise way to say it.<div class="im"><br><br>Could perhaps a cmake developer comment on whether its possible to do this? Is there some workaround we could currently use to retrigger the find_library to check whether we need to relink before running an executable via a make target?</div>
</blockquote>
<div><br>I&#39;m not really a cmake developer, but you might try Bill&#39;s suggestion of unset(VAR CACHE).<br>You could consider something like this, if you&#39;re looking for an interactive way to do it.<br><br>if(RETRIGGER_SEARCH_FOR_FOO)<br>

   unset(FOO_LIBRARY CACHE)<br>   unset(FOO_INCLUDE_DIR CACHE)<br>   # etc.<br>   unset(RETRIGGER_SEARCH_FOR_FOO CACHE)<br>endif()<br>option(RETRIGGER_SEARCH_FOR_FOO &quot;Search again for Foo&quot; OFF)<br>
<br>find_package(FOO)<br><br><br>Also, often this goes unspoken on the mailing list but do bear in mind that not all IDEs force recompilation of source files when you change include directories or force relinking when you change library filenames (VS with CMake generated project files is a prime example).  Unless you know exactly what you&#39;re doing in terms of changing preprocessor definitions, include directories, or import libraries, it&#39;s usually safest to clean the entire solution after changing your build configuration.<br>

</div></div><br>-- <br><font color="#888888">Philip Lowman<br>
</font></blockquote></div><br>