[CMake] Using Checksum to generate files

Michael Wild themiwi at gmail.com
Wed Aug 12 10:45:04 EDT 2009


On 12. Aug, 2009, at 15:33, avner cohen wrote:

> Eric,
> I may have used wrong terminolegy there, my IDLs are indeed part of  
> the the project, It's only that the project is a C++ based project,  
> so the IDLs are not being "compiled" in any way, they are used to  
> generated a set of .h and .cpp files (which in term, are patr of the  
> project.
> As soon as I generate these files, all compilers (xlC, cc and gcc)  
> will execute a full build, even if the files are identical to the  
> previously generated files.
>
> So my main aim is to find a way to:
> 1. Always check if IDL changed.
> 2. Generated ouput .cpp and .h files only IDL are changed.
>
> Thanks,
>
> Avner.
>

Is it just me, or are you kind of impervious to advice? The  
add_custom_command in my example does EXACTLY what you want. It will  
always check whether the .idl file is newer than the corresponding .h  
and .cpp files, and regenerate the .h and .cpp files in that case by  
calling the IDL compiler.

Michael


More information about the CMake mailing list