[CMake] Precompiled headers (was Re: problem: using options other than -D with VS.NET)

Erik van der Wal kireputsje at dochmarwat.nl
Mon Oct 18 14:41:12 EDT 2004


Brad King wrote:

> Bojan Resnik wrote:
>
>>    A related question - are there any plans to explicitly support
>> generation and usage of precompiled headers for compilers that support
>> it?
>
>
> Currently it is not on the feature list, but it sounds like a good 
> idea.  Please add it to the bug tracker as a feature request:

Well noticed, Bojan, I was indeed referring to precompiled headers. In 
the wxArt2D library we currently use these (not implemented by me).
Like Brad, I think cmake supporting precompiled headers is a good idea.
The precompiled headers in wxart2d are implemented, by creating it using 
some dummy.cpp file, which only includes the (central) header. This is 
done by using the /Yc option.
Next all following c++ files should use this file (/Yu option).
This approach allways worked with VC6, but now we experience problems 
with .NET.
The first problem started this thread and was cmake not accepting the 
/Yu option.
The next problem is related to the compile order. The approach that was 
taken, needs the precompiled header to be created first, i.e. compile 
dummy.cpp first. Most generators I have seen so far, compile in the 
order in which they have been put in the CmakeLists.txt. The .NET 
generator however seems to compile in reverse order.

Questions:
Is the compile order specified in cmake?
If yes, is this a .NET generator bug?
If no, can ADD_DEPENDENCIES be used somehow, to first compile dummy.cpp?

Regards, Erik.



More information about the CMake mailing list