[cmake-developers] kde4_automoc issue
Alexander Neundorf
neundorf at kde.org
Mon Jul 17 15:50:42 EDT 2006
On Monday 17 July 2006 16:01, you wrote:
> Brad King wrote:
> > Alexander Neundorf wrote:
> >> if (need_automoc)
> >> # create a file with all files for automoc
> >> file(WRITE kfoo_automoc_files ${automocfiles)
> >> # create a target which will be built before the actual target
> >> ADD_CUSTOM_TARGET(kfoo_automoc COMMAND <scan all files from
> >> kfoo_automoc and run moc if required> )
> >> ADD_DEPENDENCIES(kfoo kfoo_automoc)
> >> endif
> >>
> >> This would move the automoc from cmake time to buildtime, which is a
> >> good thing.
> >
> > Try this:
> >
> > ADD_CUSTOM_TARGET(kfoo_automoc)
> > ADD_CUSTOM_COMMAND(
> > OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kfoo_automoc.stamp
> > COMMAND <scan all files and run moc, then touch kfoo_automoc.stamp>
> > DEPENDS <all files>
> > )
>
> Oops, I meant something more like:
>
> ADD_CUSTOM_COMMAND(
> OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kfoo_automoc.stamp
> COMMAND <scan all files and run moc, then touch kfoo_automoc.stamp>
> DEPENDS <all files>
> )
> ADD_CUSTOM_TARGET(kfoo_automoc
> DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/kfoo_automoc.stamp
> )
What is this intermediate target good for ?
Doesn't this mean once kfoo_automoc.stamp has been created it won't run
again ?
And the stamp would have to be on file-level, so that I can check for every
single source file whether it has to be scanned again.
> ADD_DEPENDENCIES(kfoo kfoo_automoc)
Bye
Alex
--
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org - http://www.kde.org
alex AT neundorf.net - http://www.neundorf.net
More information about the cmake-developers
mailing list