[CMake] CUSTOM COMMAND triggered several times

Arnaud Devalkeneer adevalkeneer at gmail.com
Fri Aug 21 04:24:08 EDT 2009


Hello Tyler,

I am not fully agree with your opinion.

In my case, I can't change the command behaviour I call. So I must tune
cmake scripts to make it works.
In other words, the sentence :
" If the DEPENDS are newer than the
OUTPUT, then the OUTPUT *must* be out of date and should be regenerated."
is a too strong assumption in my case.

More comparison between last make execution time AND last modified
dependency times must be enough to make cmake awares of
custom command triggering in a general case (like for source files I guess).
Mustn't it?

Anyway there is a workaround using temporary files, but it is not so
beautifull...

Thanks a lot for your support.

Arnaud.

On Wed, Aug 19, 2009 at 5:13 PM, Tyler Roscoe <tyler at cryptio.net> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090821/b5145769/attachment.htm>


More information about the CMake mailing list