<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">find_library(THELIB NAMES thelibrary.${CMAKE_SHARED_LIBRARY_SUFFIX})</span><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><span class="Apple-style-span" style="font-size: 13px; ">CMAKE_SHARED_LIBRARY_SUFFIX includes the &quot;.&quot; though -- so take the &quot;.&quot; out of the above line.....</span></span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><span class="Apple-style-span" style="font-size: 13px; "><br></span></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font><br><div class="gmail_quote">On Wed, Aug 4, 2010 at 3:53 PM, Alexander Neundorf <span dir="ltr">&lt;<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wednesday 04 August 2010, Dennis Schridde wrote:<br>
&gt; On Wednesday 04 August 2010 10:03:55 Denis Scherbakov wrote:<br>
&gt; &gt; &gt;&gt; 1) Is it<br>
&gt;<br>
&gt; possible to<br>
&gt;<br>
&gt; &gt; retrieve the path where find_library found the library?<br>
&gt;<br>
&gt; E.g. so I can setup<br>
&gt;<br>
&gt; &gt; ..._LIBRARY_DIR correctly.<br>
&gt; &gt;<br>
&gt; &gt; Yes, see<br>
&gt;<br>
&gt; GET_FILENAME_COMPONENT.<br>
&gt;<br>
&gt; &gt; 2) Is it possible to disable the &quot;lib&quot; prefix<br>
&gt;<br>
&gt; that find_library always seems to prepend when searching? I have a library<br>
&gt;<br>
&gt; that is called &quot;thelibrary.so&quot; instead of &quot;libthelibrary.so&quot;.<br>
&gt;<br>
&gt; &gt; Yes,<br>
&gt;<br>
&gt; specify name that you want to find. Like &quot;NAMES libMyLib MyLib&quot;<br>
&gt; Ah, so NAMES<br>
&gt; &lt;name&gt; specifies the literal name, while giving just &lt;name&gt; as a parameter<br>
&gt; to find_library will prepend &quot;lib&quot; and append &quot;.so&quot;?<br>
<br>
</div>No, Denis was only almost right.<br>
<br>
If one of the names has a suffix, this one is treated as a full filename and<br>
nothing will be prepended/appended.<br>
So<br>
find_library(THELIB NAMES thelibrary.so)<br>
or<br>
find_library(THELIB NAMES thelibrary.${CMAKE_SHARED_LIBRARY_SUFFIX})<br>
should do what you want.<br>
<br>
Alex<br>
<div><div></div><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br></div>