include dirs (Re: where to install the cmake files to ?)

David Faure faure at kde.org
Sun Feb 19 11:03:10 CET 2006


On Friday 17 February 2006 18:54, Alexander Neundorf wrote:
> If this is considered a problem then we couldn't change it...
We couldn't ??

> > (And of course after the cmake fix for implicitly including the current dir
> > we can clean that up even more)
> >
> > Still talking about include_directories, I foresee already that the
> > Makefile.am problem of "all_includes is used before local includes" will
> > appear in CMakeFiles too, it would nice to have a way to automate that so
> > that every developer doesn't have to remember the rule of putting
> > KDE4_INCLUDE_DIR last...
> 
> Why do you think that KDE4_INCLUDE_DIR has to be put last ?
> If compiling kdelibs/, it points to ${CMAKE_INCLUDE_DIR}.

You don't know? I thought I shouted at everyone for long enough about this,
or made enough commits with the log "$(all_includes) must be after local includes"
(I even wrote a script for that).

OK, imagine you add a method in kapplication.h, and you use that method
from kglobal.cpp (doesn't matter, just another file from the same directory).
If your compiler command line says   -I${KDE4_INCLUDE_DIR} -I${CURRENT_SOURCE_DIR}
then kglobal.cpp will find the *installed* kapplication.h instead of the local one,
and it will not compile, since the new method doesn't exist isn't yet in 
the installed kapplication.h.
OK for this example "" vs <> might make a difference, but that's fragile
and you can always find a case where it breaks, e.g. with subdirs, and header files
which would rather use <>, etc. :)

> > Also, why is it kdelibs/kdecore/CMakeLists.txt which sets kde_datadir and
> > kde_icondir etc.? Won't other modules need this as well?
> 
> The lower-case variables are just for the configure_file() call which creates 
> kde-config.cpp. 

Hmm. Confusing. Can you add a comment there? (or, why can't it use the uppercase vars there?)

> If the variables are used somewhere else, the ones from FindKDE4.cmake (in 
> cmake ALL_UPPER_CASE_STYLE are used).

OK.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).



More information about the Kde-buildsystem mailing list