[Cmake] Precompiled headers with VC++

Sebastien BARRE sebastien.barre at kitware.com
Thu Feb 21 13:13:13 EST 2002


At 2/21/2002 06:01 PM, John Biddiscombe wrote:
> > Why put the pch files into CVS at all?
>
>This may have stemmed from my using a shorthand notation. The actual pch
>binaries should not not not be in cvs.

I think Jim meant 'pch' = the special file listing the most dependent 
files. Not the binary. Which is huge, path-dependent, etc.

>When someone adds a file to vtkCommon or Gaaphics etc, the list of
>Precompiled #includes needs to be updated. This is what I meant. not the pch
>inaray, but the PrecompiledHeader 'include list.
>
>As for compiler compatibility, Borland has a nuance - the
>#ifdef VTK_Use...
>  #include "PrecompiledHeaders.h"
>  #pragma hdrstop
>#endif
>
>has to be identical in every cxx file within a project, otherwise, it stops
>and rebuilds (defeating the object).

Yes, I think we forgot to mention that: this PrecompiledHeader file has to 
be included before every other #include, because in order the precompiled 
header feature to work you have to include all your headers in the same 
order. Since this is obviously not the case for each .cxx, that's the 
reason why we need this PrecompiledHeaders.h file. I know it looks weird, 
but it makes sense (more details if needed).

>It is therefore wise to have a "PrecompiledHeader.h" file in each directory,
>and each should be different.

Yes, my approach was designed for 3.2. For 4.x we would need one file per 
component/package (Common, Graphics, etc.)

>Rules would be
>For each Target
>   1 Find list of desireable #includes and insert them into
>TargetPrecompiledHeaders.h in correct build directory (eg cxx version of
>sebastiens perl script (most of the dep[endency info is already computed
>elswhere, so maybe it could be used in some way)
>   2 Generate a symbol table name (eg TargetPrecompiledHeaders.csm or
>whatever MSVC uses)

What is that csm file used for in MSVC ?


--
Sebastien Barre




More information about the CMake mailing list