Wow, that&#39;s pretty bad. I even replied to one of those threads. Sorry for the noise.  The official bug post for this issue is here:<div><a href="http://public.kitware.com/Bug/view.php?id=10718">http://public.kitware.com/Bug/view.php?id=10718</a></div>
<div><br></div><div>I agree with Alan Irwin that it will continue to haunt users well into the future.</div><div><div><div><br><div class="gmail_quote">On Wed, Sep 8, 2010 at 2:38 AM, Michael Wild <span dir="ltr">&lt;<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5"><br>
On 8. Sep, 2010, at 8:25 , Philip Lowman wrote:<br>
<br>
&gt; Let&#39;s say I have many different potential names for a library and the<br>
&gt; following filesystem<br>
&gt;<br>
&gt; /usr/lib/libnspr4.so<br>
&gt; ${CMAKE_CURRENT_SOURCE_DIR}/libnspr4a.so<br>
&gt;<br>
&gt; find_library(TEST_LIBRARY<br>
&gt;   NAMES nspr4 nspr4a<br>
&gt;   HINTS ${CMAKE_CURRENT_SOURCE_DIR}<br>
&gt; )<br>
&gt;<br>
&gt; I&#39;m somewhat surprised that the following code finds /usr/lib/libnspr4.so<br>
&gt; instead of the alternate name for it (libnspr4a.so).  This tells me that the<br>
&gt; loop is backwards.  Shouldn&#39;t the find_library() command be iterating the<br>
&gt; list of library names across each directory.  For example, the above should<br>
&gt; search:<br>
&gt;<br>
&gt; First ${CMAKE_CURRENT_SOURCE_DIR}...<br>
&gt;  ${CMAKE_CURRENT_SOURCE_DIR}/libnspr4.so<br>
&gt;  ${CMAKE_CURRENT_SOURCE_DIR}/libnspr4a.so<br>
&gt; Then the system directories...<br>
&gt;  (system paths)/lib/libnspr4.so<br>
&gt;  (system paths)/lib/libnspr4a.so<br>
&gt; Etc.<br>
&gt;<br>
&gt; The system is actually searching<br>
&gt; ${CMAKE_CURRENT_SOURCE_DIR}/libnspr4.so<br>
&gt; /usr/lib/libnspr4.so<br>
&gt; ${CMAKE_CURRENT_SOURCE_DIR}/libnspr4a.so<br>
&gt; /usr/lib/libnspr4a.so<br>
&gt;<br>
&gt; This is with CMake 2.8.2<br>
&gt;<br>
&gt; --<br>
&gt; Philip Lowman<br>
<br>
</div></div>Oh, no! This topic haunts the list ;-) See<br>
<br>
<a href="http://www.mail-archive.com/cmake@cmake.org/msg30602.html" target="_blank">http://www.mail-archive.com/cmake@cmake.org/msg30602.html</a><br>
<a href="http://www.mail-archive.com/cmake@cmake.org/msg28946.html" target="_blank">http://www.mail-archive.com/cmake@cmake.org/msg28946.html</a><br>
<a href="http://www.mail-archive.com/cmake@cmake.org/msg27838.html" target="_blank">http://www.mail-archive.com/cmake@cmake.org/msg27838.html</a><br>
<a href="http://www.mail-archive.com/cmake@cmake.org/msg24565.html" target="_blank">http://www.mail-archive.com/cmake@cmake.org/msg24565.html</a><br>
<br>
Michael<br>
<font color="#888888"><br>
--<br>
There is always a well-known solution to every human problem -- neat, plausible, and wrong.<br>
H. L. Mencken<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Philip Lowman<br>
</div></div></div>