[CMake] CMake stripping library extensions

Dekeyser, Kris Kris.Dekeyser at lms.be
Mon Oct 4 10:32:42 EDT 2004


CMake version 2.0.3
Platform HPUX
 
On HPUX the linker accepts library names with the -l<name> parameter. It
requires library filenames to start with "lib" and end with either ".a" or
".sl". The linker will then automatically try to locate lib<name>.sl and
lib<name>.a. For the exceptions, where the library filename does not start
with "lib" and/or doesn't end with ".sl" or ".a", the linker also accepts
-l:<filename> where filename can be any valid filename. I happen to have to
link to a third party library with the name ToolKit.sl. I therefore need to
add -l:ToolKit.sl to the linker command-line. So I added
"<libdir>/:ToolKit.sl" to the link list. But CMake changes this into
-L<libdir> -l:ToolKit and always strips the ending .sl from the name. This
makes the linker line invalid as the <filename> should be the complete path.
I also tried to add ":<libdir>/ToolKit.sl", but that ended up in -L<libdir>
-lToolKit with both the : and .sl being stripped by CMake.
 
The only thing that works is:
LINK_DIRECTORIES(<libdir>)
TARGET_LINK_LIBRARIES(<target> ":ToolKit.sl")
 
But as soon as I link the newly created target into another target, the
linker will complain about ToolKit.sl not being found :-((
 
Is there anything else I can try? (except the most obvious one - trying to
force the 3rd party library to use lib<Name>.sl)
 
- Kris
+-+-+- Email Confidentiality Footer +-+-+- 
Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this message (or responsible for delivery
of the message to such person), you may not print, retain, copy nor
disseminate this message or any part of it to anyone and you should notify
the sender by reply email and destroy this message. Neglecting this clause
could be a breach of confidence. Please advise immediately if you or your
employer does not consent to Internet email for messages of this kind.
Opinions, conclusions and other information in this message that are not
related to the official business of my firm shall be understood as neither
given nor endorsed by it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20041004/c9509927/attachment.html


More information about the CMake mailing list