kde4_automoc change (need help)

David Faure faure at kde.org
Mon May 15 15:39:14 CEST 2006


On Friday 12 May 2006 18:21, Alexander Neundorf wrote:
> On Friday 12 May 2006 18:03, David Faure wrote:
> > On Friday 12 May 2006 17:46, Alexander Neundorf wrote:
> > > Different usage:
> > >
> > > set(mySrcs foo.cpp widget.cpp mainwindow.cpp)
> > > kde4_automoc(${mySrcs})   <- detect automatically where to run moc
> > > kde4_add_executable(kfoo ${mySrcs} )
> > >
> > > as opposed to:
> > >
> > > set(mySrcs foo.cpp widget.cpp mainwindow.cpp)
> > > qt4_wrap_cpp(mySrcs foo.h widget.h)   <- list the files which need to be
> > > moc'ed, no autodetection, moc_foo.cxx will be created and added to the
> > > list mySrcs
> >
> > I don't understand the "cpp" in "qt4_wrap_cpp" then, if that function is
> ...must be for historical reasons.
:(
Already historical reasons in the new build system....
How old is qt4_wrap_cpp? Can it be changed? See also below, not only the name seems wrong...

> > about moc'ing header files ;)
> 
> about moc'ing any files.

Doesn't seem to work though.
I get a moc_kovariabletest.cxx [strange extension when qt+kde standardized on .cpp]
which doesn't include any other file, so it doesn't compile. The way moc is called seems
to be for the case where the .cpp includes the .moc (no #includes in the moc file),
but the build system compiles moc_foo.cxx separately so it can't be #included (and it
has the wrong name for that anyway).

> > Anyway, in my case foo.moc would be preferred over moc_foo.cpp, when
> > included by the .cpp file.
> 
> With the qt4_wrap_cpp() the generated files wouldn't be included, but compiled 
> as separate files. I think for unit tests this should be ok.

it's ok but not perfect ;)

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