wildcards in DEPENDS

Alexander Neundorf neundorf at kde.org
Tue Nov 18 20:55:11 CET 2008


On Tuesday 18 November 2008, Matthias Kretz wrote:
> Hi,
>
> 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 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 ?
What do you think about the idea with the one global helper target ?

Alex


More information about the Kde-buildsystem mailing list