[CMake] Parallel moc for Qt files

Benjamin Ballet bballet at ivsweb.com
Fri Jul 7 05:47:20 EDT 2017


I don't know how to parallelize moc with CMake though I previously reduce
moc time (sometimes it's very slow) :

- by replacing as much #include as possible by forward-declaration

- wrapping some #include around #ifndef Q_MOC_RUN ... #endif

2017-07-06 22:00 GMT+02:00 Michael Jackson <mike.jackson at bluequartz.net>:

> 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.
>
> --
> Michael A. Jackson
> BlueQuartz Software, LLC
> [e]: mike.jackson at bluequartz.net
> --
>
> 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/opensou
> rce/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>



-- 
Benjamin Ballet
Ingénieur R&D

<http://www.activisu.com/>

19 rue Klock - 92110 Clichy - FRANCE
Standard : +33 1 44 69 37 37

www.activisu.com

<http://www.activisu.com>

<https://www.linkedin.com/company/ivs>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170707/e4edb4b1/attachment.html>


More information about the CMake mailing list