FindKdepimLibs should require Boost

Andreas Pakulat apaku at gmx.de
Tue Aug 5 20:22:57 CEST 2008


On 05.08.08 10:28:12, Allen Winter wrote:
> On Tuesday 05 August 2008 10:12:27 Thiago Macieira wrote:
> > On Tuesday 05 August 2008 15:33:07 Allen Winter wrote:
> > > On Monday 04 August 2008 16:53:19 Andreas Pakulat wrote:
> > > > Hi,
> > > >
> > > > I hope the subject doesn't stir up a flame-war. I'm not questioning the
> > > > dependency. My question is: Shouldn't FindKdepimLibs.cmake be requiring
> > > > Boost? There's currently breakage in the 4.1 branch (kdeplasma-addons)
> > > > because one part of the comic dataengine in there uses libsyndication
> > > > from kdepimlibs. However libsyndication contains boost-stuff in its
> > > > public headers, which means one has to also require boost to build the
> > > > comic dataengine completely.
> > > >
> > > > So shouldn't FindKdepimLibs.cmake have a find_package call for Boost,
> > > > probably requiring it. After all its impossible to use all of kdepimlibs
> > > > without boost. Or we need more logic in FindKdepimLibs.cmake setting
> > > > individual _FOUND variables for the individual libs and setting this to
> > > > no if boost is not found but the specific library contains boost stuff
> > > > in its public headers (like libsyndication).
> > >
> > > So if a user is attempting to build kdeplasma-addons from svn
> > > against a distro package of kdepimlibs, and they also didn't
> > > install the boost package ... they will encounter a problem.
> > > gotcha.
> > >
> > > seems that the distro kdepimlibs-devel package should have
> > > a requirement on boost-devel.. but I guess we can't enforce that.
> > 
> > That's right.
> > 
> > But we can enforce in the CMake scripts. If you want to develop against KDE 
> > PIM Libs, you need to have boost installed (whether you use it directly or 
> > not), so the requirement should be there.
> > 
> Right, so we have a couple choices (to summarize the previous postings):
> 1) make FindKdepimLibs.cmake do a find_package(Boost REQUIRED)
> 2) find everything that is using a kdepimlib library that also needs Boost
> and put an individual check (optional) there. Apparently libsyndication
> in kdeplasma-addons is the only known case of this... so far.
> (well, except kdepim which requires Boost anyway)
> 
> looks like someone already took care of #2 for kdeplasma-addons.

No you've got it slightly wrong :) What we should have is either 1) or

3) find everything in kdepimlibs that uses boost and disable usage of it
when boost is not found. This will be done by:

- not putting libfoo include dirs into KDEPIMLIBS_INCLUDE_DIR (if that
  exists)
- not putting libfoo into any _LIBS or _LIBRARIES variables
- setup BAR_FOUND for each lib in kdepimlibs, except those that need
  boost - unless boost is found

Personally I'd go for 1) because:

- people building all themselves will need it to build kdepimlibs in the
  first place
- people using distro packages will get boost (including -dev package)
  by installing the kdepimlibs-dev package. Unless that distro splits up
  kdepimlibs, in which case the distro will make sure there's a
  dependency on libboost-dev if libfoo from kdepimlibs needs boost

I can't see any benefit of making boost optional and thereby trying to
disallow linking against a kdepimlibs library that exposes boost in its
API.

Oh and the fix for kdeplasma-addons is merely a backport from trunk
(which apparently has been forgotten earlier). IMHO we shouldn't force
this kind of think onto every user of kdepimlibs.

Andreas

-- 
What happened last night can happen again.


More information about the Kde-buildsystem mailing list