Commit c3e629df authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Make krdb a proper library

Making it a library instead of including the source from multiple places
has several advantages. We get proper dependency and include path
propagation. We can specify the krdb dependencies once instead of
repeating them for each kcm. This allows for a better separation between
the KCM's actual dependencies and krdb's dependencies.
parent 2d6b8da1
add_subdirectory(krdb)
add_subdirectory(desktoptheme)
add_subdirectory(icons)
add_subdirectory(translations)
......@@ -7,7 +9,6 @@ if(KUserFeedback_FOUND)
endif()
add_subdirectory(style)
add_subdirectory(krdb)
add_subdirectory(lookandfeel)
add_subdirectory(colors)
if(X11_Xcursor_FOUND)
......
......@@ -2,7 +2,6 @@
add_definitions(-DTRANSLATION_DOMAIN=\"kcm_colors\")
set(kcm_colors_SRCS
../krdb/krdb.cpp
colors.cpp
colorsapplicator.cpp
colorsmodel.cpp
......@@ -33,7 +32,7 @@ target_link_libraries(kcm_colors
KF5::NewStuffCore
KF5::QuickAddons
KF5::WindowSystem
PW::KWorkspace
krdb
)
if(X11_FOUND)
......
......@@ -51,7 +51,7 @@
#include <algorithm>
#include "../krdb/krdb.h"
#include "krdb.h"
#include "colorsapplicator.h"
#include "colorsdata.h"
......
......@@ -11,7 +11,7 @@ xcursor/cursortheme.cpp
xcursor/xcursortheme.cpp
xcursor/previewwidget.cpp
xcursor/sortproxymodel.cpp
../krdb/krdb.cpp )
)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/xcursor/ )
########### next target ###############
......@@ -45,9 +45,8 @@ target_link_libraries(kcm_cursortheme
KF5::KDELibs4Support
KF5::NewStuffCore
KF5::QuickAddons
X11::X11
XCB::XCB
PW::KWorkspace
krdb
)
if (X11_Xcursor_FOUND)
......
......@@ -22,7 +22,7 @@
#include "cursorthemedata.h"
#include "kcmcursortheme.h"
#include "../krdb/krdb.h"
#include "krdb.h"
#include "xcursor/cursortheme.h"
#include "xcursor/previewwidget.h"
#include "xcursor/sortproxymodel.h"
......
......@@ -5,7 +5,7 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kcm_fonts\")
include_directories(../kfontinst/lib)
set(kcm_fonts_PART_SRCS ../krdb/krdb.cpp previewrenderengine.cpp previewimageprovider.cpp fonts.cpp fontsaasettings.cpp ../kfontinst/lib/FcEngine.cpp)
set(kcm_fonts_PART_SRCS previewrenderengine.cpp previewimageprovider.cpp fonts.cpp fontsaasettings.cpp ../kfontinst/lib/FcEngine.cpp)
if(X11_FOUND)
set(kcm_fonts_PART_SRCS ${kcm_fonts_PART_SRCS} ${libkxftconfig_SRCS})
......@@ -23,22 +23,10 @@ kconfig_add_kcfg_files(kcm_fonts_PART_SRCS fontssettings.kcfgc fontsaasettingsba
add_library(kcm_fonts MODULE ${kcm_fonts_PART_SRCS})
target_link_libraries(kcm_fonts Qt::DBus Qt::Xml KF5::KCMUtils KF5::I18n KF5::KDELibs4Support kfontinst)
target_link_libraries(kcm_fonts KF5::I18n KF5::WindowSystem KF5::KCMUtils KF5::QuickAddons KF5::Declarative KF5::KDELibs4Support kfontinst krdb)
if(X11_FOUND)
target_link_libraries(kcm_fonts
Qt::X11Extras
KF5::I18n
KF5::Plasma
KF5::PlasmaQuick
KF5::Declarative
KF5::QuickAddons
KF5::WidgetsAddons
PW::KWorkspace
XCB::IMAGE
)
target_link_libraries(kcm_fonts X11::X11 X11::Xft)
target_link_libraries(kcm_fonts Qt::X11Extras X11::X11 X11::Xft XCB::IMAGE)
endif()
kcoreaddons_desktop_to_json(kcm_fonts "kcm_fonts.desktop")
......
......@@ -43,7 +43,7 @@
#include <KPluginFactory>
#include <KWindowSystem>
#include "../krdb/krdb.h"
#include "krdb.h"
#include "kxftconfig.h"
#include "previewimageprovider.h"
......
......@@ -8,3 +8,8 @@ install(FILES krdb_libpathwipe.upd DESTINATION ${KDE_INSTALL_DATADIR}/kconf_upda
add_executable(krdb_clearlibrarypath krdb_clearlibrarypath.cpp)
target_link_libraries(krdb_clearlibrarypath Qt::Core KF5::KDELibs4Support)
install(TARGETS krdb_clearlibrarypath DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin)
add_library(krdb krdb.cpp)
target_link_libraries(krdb PRIVATE Qt::Widgets Qt::DBus Qt5::X11Extras KF5::GuiAddons KF5::I18n KF5::WindowSystem KF5::ConfigWidgets PW::KWorkspace X11::X11)
install(TARGETS krdb ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
......@@ -19,7 +19,6 @@
#ifndef _KRDB_H_
#define _KRDB_H_
#include <KSharedConfig>
enum KRdbAction {
KRdbExportColors = 0x0001, // Export colors to non-(KDE/Qt) apps
......@@ -29,6 +28,6 @@ enum KRdbAction {
KRdbExportGtkTheme = 0x0010, // Export KDE's widget style to Gtk if possible
};
void runRdb(uint flags);
void Q_DECL_EXPORT runRdb(uint flags);
#endif
......@@ -20,7 +20,6 @@ configure_file (config-kcm.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kcm.h )
set(kcm_lookandfeel_SRCS
kcmmain.cpp
kcm.cpp
../krdb/krdb.cpp
)
if (X11_Xcursor_FOUND)
......@@ -44,22 +43,18 @@ kconfig_add_kcfg_files(kcm_lookandfeel_SRCS lookandfeelsettings.kcfgc GENERATE_M
add_library(kcm_lookandfeel MODULE ${kcm_lookandfeel_SRCS})
target_link_libraries(kcm_lookandfeel
KF5::KIOWidgets
KF5::CoreAddons
KF5::GuiAddons
KF5::KCMUtils
Qt::DBus
KF5::I18n
KF5::Plasma
KF5::PlasmaQuick
KF5::KDELibs4Support
KF5::Declarative
KF5::KCMUtils
KF5::IconThemes
KF5::JobWidgets
KF5::Service
KF5::QuickAddons
KF5::KIOWidgets
KF5::Declarative
KF5::KDELibs4Support
PW::KWorkspace
Qt::DBus
Qt::Widgets
Qt::QuickWidgets
X11::X11
krdb
)
if(X11_FOUND)
......@@ -94,7 +89,6 @@ set(plasma-apply-lookandfeel_SRCS
# TODO: load kcm plugin instead of using code copy
kcm.cpp
lookandfeeldata.cpp
../krdb/krdb.cpp
)
if (X11_Xcursor_FOUND)
......@@ -110,22 +104,19 @@ kconfig_add_kcfg_files(plasma-apply-lookandfeel_SRCS lookandfeelsettings.kcfgc G
add_executable(plasma-apply-lookandfeel ${plasma-apply-lookandfeel_SRCS})
target_link_libraries(plasma-apply-lookandfeel
KF5::KIOWidgets
Qt::DBus
KF5::CoreAddons
KF5::KCMUtils
KF5::I18n
#TODO:kpackage
KF5::Plasma
KF5::PlasmaQuick
KF5::KDELibs4Support
KF5::Declarative
KF5::KCMUtils
KF5::IconThemes
KF5::JobWidgets
KF5::Service
KF5::QuickAddons
KF5::NewStuff
KF5::KIOWidgets
KF5::Declarative
KF5::KDELibs4Support
PW::KWorkspace
Qt::DBus
Qt::Widgets
Qt::QuickWidgets
krdb
)
if(X11_FOUND)
......
......@@ -6,7 +6,6 @@ set( kcmTest_SRCS
kcmtest.cpp
../kcm.cpp
../lookandfeeldata.cpp
../../krdb/krdb.cpp
)
if (X11_Xcursor_FOUND)
......@@ -24,23 +23,20 @@ add_executable(kcmTest ${kcmTest_SRCS})
add_dependencies(kcmTest kcm_lookandfeel)
target_link_libraries(kcmTest
Qt::DBus
Qt::Test
KF5::KIOWidgets
KF5::CoreAddons
KF5::KCMUtils
KF5::I18n
KF5::Plasma
KF5::PlasmaQuick
KF5::KDELibs4Support
KF5::Declarative
KF5::KCMUtils
KF5::IconThemes
KF5::JobWidgets
KF5::Service
KF5::QuickAddons
KF5::NewStuff
KF5::KIOWidgets
KF5::Declarative
KF5::KDELibs4Support
PW::KWorkspace
Qt::DBus
Qt::Widgets
Qt::QuickWidgets
X11::X11
krdb
)
if(X11_FOUND)
......
......@@ -19,7 +19,7 @@
*/
#include "kcm.h"
#include "../krdb/krdb.h"
#include "krdb.h"
#include "config-kcm.h"
#include "config-workspace.h"
......
......@@ -4,7 +4,6 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kcm_style\")
########### next target ###############
set(kcm_style_PART_SRCS
../krdb/krdb.cpp
styleconfdialog.cpp
kcmstyle.cpp
stylesmodel.cpp
......@@ -33,21 +32,14 @@ add_library(kcm_style MODULE ${kcm_style_PART_SRCS})
target_compile_definitions(kcm_style PUBLIC CMAKE_INSTALL_FULL_LIBEXECDIR="${CMAKE_INSTALL_FULL_LIBEXECDIR}")
target_link_libraries(kcm_style
Qt::X11Extras
Qt::DBus
KF5::KCMUtils
KF5::Completion
KF5::I18n
KF5::Notifications
KF5::Plasma
X11::X11
KF5::KIOCore
KF5::KDELibs4Support
KF5::GuiAddons
KF5::QuickAddons
KF5::WindowSystem
KF5::Archive
KF5::NewStuff
PW::KWorkspace
krdb
)
kcoreaddons_desktop_to_json(kcm_style "kcm_style.desktop")
......
......@@ -49,10 +49,9 @@
#include <QWidget>
#include <QWindow>
#include <KGlobal>
#include <KGlobalSettings>
#include "../krdb/krdb.h"
#include "krdb.h"
#include "kded_interface.h"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment