<div class="gmail_quote">2009/4/30 Bill O'Hara <span dir="ltr"><<a href="mailto:billtohara@gmail.com">billtohara@gmail.com</a>></span><br><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't sure I was explaining very clearly! I think "retriggering find_library" is a far more concise way to say it.<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?</blockquote>
<div><br>I'm not really a cmake developer, but you might try Bill's suggestion of unset(VAR CACHE).<br>You could consider something like this, if you'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 "Search again for Foo" 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're doing in terms of changing preprocessor definitions, include directories, or import libraries, it's usually safest to clean the entire solution after changing your build configuration.<br>
</div></div><br>-- <br>Philip Lowman<br>