Other pb with cmake
Alexander Neundorf
neundorf at kde.org
Fri Mar 17 17:28:58 CET 2006
Hi,
On Thursday 16 March 2006 22:27, Laurent Montel wrote:
> On Thursday 16 March 2006 19:08, Alexander Neundorf wrote:
> > They create the moc files in CMAKE_CURRENT_BINARY_DIR .
> > If a source files includes:
> > "#include <myname.moc>" automatically a rule for creating this moc file
> > will be created.
> > This would result in two moc files with the same name in the same
> > directory. This doesn't work.
> >
> > Options:
> > -create the moc files in the subdirs where the object file will be
> > located This directory is currently not part of the include path, so it
> > probably wouldn't be found
>
> I changed today kde macro to create them into own directory.
>
> So it fixed some bugs but it's right include directory is not adding so
> there is some compile error.
> => as david said " Ideally we could automate this include path stuff."
> For the moment it's not the case. I don't know how to do.
I think this cannot work.
Let's say we have
src/board.cpp -> #include "board.moc"
and
src/lib/board.cpp -> #include "board.moc"
If we compile out-of-source, the moc files cannot both be created in the same
directory: e.g. build/board.moc
But creating them in different directories wouldn't help either:
build/board.moc
build/lib/board.moc
In order for the preprocessor to find build/lib/board.moc, build/lib/ would
have to be added to the include path, just as build/ is part of the include
path.
This would mean *both* directories would be in the include path and for both
files, src/board.cpp and src/lib/board.cpp the include path would be the
same, so for both source files the *same* board.moc would be found first, so
both would include build/board.moc.
So I think we really have to change the moc handling for these conflicting
files, i.e. automoc for on of them, and "manual" moc for the others, like
this:
set_source_files_properties(src/lib/board.cpp ...more files
PROPERTIES SKIP_AUTOMOC TRUE)
qt4_wrap_cpp(MY_SRCS src/lib/board.h ...more files which need to be mocced)
Bye
Alex
--
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org - http://www.kde.org
alex AT neundorf.net - http://www.neundorf.net
More information about the Kde-buildsystem
mailing list