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

Glenn Coombs glenn.coombs at gmail.com
Fri Apr 26 03:37:09 EDT 2013


No, the yuv_player_automoc.cpp file is not removed on a clean (nor are the
other moc_*.cpp files).  Having just modified ctrlBasic.cpp and ctrlBasic.h:

$ ls -ltr moc* ../ctrlMenu/ctrlBasic.*
-rwxr-xr-x+ 1 glenn.coombs Domain Users  4366 Apr 25 15:04
moc_ctrlBasic.cpp*
-rwxr-xr-x+ 1 glenn.coombs Domain Users 11912 Apr 25 15:04 moc_ctrlmenu.cpp*
-rwxr-xr-x+ 1 glenn.coombs Domain Users  8203 Apr 25 15:04 moc_infoWin.cpp*
-rwxr-xr-x+ 1 glenn.coombs Domain Users  3508 Apr 25 15:04
moc_qglDisplay.cpp*
-rwxr-xr-x+ 1 glenn.coombs Domain Users  6493 Apr 25 15:04
moc_qglMultiWindow.cpp*
-rwxr-xr-x+ 1 glenn.coombs Domain Users  2529 Apr 25 15:04
moc_qglWindow.cpp*
-rwxr-xr-x+ 1 glenn.coombs Domain Users  4242 Apr 25 15:04
moc_videoGeneric.cpp*
-rwxr-xr-x+ 1 glenn.coombs Domain Users  8513 Apr 26 08:27
../ctrlMenu/ctrlBasic.cpp*
-rwxr-xr-x+ 1 glenn.coombs Domain Users  1237 Apr 26 08:28
../ctrlMenu/ctrlBasic.h*

I would expect the moc_ctrlBasic.cpp file to be regenerated but it isn't.
In fact, if I manually delete moc_ctrlBasic.cpp then the build fails:

1>------ Build started: Project: yuv_player, Configuration: Debug Win32
------
1>  yuv_player_automoc.cpp
1>yuv_player_automoc.cpp(2): fatal error C1083: Cannot open include file:
'moc_ctrlBasic.cpp': No such file or directory

The only way to get moc_ctrlBasic.cpp regenerated that I have found so far
is to manually delete both it and yuv_player_automoc.cpp.

--
Glenn

On 25 April 2013 21:23, Alexander Neundorf <a.neundorf-work at gmx.net> wrote:

> On Thursday 25 April 2013, Glenn Coombs wrote:
> > Hi,
> >
> > I have a Qt4 program that I'm working on and ran into an issue yesterday
> > with the automoc cpp files.  I had added a new slot and connected a
> > comboxbox currentIndexChanged signal to it but when I ran the program I
> > could see messages on stdout complaining that my slot didn't exist.  I
> > tracked the problem down to the fact that the moc_ctrlBasic.cpp file was
> > not being regenerated.  If I look in my cmake build directory I currently
> > have 8 moc cpp files:
> >
> > ./moc_ctrlBasic.cpp
> > ./moc_ctrlmenu.cpp
> > ./moc_infoWin.cpp
> > ./moc_qglDisplay.cpp
> > ./moc_qglMultiWindow.cpp
> > ./moc_qglWindow.cpp
> > ./moc_videoGeneric.cpp
> > ./yuv_player_automoc.cpp
> >
> > I am using CMake 2.8.10.1 with Visual Studio 11 and when I do a clean
> > solution these 8 moc cpp files are not deleted.
>
> That's ok so far.
> automoc should create a file yuv_player_automoc.cpp, and this file should
> be
> removed when you clean.
> Is that the case ?
> This missing file should then trigger a rerun of automoc.
>
> Alex
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130426/0e8e9c95/attachment-0001.htm>


More information about the CMake mailing list