[Cmake] Precompiled headers with VC++

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Wed Feb 20 13:16:11 EST 2002


> I am wondering how difficult it would be to add "precomplied headers"
feature, which can dramatically decrease the rebuild time?

Its been brought up many times here. The upshot is that its very esy to
implement, simply add
#ifdef VTK_USE_PRECOMPILED_HEADERS
  #include "PrecompiledHeader.h"
#endif

to every cxx file.

The problem is that because classes get added and removed from the various
directories as the code changes that someone has to remember to update the
pch file.  Not a big issue really and I still can't understand why it isn't
in use. (Note that from vtk4 several directories are used and each would
have a slightly different pch set)

The downside is that changes to almost all .h files cause a complete rebuild
of everything, but in my experience (I used pch for several years on my
setup) the increased build time is so dramatic that it far outweighs any
other considerations.

My build times typically went from hours to about 4 minutes for the whole of
vtk (and now I have a machine approx 2x as fast).

John B





More information about the CMake mailing list