Details
-
Suggestion
-
Resolution: Done
-
Not Evaluated
-
4.7.3
-
None
-
Windows / MSVC. Possibly useful for others.
Description
For large projects it would be really useful to have the option to force the moc to add a specific #include before the automatic one, primarily to support the use of precompiled headers (like stdafx.h) with MSVC. This can greatly improve compile times.
Something like the option "-b<file>" which adds "#include <file>" before the regular include would be most useful. I've seen patches for moc on the web which almost do this, but it would be better if it was supported in the core version.
I first raised this in the Qt Dev net forum : http://developer.qt.nokia.com/forums/viewthread/8506/ . Here loladiro notes that the "-f<file>" option already exists, but this replaces the automatic #include, rather than adding one.
The PRECOMPILED_HEADER in qmake may be an option, but actually I'm using cmake to generate the moc commands [I can easily force an extra option to be passed to the moc this way].
Thanks.