Hi!

Am 20.10.2016 21:08 schrieb "Brad King" <brad.k...@kitware.com>:
> On 10/20/2016 02:30 PM, Alan W. Irwin wrote:
> > To be specific here is the way I believe automoc should work.  If
> >
> > #include "moc_<name>.cpp"
> >
> > is found in a source file under automoc
> > control, then if moc_<name>.cpp could not be found in any of the
> > include directories for the target, then search those include
> > directories (including source-tree equivalents of build-tree include
> > directories) for <name>.h, run moc on that file and place the result
> > moc_<name>.cpp in the build directory corresponding to <name.h>.
> [snip]
> > this is a plea to the CMake developers to fix the above deficiency

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.

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.

At least that is how I always use this with qmake, but I am hardly an
expert on how moc should work:-)

Best Regards,
Tobias
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to