<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 "." though -- so take the "." 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"><<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>></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>
> On Wednesday 04 August 2010 10:03:55 Denis Scherbakov wrote:<br>
> > >> 1) Is it<br>
><br>
> possible to<br>
><br>
> > retrieve the path where find_library found the library?<br>
><br>
> E.g. so I can setup<br>
><br>
> > ..._LIBRARY_DIR correctly.<br>
> ><br>
> > Yes, see<br>
><br>
> GET_FILENAME_COMPONENT.<br>
><br>
> > 2) Is it possible to disable the "lib" prefix<br>
><br>
> that find_library always seems to prepend when searching? I have a library<br>
><br>
> that is called "thelibrary.so" instead of "libthelibrary.so".<br>
><br>
> > Yes,<br>
><br>
> specify name that you want to find. Like "NAMES libMyLib MyLib"<br>
> Ah, so NAMES<br>
> <name> specifies the literal name, while giving just <name> as a parameter<br>
> to find_library will prepend "lib" and append ".so"?<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>