[CMake] TARGET_LINK_LIBRARIES question
Thomas Christian Chust
chust at web.de
Wed Apr 11 09:15:28 EDT 2007
a.neundorf-work at gmx.net wrote:
> david.rhoda at kodak.com wrote:
>
>> [...]
>> When I TARGET_LINK_LIBRARIES( test /path/to/libA.lib) I get the equivalent
>> of -L /path/to -l libA.lib. I'd like to get -l /path/to/libA.lib. Is
>> that possible?
>
> Currently this is not possible. You also shouldn't need it. CMake orders the
> directories so that you should get the libs you want.
> Do you have a case where this doesn't work ?
> [...]
Hello,
most of the time this behaviour of CMake is very desirable, but I have
been running into trouble with it on MacOS X.
When both a shared and a static library of the same name exist (as is
often the case with libraries installed by libtool based builds), the
linker flags computed by CMake always reference the shared library (even
if it is in a directory different from the static one and even if this
directory is later on the library search path) and if you don't want
that, you have to construct all the flags by hand or uninstall the
shared library :-(
I posted this problem earlier on this list, but nobody came up with a
good solution for it. I also don't know if there really is a good
solution or if one should consider the Mach-O linker design broken ;-)
cu,
Thomas
More information about the CMake
mailing list