Hi Bill,<br><br>When you invoke find_library, FOO is created as a cache entry. As long as FOO has a value (i.e., not FOO_NOTFOUND) find_library will not refresh its contents on succesive runs of cmake. If you unset(FOO CACHE) and rerun cmake, then the foo library will be searched for again.<br>
Is this a good enough solution for your situation?<br><br>Regards,<br><br>Adolfo<br><br><div class="gmail_quote">On Thu, Apr 30, 2009 at 9:55 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;">Lets say I have a CMakeLists.txt that looks like this<br><br>find_library(FOO foo /tmp/a /tmp/b)<br>
add_executable(bar bar.c)<br>target_link_libraries(bar ${FOO})<br>add_test(test_bar bar)<br><br>then I run cmake, FOO is filled in with the located library from /tmp/b, and I run make all;make test. All is good. If I change /tmp/b/libfoo.a then when I run make test the executable is relinked before I execute it. All is good again.<br>

<br>Now lets say a newer copy of the library appears in /tmp/a. <br><br>When I run make test, what I&#39;d like to happen is that we notice it has appeared, and relink against it because we prefer to use /tmp/a/libfoo.a if it exists (hence the order in the find_library).<br>

<br>Is there a way to make that happen? I think if I wrote a raw makefile I could do this with vpaths or somesuch and still get the dependency checking ok. Is there a way with cmake?<br><br>Thanks<br><font color="#888888">b.<br>
<br>
</font><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br><br clear="all"><br>-- <br>Adolfo Rodríguez Tsouroukdissian<br><br>Robotics engineer<br>
PAL ROBOTICS S.L<br><a href="http://www.pal-robotics.com">http://www.pal-robotics.com</a><br>Tel. +34.93.414.53.47<br>Fax.+34.93.209.11.09<br>