[Cmake] liblib under linux (patch)

Bill Hoffman bill . hoffman at kitware . com
Thu, 10 Jul 2003 10:52:29 -0400


lib is a special prefix automatically added for unix.
The library name is really web.a, and that is how it is specified
with the -l option, -lweb.

So, I do not think we need to apply the patch.

You should just follow the cmake convention:

ADD_LIBRARY(web ...)
TARGET_LINK_LIBRARIES(web)


Since the lib prefix is an OS specified prefix, and CMake is cross platform,
CMake should not try and alter the library name.   Some other OS may put some
different prefix, or have no prefix like windows.

I guess I am saying it is a feature and not a bug.

-Bill

At 09:25 AM 7/9/2003, Petr Ferschmann wrote:
>Hello,
>
>in all our projects we use our library named libweb. Under linux it is
>stored in libweb.a and under windows it is store in libweb.lib.
>
>We are building it using CMake. 
>If call ADD_LIBRARY() with libweb under linux it is named
>liblibweb.a.
>
>And I don't want it. So I made change that solve it. If library is
>already starts with lib it doesn't add it again. It is changed only
>under Makefile generator.
>
>It is stored in patch named kerio.diff.
>
>But there is still problem. If I use
>TARGET_LINK_LIBRARIES(someProgram libweb)
>it tries to link with liblibweb. I solved it too (patch named
>kerio2.diff). But this solution is not general.
>If you apply it then you can't link with liblibweb :-) (if somebody
>really use it).
>
>But I think this doesn't happen too often. So I think it could be
>applied too.
>
>Both patches are allowed to be included in CMake distribution - also for
>commercial - ie you can sell it (thanks to Kerio Technologies - my
>employee).
>
>-- 
>                                  Petr "Fers" Ferschmann
>
> -=[  petr at ferschmann . cz  ]==[ http://petr . ferschmann . cz/ ]=-
>-=[ Koukni na http://www . postcard . cz/ ]==[ +420 604/781 009 ]=-
>
>GPG Fingerprint:
>[83B0 6378 7A9D D993 035E  60BD FEEC F665 D2C8 1B9A]
>