KDE/kdelibs/cmake/modules

David Faure faure at kde.org
Thu Feb 16 21:51:26 CET 2006


On Thursday 16 February 2006 21:28, Alexander Neundorf wrote:
> > First with the KDE4Macros.cmake patch which I committed and then reverted,
> > to create foo/bar.moc from foo/bar.h (I think this makes sense, no?).
> 
> I wouldn't do this. Just using CMAKE_CURRENT_BINARY_DIR is ok. We only can get 
> this problem if there are several source files which have the same basename 
> compiled to a target in the same directory. This is in itself not very 
> favorable I think.

Hmm, that's true, with my new solution (moving kab2kabc.cpp) we don't need
this anymore, and I admit it's probably a rare case.

However - the problem of finding kabc/addressbook.{h,moc} remains since
the include dirs point there first. But I agree that this is probably specific to
kdelibs - in other modules we probably won't set up include_directories
statements in the toplevel which point to subdirs of the module.

> kde4_header()

Good thinking :)

> macro(KDE4_HEADER)
>  include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
> endmacro(KDE4_HEADER)

If this isn't done by default (seems cmake will do it), then it would be a solution, yes.
We want to minimize the typing in every cmakelists.txt, and I think there's much work
to be done in that direction ;)  (This also reduces srcdir!=builddir mistakes risks).

> or, as Brad suggested, slightly extended:
>    foreach(d ${ARGV})
This would limit the kde4_header macro to this very usage (specifying subdirs),
which might be limiting for the future, and would be a bit strange when reading
the calling line. Let's avoid that for now. If we say that filenames must be unique
even when splitted into multiple subdirs, because all the generated files will be
put into the same directory, then we don't need this - I foresee already that
a few people will hit the collision there, but since cmake clearly errors in that case,
no problem.

I'll fix kabc without touching kdelibs/cmake then.

-- 
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