[CMake] FIND_LIBRARY finding .dylib or .a

Brandon Van Every bvanevery at gmail.com
Tue Jul 31 17:10:34 EDT 2007


On 7/31/07, Mike Jackson <imikejackson at gmail.com> wrote:
> what is the magic incantation to tell FIND_LIBRARY to prefer .dylibs
> instead of .a (shared vs static)? I have what seem to be the same
> command yet one will find the .a and the other will find the .dylib.
> The commands look the same to me?
>
> Any help is appreciated.. cmake --help-command FIND_LIBRARY wasn't
> any help
>
> This is with cmake 2.4.6 on OS X 10.4.10 (intel)

Static linkage is officially depreciated on OS X.  The MacOS linker
does extremely obnoxious things like grabbing any dynamic library
available anywhere in preference to the static library you name, if
the static and dynamic libraries have the same name.  This has nothing
to do with CMake per se.  Autotools works its way around this problem
somehow apparently, but the correct answer for almost everybody is not
to do static linking on OS X at all.


Cheers,
Brandon Van Every


More information about the CMake mailing list