[CMake] Parallel moc for Qt files

Cristian Adam cristian.adam at gmail.com
Thu Jul 6 18:11:50 EDT 2017


On Thu, Jul 6, 2017 at 10:00 PM, Michael Jackson <
mike.jackson at bluequartz.net> wrote:

> I have a large list of files that need to have Qt's 'moc' run on them (107
> headers). I use all the normal CMake facilities for Qt based projects. I
> noticed that the generation of the moc files are done serially. Is there a
> flag or anything that I can use to run the generation in Parallel? I ask
> because each file takes about 3 seconds to run through moc. The code is
> heavily C++ templated which I think causes 'moc' to run more slowly. We
> have other places in the code where 'moc' must run and it does each file in
> the "blink of an eye".
>
> Just curious.
>
>
Have you tried removing moc altogether using Verdigris
<https://woboq.com/blog/verdigris-qt-without-moc.html>? I'm curious how
this would speed up your compilation time.

Cheers,
Cristian.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170707/592a9235/attachment.html>


More information about the CMake mailing list