[cmake-developers] cmake automoc breaks kde

Alexander Neundorf neundorf at kde.org
Tue Nov 29 15:09:56 EST 2011


On Tuesday 22 November 2011, Stephen Kelly wrote:
> On 11/22/2011 10:03 PM, Alexander Neundorf wrote:
> >> Now when I try to build the frameworks branch using the cmake next
> >> branch, I get:
> >> 
> >> AUTOMOC: error:
> >> /home/stephen/dev/src/kf5/tier1/libkcoreaddons/src/io/kdirwatch.cpp: The
> >> file includes the moc file "kdirwatch_p.moc", which seems to be the moc
> >> file from a different source file. This is not supported. Include
> >> "kdirwatch.moc" to run moc on this source file.
> > 
> > I added special handling now for the case that basename_p.moc is included
> > with Qt4.
> 
> Your new commits work with the parts of the frameworks branch affected
> by this, yes.
> 
> However, there are still many places where the foo.moc file is expected
> to be the result of moc'ing the header, which causes errors like this:
> 
> 
> In file included from
> /home/stephen/dev/build/qt48/kf5/tier1/libkdbus/kdbus_automoc.cpp:2:0:
> /home/stephen/dev/build/qt48/kf5/tier1/libkdbus/moc_kdbusinterprocesslock.c
> pp: In static member function 'static void
> KDBusInterProcessLock::qt_static_metacall(QObject*, QMetaObject::Call,
> int, void**)':
> /home/stephen/dev/build/qt48/kf5/tier1/libkdbus/moc_kdbusinterprocesslock.c
> pp:55:22: error: invalid use of incomplete type 'struct
> KDBusInterProcessLockPrivate'
> /home/stephen/dev/build/qt48/kf5/tier1/libkdbus/../../../../../src/kf5/tie
> r1/libkdbus/kdbusinterprocesslock.h:30:7: error: forward declaration of
> 'struct KDBusInterProcessLockPrivate'
> 
> Fixed by changing the include from foo.moc to moc_foo.cpp of course.
> 
> This is due to the use of Q_PRIVATE_SLOT. I've just added a testcase to
> the branch.

Please give the current AutomocIncludedDotMocFileHandling branch a try, it 
checks now also for this.

Alex



More information about the cmake-developers mailing list