Hi David, Robert,<br><br>In my project I used the approach taken from FindBoost:<br><br>include(MacroPushRequiredVars)<br>macro_push_variables(CMAKE_FIND_LIBRARY_SUFFIXES)<br><br>if(UNIX AND WITH_MY_LIB_STATIC)<br> # Find only static libraries<br>
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")<br>endif(UNIX AND WITH_MY_LIB_STATIC)<br><br>find_library(MY_LIB NAMES thelibrary ...)<br><br>macro_pop_variables(CMAKE_FIND_LIBRARY_SUFFIXES)<br><br>Actually this code was written for CMake 2.4 and now there may be more convenient functions to push/pop vars. The MacroPushRequiredVars is written by Alexander Neundorf, you can find it with your favorite search engine.<br>
<br>For windows things may be a bit trickier and heavily depend on particular library architecture.<br><br>Regards,<br>Yuri<br><br><div class="gmail_quote">On Thu, Mar 31, 2011 at 7:51 PM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>></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;"><span style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;"><div>
<span style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;">Does:</span></div>
<div><span style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;"><br></span></div> find_library(<br> MY_LIB<br> libthelibrary.a<br> PATHS<br> ...<br> )<br>
</span><br><div>work?</div><div><div></div><div class="h5"><div><br></div><div><br><div class="gmail_quote">On Thu, Mar 31, 2011 at 11:38 AM, Robert Bielik <span dir="ltr"><<a href="mailto:robert.bielik@xponaut.se" target="_blank">robert.bielik@xponaut.se</a>></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;">I'm trying to use find_library to find static (.a) libraries on Mac OS X (cmake 2.8.1). In a lib path I have f.i.:<br>
<br>
.../lib/libthelibrary.a<br>
.../lib/libthelibrary.dylib<br>
<br>
and with:<br>
<br>
find_library(<br>
MY_LIB<br>
thelibrary<br>
PATHS<br>
...<br>
)<br>
<br>
it consequently finds only the .dylib ones, whereas I'd like to get hold of the .a ones...<br>
<br>
How to?<br>
<br>
TIA<br>
/Rob<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></div>
</div></div><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>