From 3a0155b69d3f93435a8c006b0a67e3c3e4d8bb05 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 10 Aug 2020 16:10:16 +0200 Subject: [PATCH] [calamares] Fix up multiple-moc of KDSAG - was getting multiple definitions of moc-related code due to automoc combined with KDSAG having its own #include moc, comment-out the include. - while here, simplify the CMake bits for building KDSAG --- .../kdsingleapplicationguard.cpp | 2 +- src/calamares/CMakeLists.txt | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/3rdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp b/3rdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp index cd8fadcce..8ddf7aad6 100644 --- a/3rdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp +++ b/3rdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp @@ -1119,7 +1119,7 @@ void KDSingleApplicationGuard::Private::poll() { } } -#include "moc_kdsingleapplicationguard.cpp" +// #include "moc_kdsingleapplicationguard.cpp" #ifdef KDTOOLSCORE_UNITTESTS diff --git a/src/calamares/CMakeLists.txt b/src/calamares/CMakeLists.txt index ff91904e2..5480dd1f8 100644 --- a/src/calamares/CMakeLists.txt +++ b/src/calamares/CMakeLists.txt @@ -11,15 +11,12 @@ set( calamaresSources ) if( NOT WITH_KF5DBus ) - set( kdsagSources "" ) - foreach( _s - kdsingleapplicationguard/kdsingleapplicationguard.cpp - kdsingleapplicationguard/kdsharedmemorylocker.cpp - kdsingleapplicationguard/kdtoolsglobal.cpp - kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp + set( kdsagSources + ${CMAKE_SOURCE_DIR}/3rdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp + ${CMAKE_SOURCE_DIR}/3rdparty/kdsingleapplicationguard/kdsharedmemorylocker.cpp + ${CMAKE_SOURCE_DIR}/3rdparty/kdsingleapplicationguard/kdtoolsglobal.cpp + ${CMAKE_SOURCE_DIR}/3rdparty/kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp ) - list( APPEND kdsagSources ${CMAKE_SOURCE_DIR}/3rdparty/${_s} ) - endforeach() mark_thirdparty_code( ${kdsagSources} ) list( APPEND calamaresSources ${kdsagSources} ) endif() @@ -46,6 +43,10 @@ calamares_automoc( calamares_bin ) calamares_autouic( calamares_bin ) calamares_autorcc( calamares_bin ) +if( kdsagSources ) + set_source_files_properties( ${kdsagSources} PROPERTIES AUTOMOC OFF ) +endif() + target_link_libraries( calamares_bin PRIVATE calamares