Precompiled headers (PCH) in ITK

CMake 3.16.0 adds support for creating targets with precompiled headers.
I wasn’t familiar with this term, but we have had discussions about instantiating templates to reduce the compile time of the library.

It seems promising and appealing for development, however there is a trade-off, compile time is reduced, but build directory size is increased (because every target will get its own precompiled header).
See this nice blog post, by the Qt team, explaining it and contributed to CMake by Daniel Pfeifer

It would nice to explore it for ITK, I am just starting to read about it, please chime in if you have experience with precompiled headers :slight_smile:

1 Like

I tested pre-compiled headers with the goal to reduce ITK build times extensively a few years ago. Sadly, there was no significant reduction in build times :-(.

1 Like

Ups, good to know @matt.mccormick, thanks!

1 Like