On Tue, Jul 1, 2008 at 2:37 PM, Nicolas Desprès &lt;<a href="mailto:nicolas.despres@gmail.com">nicolas.despres@gmail.com</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi list,<br>
<br>
I&#39;m looking for a way to say to find_library (cmake 2.6.0) that I<br>
prefer static libraries rather than shared libraries. It seems that<br>
there is no option to do. The only work around I found is the<br>
following but it is not portable obviously.<br>
<br>
set(CMAKE_FIND_LIBRARY_SUFFIXES &quot;.a;.so&quot;)<br>
find_library(OPENSSL_LIBRARY ssl)</blockquote><div><br>2.6.0 checks the library names specified to find_library() as filenames first so you could do something like this to ensure that on a Unix build it would pick up the static library first:<br>
<br>find_library(OPENSSL_LIBRARY libssl.a)<br>find_library(OPENSSL_LIBRARY ssl)<br>or<br>find_library(OPENSSL_LIBRARY NAMES libssl.a ssl)<br><br>Unfortunately this only works for CMake code that you can control.&nbsp; If one had to use a CMake module to add an external dependency your idea would seem to be the only viable option without modifying the module code itself.<br>
<br></div></div>-- <br>Philip Lowman