Re: [cmake-developers] ADDITIONAL_MAKE_CLEAN_FILES only works in Makefile generators / automoc cleaning problem
On 05/06/2013 03:57 PM, Alexander Neundorf wrote: On Monday 06 May 2013, Brad King wrote: 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. I'll do that. Alex, this has been sitting in the AutomocFixCleaningHandling topic on the stage for a while. Please update or remove the topic. Thanks, -Brad -- 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
Re: [cmake-developers] ADDITIONAL_MAKE_CLEAN_FILES only works in Makefile generators / automoc cleaning problem
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 -- 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
Re: [cmake-developers] ADDITIONAL_MAKE_CLEAN_FILES only works in Makefile generators / automoc cleaning problem
On Monday 06 May 2013, Brad King wrote: 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 Ok :-) 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. I'll do that. Thanks 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
Re: [cmake-developers] ADDITIONAL_MAKE_CLEAN_FILES only works in Makefile generators / automoc cleaning problem
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
Re: [cmake-developers] ADDITIONAL_MAKE_CLEAN_FILES only works in Makefile generators / automoc cleaning problem
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. 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 -Brad -- 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
[cmake-developers] ADDITIONAL_MAKE_CLEAN_FILES only works in Makefile generators / automoc cleaning problem
Hi, in automoc, for every target foo a foo_automoc target is created, and for each of those a file foo_automoc.cpp is created. When this file does not exist, automoc reruns and all moc files should be regenerated. To achieve this, I added this file in cmQtAutomoc.cxx to the ADDITIONAL_MAKE_CLEAN_FILES property, so it is removed on make clean. Now after some emails on the cmake list, it seems ADDITIONAL_MAKE_CLEAN_FILES is used only by the Makefile-generators, but not by e.g. the VS generators ? The target is created using cmMakefile::AddUtilityCommand(). What would be the recommended way to add a generated file, so that it is removed when cleaning ? Do I need to create a cmSourceFile and set it to GENERATED ? 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
Re: [cmake-developers] ADDITIONAL_MAKE_CLEAN_FILES only works in Makefile generators / automoc cleaning problem
On 04/29/2013 03:05 PM, Alexander Neundorf wrote: Now after some emails on the cmake list, it seems ADDITIONAL_MAKE_CLEAN_FILES is used only by the Makefile-generators, but not by e.g. the VS generators ? VS does its own cleaning of the build outputs it knows. The target is created using cmMakefile::AddUtilityCommand(). What would be the recommended way to add a generated file, so that it is removed when cleaning ? Do I need to create a cmSourceFile and set it to GENERATED ? 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. -Brad -- 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
Re: [cmake-developers] ADDITIONAL_MAKE_CLEAN_FILES only works in Makefile generators / automoc cleaning problem
On Monday 29 April 2013, Brad King wrote: On 04/29/2013 03:05 PM, Alexander Neundorf wrote: Now after some emails on the cmake list, it seems ADDITIONAL_MAKE_CLEAN_FILES is used only by the Makefile-generators, but not by e.g. the VS generators ? VS does its own cleaning of the build outputs it knows. The target is created using cmMakefile::AddUtilityCommand(). What would be the recommended way to add a generated file, so that it is removed when cleaning ? Do I need to create a cmSourceFile and set it to GENERATED ? 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. Thanks 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