[CMake] CMake precompiled header support (in MSVC 7.1)

Alexander Jasper alexander.jasper at gmx.net
Wed Jul 18 07:10:20 EDT 2007


Hi all,

First of all I like say thank you to the Cmake community for providing this great build tool free of charge. 

After using it for some while now we are facing problems with the build times. Therefore we think using pre-compiled headers in MSVC 7.1. As CMake doesn’t seem to have "native" support precompiled headers we added the corresponding options to the compiler options by at appropriate Cmake command. Apart from being platform depdent this also has the drawback that MSVC does honor the build ordr that is required when sing PCH. When using PCH “through a file” (usually stdafx.h in MSVC projects) you have a corresponding .ccp file building the precompiled headers while being build itself. Hence, this .ccp has to be the first being built for each project. MSVC takes care of that if indicate what PCH to use in the project settings. But what we are doing is to provide the corresponding options to the compiler directly. The MSVC in this does take care of building the PCH first. This results in an error.

Does anybody know a solution here or have a suggestion or hint?
W/o PCH support building large projects is very time consuming, so I‘m sure there must be solution or were I missing something the manual? Surprisingly  I did not find much information regarding that on the web.

Thanks in advance.

Kind regards

Alexander


More information about the CMake mailing list