From 738842799a84dbf1f4c5c1185818a469d5237c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 31 Mar 2018 16:30:53 +0100 Subject: [PATCH] Make kpmcore link libraries private. --- src/CMakeLists.txt | 7 ++++--- src/fs/filesystem.cpp | 1 + src/fs/filesystem.h | 2 +- src/fs/luks.cpp | 1 + src/fs/luks.h | 2 +- src/plugins/dummy/CMakeLists.txt | 2 +- src/plugins/sfdisk/CMakeLists.txt | 2 +- src/util/externalcommand.cpp | 1 + src/util/externalcommand.h | 3 +-- test/CMakeLists.txt | 2 +- test/testexternalcommand.cpp | 4 ++-- 11 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 00b1b91..156c7cd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,13 +40,14 @@ ki18n_wrap_ui(kpmcore_SRCS ${gui_UIFILES}) add_library(kpmcore SHARED ${kpmcore_SRCS}) target_link_libraries( kpmcore PUBLIC - ${UUID_LIBRARIES} - ${BLKID_LIBRARIES} + PRIVATE + Qt5::Core Qt5::DBus + Qt5::Gui KF5::I18n KF5::CoreAddons KF5::WidgetsAddons - PRIVATE + ${BLKID_LIBRARIES} KF5::Auth ) diff --git a/src/fs/filesystem.cpp b/src/fs/filesystem.cpp index fa4e640..b0e9f04 100644 --- a/src/fs/filesystem.cpp +++ b/src/fs/filesystem.cpp @@ -31,6 +31,7 @@ #include +#include #include #include #include diff --git a/src/fs/filesystem.h b/src/fs/filesystem.h index 27451a7..244c83c 100644 --- a/src/fs/filesystem.h +++ b/src/fs/filesystem.h @@ -22,7 +22,6 @@ #include "util/libpartitionmanagerexport.h" -#include #include #include #include @@ -31,6 +30,7 @@ #include +class QColor; class QValidator; class Device; class Report; diff --git a/src/fs/luks.cpp b/src/fs/luks.cpp index 1554523..b82f64f 100644 --- a/src/fs/luks.cpp +++ b/src/fs/luks.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include diff --git a/src/fs/luks.h b/src/fs/luks.h index 9ee8ea4..bbcab61 100644 --- a/src/fs/luks.h +++ b/src/fs/luks.h @@ -26,11 +26,11 @@ #include "fs/filesystem.h" #include -#include class Report; class QString; +class QWidget; namespace FS { diff --git a/src/plugins/dummy/CMakeLists.txt b/src/plugins/dummy/CMakeLists.txt index f5b2a26..1c04df4 100644 --- a/src/plugins/dummy/CMakeLists.txt +++ b/src/plugins/dummy/CMakeLists.txt @@ -22,6 +22,6 @@ set (pmdummybackendplugin_SRCS add_library(pmdummybackendplugin SHARED ${pmdummybackendplugin_SRCS}) -target_link_libraries(pmdummybackendplugin kpmcore) +target_link_libraries(pmdummybackendplugin kpmcore KF5::I18n KF5::CoreAddons) install(TARGETS pmdummybackendplugin DESTINATION ${KDE_INSTALL_PLUGINDIR}) diff --git a/src/plugins/sfdisk/CMakeLists.txt b/src/plugins/sfdisk/CMakeLists.txt index 6b7df1a..d910c3f 100644 --- a/src/plugins/sfdisk/CMakeLists.txt +++ b/src/plugins/sfdisk/CMakeLists.txt @@ -22,6 +22,6 @@ set (pmsfdiskbackendplugin_SRCS add_library(pmsfdiskbackendplugin SHARED ${pmsfdiskbackendplugin_SRCS}) -target_link_libraries(pmsfdiskbackendplugin kpmcore) +target_link_libraries(pmsfdiskbackendplugin kpmcore KF5::I18n KF5::CoreAddons) install(TARGETS pmsfdiskbackendplugin DESTINATION ${KDE_INSTALL_PLUGINDIR}) diff --git a/src/util/externalcommand.cpp b/src/util/externalcommand.cpp index 9f7cd74..02f60b8 100644 --- a/src/util/externalcommand.cpp +++ b/src/util/externalcommand.cpp @@ -37,6 +37,7 @@ #include #include +#include #include /** Creates a new ExternalCommand instance without Report. diff --git a/src/util/externalcommand.h b/src/util/externalcommand.h index cf9e41e..43b151c 100644 --- a/src/util/externalcommand.h +++ b/src/util/externalcommand.h @@ -24,8 +24,6 @@ #include "core/copysourcedevice.h" #include "core/copytargetfile.h" -#include - #include #include #include @@ -33,6 +31,7 @@ #include #include +class KJob; class Report; /** An external command. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f08c9af..67f63a2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -20,7 +20,7 @@ target_link_libraries(testhelpers) macro (kpm_test name) add_executable(${name} ${ARGN}) - target_link_libraries(${name} testhelpers kpmcore) + target_link_libraries(${name} testhelpers kpmcore Qt5::Core) endmacro() ### diff --git a/test/testexternalcommand.cpp b/test/testexternalcommand.cpp index 5dbabac..aec3d31 100644 --- a/test/testexternalcommand.cpp +++ b/test/testexternalcommand.cpp @@ -22,7 +22,7 @@ #include "backend/corebackendmanager.h" #include "util/externalcommand.h" -#include +#include #include #include @@ -52,7 +52,7 @@ void run() int main( int argc, char **argv ) { - QApplication app(argc, argv); + QCoreApplication app(argc, argv); KPMCoreInitializer i(QStringLiteral("pmsfdiskbackendplugin")); runcmd a;