[cmake-developers] cmake automoc breaks kde

Alexander Neundorf neundorf at kde.org
Tue Nov 22 13:31:19 EST 2011


On Tuesday 22 November 2011, Alexander Neundorf wrote:
> On Tuesday 22 November 2011, Stephen Kelly wrote:
...
> > This is not uncommon in both KDE and in Qt itself, or any other project
> > where it makes sense to put a QObject-inherited class in the _p.h as an
> > internally used class. See for example, qplaintextedit.cpp:
> > 
> > #include "moc_qplaintextedit.cpp"
> > #include "moc_qplaintextedit_p.cpp"
> > 
> > This should be supported by the automoc feature.
> 
> Yes, it should work.
> I'm adding a test.

Test added, works.
What is not working right now is including someotherfile.moc. I could add 
special handling for including thisfile_p.moc (as opposed to 
moc_thisfile_p.cpp, which works).


> > I have also seen places (I think in QtDeclarative) where a foo.cpp file
> > included the file moc_bar.cpp, though that is very uncommon. The logic
> > that I would use would be something like:
> > 
> > find #include "moc_(.*).cpp" -> generate moc for "\\1.h"
> 
> This should work right now.
> I thought there is a test for this. Checking.

Test added, works.
 
Can you please update from this branch and see what testcases are missing in 
QtAutomoc/Tests/ ?

Thanks
Alex



More information about the cmake-developers mailing list