Fix Qt5DBusMacros.cmake for CMake 3.9

CMake gained support for running AUTOMOC on generated headers,
so we need to mark them with SKIP_AUTOMOC since we're generating
moc files for those already. Otherwise we get duplicated symbols.

Change-Id: Iabd387832cfc74809fc5e6ff4782f4fc83cc07d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
This commit is contained in:
David Faure 2017-07-02 18:10:39 +02:00
parent c8602f45cc
commit f7aaff01de

View File

@ -62,6 +62,7 @@ function(QT5_ADD_DBUS_INTERFACE _sources _interface _basename)
DEPENDS ${_infile} VERBATIM)
set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
set_source_files_properties("${_header}" PROPERTIES SKIP_AUTOMOC TRUE)
qt5_generate_moc("${_header}" "${_moc}")
@ -147,6 +148,7 @@ function(QT5_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optio
qt5_generate_moc("${_header}" "${_moc}")
set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
set_source_files_properties("${_header}" PROPERTIES SKIP_AUTOMOC TRUE)
macro_add_file_dependencies("${_impl}" "${_moc}")
list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")