[cmake-developers] Generating files at generate-time

Stephen Kelly steveire at gmail.com
Fri May 3 03:22:46 EDT 2013


Brad King wrote:

> On 05/02/2013 01:44 PM, Stephen Kelly wrote:
>> Brad King wrote:
>>> Make it an error if different *content* will be written to the same
>>> file name by different configurations.  Generate for all configs into
>>> per-config temp files.  Then identify all files that map to a single
>>> name according to the OUTPUT genex and make sure they are the same.
>> 
>> I don't think that requires writing for all configs to temp files. I can
>> write the first file if it doesn't exist, and for subsequent configs,
>> compare the evaluated content with the existing content in the file.
> 
> Yes, that should work too.  Note that for the first config that evaluates
> to a specific output you should write that file unconditionally (or as
> copy-if-different).  It should ignore existing content for comparison
> purposes because the file could exist from a previous run of CMake.
> 

Ok, I've updated my genex-evaluate-file branch with an implementation which 
I'm fairly happy with.

Thanks,

Steve.





More information about the cmake-developers mailing list