headers installation and compilation tests

David Faure faure at kde.org
Mon Nov 29 00:11:07 GMT 2010


On Monday 09 August 2010, Volker Krause wrote:
> On Saturday 07 August 2010 02:24:16 Aaron J. Seigo wrote:
> > On August 6, 2010, Thiago Macieira wrote:
> > > Side comment: shouldn't all of this (the includes and the installation
> > > rules) be auto-generated?
> > 
> > they should, but as you pointe out they aren't. the result is exctly what
> > one would expect from a manual process: frequent ommissions, occassional
> > 
> >  breakage.
> > 
> > would be a nice little project for someone to work on :)
> 
> Indeed. At least the install part is done automatically in
> kdepimlibs/includes already, with the downside that it only picks up new
> headers after a CMake re-run, but still much nicer than the explicit list
> IMHO. 

I had a look at this, and it doesn't allow to have headers that are 
conditionnally installed -- unless they are in a separate subdir.

So it creates a problem for things like

if(QT_QTOPENGL_FOUND AND OPENGL_FOUND)
   install(FILES
     Plasma/GLApplet
   DESTINATION ${INCLUDE_INSTALL_DIR}/KDE/Plasma COMPONENT Devel)
endif(QT_QTOPENGL_FOUND AND OPENGL_FOUND)

if(NOT KDE_NO_DEPRECATED)
  install( FILES
     Plasma/AnimationDriver
  DESTINATION ${INCLUDE_INSTALL_DIR}/KDE/Plasma COMPONENT Devel)
endif(NOT KDE_NO_DEPRECATED)

and other "if not deprecated" and "if UNIX" tests.
Moving such headers to separate subdirs sounds hackish, and totally breaks any 
hopes of autogenerating the forwarding headers.

I think we should keep the current list of headers in kdelibs, or move to a 
completely automated system where we gather the public headers from each lib 
and generate forwarding headers, which would also make it possible to use 
<KFoo> in kdelibs, but I'm not sure it's worth the trouble.

> It also has a test that makes sure all headers compile with strict
> flags (QT_NO_CAST_FROM_ASCII, etc), might be interesting for kdelibs as
> well.

Yep, very interesting, I just wrote the attached patch in order to check this 
in kdelibs - without using the forwarding headers though, since they don't 
compile in kdelibs before being installed.
Instead I'm doing this per-library, using its already set up include 
directories and their list of installed headers. Attaching, for review on kde-
buildsystem. Tested on kdeui and kio, works fine, needs to be applied to all 
other libs as well.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. Konqueror (http://www.konqueror.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MacroHeaderCompilationTest.diff
Type: text/x-patch
Size: 6624 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20101129/0b88e553/attachment.bin>


More information about the kde-core-devel mailing list