mpyne added a comment.
In fact this appears to force files containing `K_PLUGIN_FACTORY*` into being evaluated by CMake's AUTOMOC (other warning fixes removed files from consideration by CMake AUTOMOC). CMake itself appears to have had an interface change for AUTOMOC between 3.8 and 3.9+. In particular, https://cmake.org/cmake/help/v3.8/manual/cmake-qt.7.html#automoc > If the macro is found in a C++ implementation file, the moc output will be put into a file named according to <basename>.moc, following the Qt conventions. The moc file may be included by the user in the C++ implementation file with a preprocessor #include. If it is not so included, it will be added to a separate file which is compiled into the target. vs. https://cmake.org/cmake/help/v3.9/manual/cmake-qt.7.html#automoc > If the macro is found in a C++ implementation file, the moc output will be put into a file named according to <basename>.moc, following the Qt conventions. The <basename>.moc must be included by the user in the C++ implementation file with a preprocessor #include. I'm not sure what the right answer is, or whether `K_PLUGIN_FACTORY` needs its output to be run through `moc` but if we do need `moc` to run then I'm not sure what's the best way to address the CMake behavior change for .cpp files. REPOSITORY R244 KCoreAddons REVISION DETAIL https://phabricator.kde.org/D9334 To: mlaurent, dfaure Cc: mpyne, ngraham, #frameworks