On Tue, Jul 1, 2008 at 2:37 PM, Nicolas Desprès <[EMAIL PROTECTED]> wrote:
> Hi list, > > I'm looking for a way to say to find_library (cmake 2.6.0) that I > prefer static libraries rather than shared libraries. It seems that > there is no option to do. The only work around I found is the > following but it is not portable obviously. > > set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so") > find_library(OPENSSL_LIBRARY ssl) 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: find_library(OPENSSL_LIBRARY libssl.a) find_library(OPENSSL_LIBRARY ssl) or find_library(OPENSSL_LIBRARY NAMES libssl.a ssl) Unfortunately this only works for CMake code that you can control. 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. -- Philip Lowman
_______________________________________________ CMake mailing list [email protected] http://www.cmake.org/mailman/listinfo/cmake
