[cmake-developers] Was AUTOMOC designed to run for each build?

Stephen Kelly steveire at gmail.com
Thu Sep 25 19:53:35 EDT 2014


Alexander Neundorf wrote:

>> I don't see why the target is executed each time, but is it that way by
>> design?
> 
> iirc, yes.
> The moc files have to be generated before any of the source files is
> compiled, so automoc is in a target the actual target depends on.
> IIRC it is exclude_from_all so that it is only built when the actual
> target is built.
> Do you think it should only rerun if any of the source files has changed ?
> There was some problem with this.
> The headers are usually not part of the listed source files.

Hmm, well, we do know which header is relevant right? Because it's the one 
(or many) we set up commands to run moc on. Maybe we only know the relevant 
headers too late (at the time of running the -E cmake_autogen command, not 
at cmake time)?

Something else I've wondered is why the parsing of the files is done 
'delayed' with the -E cmake_autogen command. Is it just to avoid doing that 
task during cmake time (because it's time consuming), and to allow 
parallelization?

Thanks,

Steve.






More information about the cmake-developers mailing list