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

Alexander Neundorf neundorf at kde.org
Thu May 2 17:54:17 EDT 2013


On Tuesday 30 April 2013, Brad King wrote:
> On 04/29/2013 05:44 PM, Alexander Neundorf wrote:
> > On Monday 29 April 2013, Brad King wrote:
> >> VS needs to know that the file is the output of a custom command.
> >> In order for CMake to tell VS about this, the file needs to be
> >> listed as an OUTPUT in add_custom_command.
> > 
> > This is now in the AutomocFixCleaningHandling branch.
> > It would be nice if you could have a look at it.
> 
> The AddCustomCommandToOutput is okay but there is nothing that
> associates that output with the target.  You should continue to use
> AddUtilityCommand but with an empty command line.  Instead list the
> AddCustomCommandToOutput output in the "depends" list.


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

Should that be ok ?
 
> However, there is another problem to consider.
> 
> Look just above your patch.  In VS generators we now use a PRE_BUILD
> event instead of a normal custom command with an output.  This was
> originally motivated by issue
> 
>  http://www.cmake.org/Bug/view.php?id=13900
> 
> but makes much nicer looking VS solutions anyway.  Unfortunately the
> PRE_BUILD event has no "output" to clean so VS will not clean anything.
> 
> Perhaps instead we can implement ADDITIONAL_MAKE_CLEAN_FILES, at least
> in VS >= 10.  See the BeforeClean and AfterClean targets here:
> 
>  http://msdn.microsoft.com/en-us/library/ms366724.aspx

Let's see...

Alex



More information about the cmake-developers mailing list