<p dir="ltr">Hi!</p>
<p dir="ltr">Am 20.10.2016 21:08 schrieb "Brad King" <<a href="mailto:brad.king@kitware.com">brad.king@kitware.com</a>>:<br>
> On 10/20/2016 02:30 PM, Alan W. Irwin wrote:<br>
> > To be specific here is the way I believe automoc should work.  If<br>
> ><br>
> > #include "moc_<name>.cpp"<br>
> ><br>
> > is found in a source file under automoc<br>
> > control, then if moc_<name>.cpp could not be found in any of the<br>
> > include directories for the target, then search those include<br>
> > directories (including source-tree equivalents of build-tree include<br>
> > directories) for <name>.h, run moc on that file and place the result<br>
> > moc_<name>.cpp in the build directory corresponding to <name.h>.<br>
> [snip]<br>
> > this is a plea to the CMake developers to fix the above deficiency</p>
<p dir="ltr">If you include moc_name.cpp, then you need to run moc on this *source* file. That is what allows you to have private classes in your source file that derive from QObject.</p>
<p dir="ltr">The headers should be covered by automoc automatically: Any header containing a Q_OBJECT macro should be moc-ed. So there should not be any need to include moc_*.cpp files in source files for any header.</p>
<p dir="ltr">At least that is how I always use this with qmake, but I am hardly an expert on how moc should work:-)</p>
<p dir="ltr">Best Regards,<br>
Tobias<br>
</p>