cmake issue: includes

Adriaan de Groot groot at
Thu Mar 30 22:00:39 BST 2006

On Thursday 30 March 2006 21:34, Alexander Neundorf wrote:
> On Thursday 30 March 2006 15:39, David Faure wrote:
> > Because it needs to be before any kdelibs-local includes, as you pointed
> > out at the beginning of this mail. So I can't just put QT_INCLUDES in the
> > toplevel CMakeLists.txt, unless we use "include_directories( BEFORE ...
> > )" everywhere, which people will surely forget to do.
> I think so too.
> The response to the idea to make the order of the include dirs configurable
> was not too positive from the cmake developers.
> Their suggestion was to add a macro which does just that:
> add_include_directories( [BEFORE | AFTER] dir1 dir2 ...)
> (or "kde4_include_directories" or "kde4_add_include_directories" or ...
> "macro_include_directories" or "macro_add_include_directories" or ...)
> and which defaults to BEFORE.
> What do you think ?

The important thing is to be able to get the order correct one way or another. 
Right now it looks like every (sub)dir needs to include_directories() for 
local things and dependencies, followed by include_directories() for KDE4.

> > > Why *is* X11_INCLUDES added in the generic includes for everyone?
> >
> > Someone was lazy, IMHO :)
> Well, I considered it a good idea of doing
> include_directories( ${KDE4_INCLUDES} ) gives you basically everything you
> need: KDE, Qt and with X11 also the X includes.
> Otherwise people would have complained "why do I have to write them down
> everywhere each time again one by one.".

It's fine that it's *there*, it's just not in the right place, since it's in 
an include_directories() and the rest of the includes are set as 
KDE4_*_INCLUDES which the subdirs use themselves. The patch I sent (and 
committed) moves X11_INCLUDES to the end of the KDE4_*_INCLUDES, which each 
subdir needs to call include_directories() on anyway.

Does it make sense to do the following:

1) In the root CMakefile, include_directories() *only* for the source and 
build dirs. Those are going to be first anyway.

2) Make sure that the KDE4_*_INCLUDES are set correctly (KDE / Qt / other / 
X11) and require each subdir to include_directories() the relevant one.

It's important not to slip in any autodetected paths for dependencies into the 
includes, since sometimes we *need* to pull stuff out of KDE (source) and not 
any system installed bits. libltdl is such a case, which I'm going to work on 
right now.

These are your friends - Adem
    GPG: FEA2 A3FE Adriaan de Groot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list