add_library NO_PREFIX
Alexander Neundorf
neundorf at kde.org
Thu Dec 13 11:07:36 UTC 2012
On Thursday 29 November 2012, David Faure wrote:
> On Thursday 29 November 2012 09:36:33 Alexander Neundorf wrote:
> > On Thursday 29 November 2012, David Faure wrote:
> > > On Thursday 29 November 2012 09:08:05 Alexander Neundorf wrote:
> > > > In KDE4 we do it this way because we did it this way in KDE3. ;-)
> > > > Personally I don't care much whether plugins have a "lib" prefix or
> > > > not. Not having the "lib" prefix can be interpreted as a hint that
> > > > this file is not a normal shared library.
> > > > Technically it shouldn't matter I think.
> > >
> > > It's more than a hint, it's a strong guarantee, that nobody will ever
> > > succeed in linking to a plugin as if it was a shared lib.
> >
> > At least it is possible:
> > ~/src/test/$ g++ main.cpp /usr/lib/audacious/Output/filewriter.so -o
> > test ~/src/test/$ ldd test
> >
> > linux-gate.so.1 => (0xffffe000)
> > /usr/lib/audacious/Output/filewriter.so (0xb76eb000)
>
> Sure. But at least the -lfilewriter syntax will break :-)
> (Yes, this is about non-cmake users, i.e. people who didn't see the light
> yet)
>
> > Simply changing the default in cmake is probably not possible, since this
> > would break projects which expect to have the "lib" prefix in their
> > plguins.
> >
> > But e.g. by introducing a new cmake policy (e.g. CMP0020: do not set a
> > prefix for MODULE libraries) this should be possible.
> > So whoever says
> > cmake_minimum_required(VERSION 2.8.11)
> > would automatically get this policy activated, and the modules wouldn't
> > have the prefix anymore. This is usually acceptable behaviour for cmake
> > since stating "I need cmake 2.8.11" is interpreted to imply that this
> > users knows what he is doing and that he explicitely asked for the
> > behaviour as it is in 2.8.11.
>
> I would like that very much.
A simple alternative would be to put
if(UNIX)
set(CMAKE_SHARED_MODULE_PREFIX "")
endif()
into e-c-m into KDECMakeSettings.cmake.
Alex
More information about the Kde-buildsystem
mailing list