cmake 3.9 breaks compiling kconfig (and dbus adaptors/interfaces)

David Faure faure at kde.org
Sun Jul 2 18:11:18 UTC 2017


On vendredi 30 juin 2017 15:28:50 CEST Sebastian Holtermann wrote:
> Hi David.
> 
> >> I think the trouble comes from mixing AUTOMOC with qt5_generate_moc. The
> >> moc file is generated twice
> >> 
> >> 1. By AUTOMOC:
> >> /d/kde/build/5/frameworks/kconfig/autotests/kconfig_compiler/test_signal_
> >> aut ogen/EJRQKI7XPS/moc_test_signal.cpp
> >> 
> >> 2. By qt5_generate_moc:
> >> /d/kde/build/5/frameworks/kconfig/autotests/kconfig_compiler/test_signal.
> >> moc> 
> > The code says:
> >     qt5_generate_moc(${_header_FILE} ${_moc_FILE})
> >    
> >    set_property(SOURCE ${_src_FILE} PROPERTY SKIP_AUTOMOC TRUE)  # don't
> >    run automoc on this file> 
> > so it souds like SKIP_AUTOMOC is broken?
> > 
> >> Does this happen with CMake 3.8.2 as well?
> > 
> > It all builds fine with CMake 3.8.2, I just retried.
> 
> Meanwhile I was able to reproduce the issue.
> At first I thought SKIP_AUTOMOC was broken, too,
> but I could not find a serious flaw there.
> 
> I think the problem is that CMake 3.9 supports AUTOMOC on GENERATED
> files for the first time.
> Some headers in the KDE test cases *are* GENERATED and therefore used
> to be ignored by AUTOMOC - until now.
> A solution on the KDE side might be to enable SKIP_AUTOMOC on the
> respective headers.
> 
> Well, the attached patch fixes the issue on my system.

Thanks, I have pushed the patch for KConfig.

For the record, any use of QT5_ADD_DBUS_INTERFACE or QT5_ADD_DBUS_ADAPTOR
also leads to double-definitions of moc classes, I submitted a fix for Qt at 
https://codereview.qt-project.org/199038

I hope cmake 3.9 doesn't get released too fast...

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-for-CMake-3.9.patch
Type: text/x-patch
Size: 930 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170702/ad1c2e21/attachment.bin>


More information about the Kde-frameworks-devel mailing list