[CMake] Problem with CMAKE_AUTOMOC files not being regenerated or cleaned

Glenn Coombs glenn.coombs at gmail.com
Wed May 1 03:33:30 EDT 2013


I select "Clean Solution" from the Build menu which is a complete clean.
The output looks like this:

1>------ Skipped Clean: Project: INSTALL, Configuration: Debug Win32 ------
1>Project not selected to build for this solution configuration
2>------ Clean started: Project: ALL_BUILD, Configuration: Debug Win32
------
3>------ Clean started: Project: yuv_player, Configuration: Debug Win32
------
4>------ Clean started: Project: yuv_player_automoc, Configuration: Debug
Win32 ------
5>------ Clean started: Project: ZERO_CHECK, Configuration: Debug Win32
------
========== Clean: 4 succeeded, 0 failed, 1 skipped ==========

The yuv_player_automoc project looks like it is being cleaned but the
associated moc_*.cpp and yuv_player_automoc.cpp files are never deleted.
After doing a "Clean Solution" and manually deleting the
yuv_player_automoc.cpp file a build works as expected:

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32
------
2>------ Build started: Project: yuv_player_automoc, Configuration: Debug
Win32 ------
1>  Checking Build System
2>  Automoc for target yuv_player
1>  CMake does not need to re-run because
C:/data/perforceCheckouts/sim/tools/yuvplayer/DEV/glenn.coombs/cmake/CMakeFiles/generate.stamp
is up-to-date.
2>  Generating moc_ctrlBasic.cpp
2>  Generating moc_ctrlmenu.cpp
2>  Generating moc_infoWin.cpp
2>  Generating moc_imageDisplay.cpp
2>  Generating moc_imageDisplayGL.cpp
2>  Generating moc_imageDisplayQt.cpp
2>  Generating moc_multiWindow.cpp
2>  Generating moc_videoGeneric.cpp
...

with the moc_*.cpp files being regenerated.  If I don't manually delete the
yuv_player_automoc.cpp file then the moc_*.cpp files are never regenerated
even if they are out of date compared to the header files they are
generated from.

--
Glenn


On 29 April 2013 17:15, Alexander Neundorf <a.neundorf-work at gmx.net> wrote:

> On Monday 29 April 2013, Glenn Coombs wrote:
> > I added these lines:
> >
> > set_directory_properties(
> >     PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
> >     "${CMAKE_CURRENT_BINARY_DIR}/abc.txt"
> > )
> >
> > # check the location where abc.txt is supposed to be deleted from
> > message("CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}")
> >
> > to the end of my CMakeLists.txt and then created abc.txt in the cmake
> build
> > directory.  I can confirm that the abc.txt file was not deleted by a
> clean
> > solution.  I tried this with Visual Studio 2012 and Visual Studio 2008
> > (both installs are the Express editions) and the results were identical.
>
> I don't have Windows here so this is kind of hard for me...
> Did you do a "complete" clean or just a clean of some part of the whole
> project ?
>
> Alex
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130501/4a3e2463/attachment.htm>


More information about the CMake mailing list