Challenge for real experts: why does cmake on CI not use automoc for a certain file?

Friedrich W. H. Kossebau kossebau at kde.org
Thu Jun 4 22:58:30 UTC 2015


Hi,

you are a cmake and KDE buildsystem expert?
Prove that yourself and improve the world for others ;)

Here is the challenge:

https://build.kde.org/job/calligra%20frameworks%20kf5-qt5/PLATFORM=Linux,Variation=All,compiler=gcc/28/consoleText

CMakeFiles/KisAsyncMergerTest.dir/kis_async_merger_test.cpp.o: In function 
`KisAsyncMergerTest::KisAsyncMergerTest()':
/home/jenkins/builds/calligra/kf5-
qt5/krita/image/tests/kis_async_merger_test.h:24: undefined reference to 
`vtable for KisAsyncMergerTest'
CMakeFiles/KisAsyncMergerTest.dir/kis_async_merger_test.cpp.o: In function 
`KisAsyncMergerTest::~KisAsyncMergerTest()':
/home/jenkins/builds/calligra/kf5-
qt5/krita/image/tests/kis_async_merger_test.h:24: undefined reference to 
`vtable for KisAsyncMergerTest'
collect2: error: ld returned 1 exit status
krita/image/tests/CMakeFiles/KisAsyncMergerTest.dir/build.make:89: recipe for 
target 'krita/image/tests/KisAsyncMergerTest' failed

Right, you say, smells like automoc not run. And indeed it is not run. So far 
you are an expert.

But why?
Why does cmake on CI not want to run automoc on kis_async_merger_test.{h,cpp}?

Locally it works fine for anyone (cmake 3.0.1/3.0.2), noone yet was able to 
reproduce the problem, instead everyone sees:

[ 53%] Automatic moc for target KisAsyncMergerTest
Generating moc_kis_async_merger_test.cpp
[ 53%] Built target KisAsyncMergerTest_automoc
Scanning dependencies of target KisAsyncMergerTest
[ 53%] Building CXX object 
krita/image/tests/CMakeFiles/KisAsyncMergerTest.dir/kis_async_merger_test.cpp.o
[ 60%] Building CXX object 
krita/image/tests/CMakeFiles/KisAsyncMergerTest.dir/KisAsyncMergerTest_automoc.cpp.o                                                         
Linking CXX executable KisAsyncMergerTest
[ 60%] Built target KisAsyncMergerTest

Also does kis_async_merger_test.{h,cpp} not have a different pattern from all 
other files in the same dir (krita/image/tests), e.g. 
kis_action_recorder_test.{h,cpp} gets automoc run on CI.

Find the respective files at
https://projects.kde.org/projects/calligra/repository/revisions/frameworks/show/krita/image/tests

Your chance for some more beer e.g. at Akademy, and the Calligra devs 
recognition as real cmake and KDE buildsystem expert :)

Cheers
Friedrich


More information about the Kde-buildsystem mailing list