[cmake-developers] ADDITIONAL_MAKE_CLEAN_FILES only works in Makefile generators / automoc cleaning problem

Brad King brad.king at kitware.com
Mon May 6 09:10:52 EDT 2013


On 05/02/2013 05:54 PM, Alexander Neundorf wrote:
> I updated the branch on stage.
> The moc file is now added as source to the automoc target.
> There is now:
> * the normal target depends on the automoc target
> * the moc cpp file is a source file of both the normal and the automoc target

Okay, so by adding the custom command to produce the file it ends
up in the normal target as an output of a custom command so VS will
clean it.  That rule will never actually run during the build though
because the automoc target will bring it up to date first.  Even the
newer PRE_BUILD approach on the normal target will bring it up to
date first and the presence of the custom command will merely be
useful for cleaning.

This is good except that the code path you modified is not even
executed for VS anymore.  You'll have to generalize the addition of
the custom command to work in both code paths.

-Brad



More information about the cmake-developers mailing list