[Cmake] liblib under linux (patch)

Petr Ferschmann petr at ferschmann . cz
14 Jul 2003 11:27:25 +0200


--=-r4ghaOay2WluBpDrH2EC
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

Hello,

I know all that. A lot of programs under windows also has the lib
prefix. Especially when comes from unix world.

Of course there is way to provide variable as part of library name and
on windows to set it to "lib".

There is a lot of libraries that are named with lib (eg. libxml2).
And on windows when you use mingw also every library has prefix "lib".=20
And you can combine libraries from "mingw" and from "msvc".=20
So now it is not only platform specific prefix but also common way=20
of naming libraries.


So I extended the patch to do it conditionally.=20

I also added the CMAKE_DEBUG_PREFIX (or how it is named - not sure now)=20
for Makefile generator. I will send you it in some days - there are still
some problems that I must resolve.

 		Petr Ferschmann


V =C8t, 10. 07. 2003 v 16:52, Bill Hoffman napsal:
> 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.
>=20
> So, I do not think we need to apply the patch.
>=20
> You should just follow the cmake convention:
>=20
> ADD_LIBRARY(web ...)
> TARGET_LINK_LIBRARIES(web)
>=20
>=20
> Since the lib prefix is an OS specified prefix, and CMake is cross platfo=
rm,
> CMake should not try and alter the library name.   Some other OS may put =
some
> different prefix, or have no prefix like windows.
>=20
> I guess I am saying it is a feature and not a bug.
>=20
> -Bill
>=20
> 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.=20
> >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).
> >
> >--=20
> >                                  Petr "Fers" Ferschmann
> >
> > -=3D[  petr at ferschmann . cz  ]=3D=3D[ http://petr . ferschmann . cz/ ]=3D-
> >-=3D[ Koukni na http://www . postcard . cz/ ]=3D=3D[ +420 604/781 009 ]=3D-
> >
> >GPG Fingerprint:
> >[83B0 6378 7A9D D993 035E  60BD FEEC F665 D2C8 1B9A]
> >
>=20
>=20
>=20
> _______________________________________________
> Cmake mailing list
> Cmake at cmake . org
> http://www . cmake . org/mailman/listinfo/cmake
--=20
                                  Petr "Fers" Ferschmann

 -=3D[  petr at ferschmann . cz  ]=3D=3D[ http://petr . ferschmann . cz/ ]=3D-
-=3D[ Koukni na http://www . postcard . cz/ ]=3D=3D[ +420 604/781 009 ]=3D-

GPG Fingerprint:
[83B0 6378 7A9D D993 035E  60BD FEEC F665 D2C8 1B9A]


--=-r4ghaOay2WluBpDrH2EC
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Toto je =?iso-8859-2?Q?digit=E1ln=EC?=
	=?ISO-8859-1?Q?_podepsan=E1?= =?iso-8859-2?Q?_=E8=E1st?=
	=?ISO-8859-1?Q?_zpr=E1vy?=

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA/ECBLKTvcB3Rwi3URAsR2AJ4mmTQS2BYTk8+gTrR1s2p7pjh1LACfYCl+
Z+l3k/o3ya6N/rYur4ToVN8=
=uecl
-----END PGP SIGNATURE-----

--=-r4ghaOay2WluBpDrH2EC--