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 -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
