[CMake] CUSTOM COMMAND triggered several times

Tyler Roscoe tyler at cryptio.net
Wed Aug 19 11:13:16 EDT 2009


Putting this back on the list.

On Wed, Aug 19, 2009 at 01:55:14PM +0200, Arnaud Devalkeneer wrote:
> I just understood the cmake behaviour.
> In fact cmake seems to compare last modified times for output and
> dependencies.
> If the dependencies are younger than the output, the command is triggered.
> Right?
> 
> But if the custom command has its own state machine to decide if the output
> should be re-generated according to dependencies change,
> this mechanism does not work if the output is not regenerated. In this case,
> the output always remains older than dependencies, and the command is always
> called.
> 
> In my mind I thought that cmake behaviour is ONLY based on last make
> executing time and last modified dependencies times. But it seems not !!
> It seems that a comparaison between last modified times of output and
> dependencies occurs which is I think an error in a general purpose.
> Cmake should not make assumption about user command, and potential update of
> the output. Are you agree with that?

Maybe I'm not understanding you, but are you saying that you don't want
CMake to check whether the OUTPUT is out of date, just the DEPENDS are
out of date? That doesn't make sense. If the DEPENDS are newer than the
OUTPUT, then the OUTPUT *must* be out of date and should be regenerated.

tyler


More information about the CMake mailing list