add_library NO_PREFIX

Alexander Neundorf neundorf at kde.org
Thu Nov 29 08:08:05 UTC 2012


On Thursday 29 November 2012, Kevin Ottens wrote:
> On Thursday 29 November 2012 08:37:15 Alexander Neundorf wrote:
> > On Thursday 29 November 2012, Kevin Ottens wrote:
> > > Hello,
> > > 
> > > We currently have kde4_add_plugin calls in our cmake files, they can be
> > > replaced with:
> > > add_library(foo MODULE ${foo_SRCS})
> > > set_target_properties(foo PROPERTIES PREFIX "")
> > > 
> > > It's not exactly nice API wise, so after discussing with David, he got
> > > the idea of an extra option to add_library which automates the
> > > properties call,
> > > so the attached patch implements support for the following:
> > > add_library(foo MODULE NO_PREFIX ${foo_SRCS})
> > > 
> > > Any comment? Anyone to sponsor that patch in cmake upstream?
> > 
> > I'd suggest to send this patch to cmake-developers at cmake.org .
> > 
> > I don't have an opinion on this. (Whether the API is nice or not is a
> > matter of taste, and increasing number of things can/has to be set via
> > target properties, so from that POV it can be argued that having to set
> > the PREFIX property is ok.)
> 
> Well, it's also slightly surprising, as I'm used to have modules/plugins
> come with no prefix... Maybe it could be that the default value of PREFIX
> for the MODULE type is "wrong"?
> 
> I'm in fact not sure if that's a KDE custom or something you find
> pervasively. What's your opinion on that point? 

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.

I just had a look at the gimp plugin dir, those seem to be executables (no 
prefix, no suffix, and they say "compose is a GIMP plug-in and must be run by 
GIMP to be used" when executed.

The following packages installed on my system use plugins without "lib" 
prefix: ghostscript, audacious, slang, zsh, gegl, gconv, egl, pango.

The only plugins I found which clearly seemed to be plugins and not shared 
libs which have the "lib" prefix are from CodeBlocks.

So at least it seems to be quite common to have no prefix for plugins.

Alex


More information about the Kde-frameworks-devel mailing list