wildcards in DEPENDS

Matthias Kretz kretz at kde.org
Wed Nov 19 14:49:10 CET 2008


Hi,

On Tuesday 18 November 2008 20:55:11 Alexander Neundorf wrote:
> On Tuesday 18 November 2008, Matthias Kretz wrote:
> > is it portable to use wildcards in DEPENDS? Like in
> > add_custom_command(OUTPUT ${_automoc_source}
> >          COMMAND ${AUTOMOC4_EXECUTABLE}
> >          DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*
> >          COMMENT ""
> >          VERBATIM
> >          )
> >
> > This seems to be a better solution to get automoc4 to run whenever it's
> > needed (I'll add some more dependencies than the above, but the * part is
> > what I'm wondering about).
>
> Did you try ?
> I would expect that it doesn't work.
> And if it works, it works probably only because of how GNU make interpretes
> the makefiles. I guess it also wouldn't work for files in subdirs ?

I tried on Linux as GNU make documents wildcards to work in dependencies. And 
yes, it works like I want it to.

> > I have the feeling my --touch hack is too fragile for the real world, as
> > can be seen with the many problem reports about kwordwraptest. It happens
> > because the timestamps of kwordwraptest_automoc.cpp and
> > kwordwraptest_automoc.cpp.files tell make that automoc4 doesn't need to
> > run. Though my intention was that .files is always more recent than the
> > .cpp...
>
> Maybe this is caused by the behaviour of usleep() not to sleep as long as
> expected ?

I don't really know how it could happen other than a race condition when 
pressing Ctrl+C.

Yesterday I also remembered why you don't see every automoc4 call take > 1s. 
It's because the touch is only necessary when the _automoc.cpp file is newer 
than the _automoc.cpp.files file. Which doesn't happen that often on update + 
recompile.

> What do you think about the idea with the one global helper target ?

Sounds like a good idea but I have two problems with it:
a) it won't get called on make target/fast
b) there are still race conditions in your proposal such that in the end 
_automoc.cpp is newer than _automoc.cpp.files and the helper target will not 
be instructed to touch _automoc.cpp.files.

Regards,
	Matthias

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/



More information about the Kde-buildsystem mailing list