Commit 47cf7ef4 authored by David Redondo's avatar David Redondo 🏎
Browse files

Build settings related code only once

Extract configuration related code into an internal library called settings
that the other targets are linked to.
parent b1a7072c
......@@ -149,6 +149,7 @@ include(ECMQtDeclareLoggingCategory)
add_subdirectory(kcheckpass)
add_subdirectory(greeter)
add_subdirectory(kcm)
add_subdirectory(settings)
add_definitions(-DTRANSLATION_DOMAIN=\"kscreenlocker\")
......@@ -167,7 +168,6 @@ set(ksld_SRCS
waylandserver.cpp
powermanagement.cpp
powermanagement_inhibition.cpp
kscreensaversettings.cpp
)
ecm_qt_declare_logging_category(ksld_SRCS
......@@ -183,7 +183,6 @@ ecm_qt_declare_logging_category(ksld_SRCS
qt5_add_dbus_adaptor(ksld_SRCS ${screensaver_dbusXML} interface.h ScreenLocker::Interface)
qt5_add_dbus_adaptor(ksld_SRCS ${kscreensaver_dbusXML} interface.h ScreenLocker::Interface kscreensaveradaptor KScreenSaverAdaptor)
kconfig_add_kcfg_files(ksld_SRCS GENERATE_MOC kcfg/kscreensaversettingsbase.kcfgc)
qt5_add_dbus_interface(ksld_SRCS ${powerdevilpolicyagent_xml} powerdevilpolicyagent)
ecm_add_wayland_server_protocol(ksld_SRCS
......@@ -198,6 +197,7 @@ PUBLIC
Qt5::Core
Qt5::X11Extras
PRIVATE
settings
Qt5::DBus
KF5::I18n
KF5::IdleTime
......
......@@ -12,8 +12,6 @@ set(kscreenlocker_greet_SRCS
greeterapp.cpp
main.cpp
noaccessnetworkaccessmanagerfactory.cpp
lnf_integration.cpp
wallpaper_integration.cpp
kwinglplatform.cpp
)
......@@ -33,7 +31,7 @@ ecm_qt_declare_logging_category(kscreenlocker_greet_SRCS
)
qt5_add_resources(kscreenlocker_greet_SRCS fallbacktheme.qrc)
kconfig_add_kcfg_files(kscreenlocker_greet_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../kcfg/kscreensaversettingsbase.kcfgc)
ecm_add_wayland_client_protocol(kscreenlocker_greet_SRCS
PROTOCOL ../protocols/ksld.xml
......@@ -43,6 +41,7 @@ ecm_add_wayland_client_protocol(kscreenlocker_greet_SRCS
add_executable(kscreenlocker_greet ${kscreenlocker_greet_SRCS})
target_link_libraries(kscreenlocker_greet
settings
KF5::Package
KF5::Crash
KF5::I18n
......@@ -61,8 +60,6 @@ if(HAVE_SECCOMP)
target_link_libraries(kscreenlocker_greet Qt5::DBus Seccomp::Seccomp)
endif()
add_dependencies(kscreenlocker_greet KScreenLocker)
install(TARGETS kscreenlocker_greet DESTINATION ${KDE_INSTALL_LIBEXECDIR})
install(DIRECTORY themes/org.kde.passworddialog DESTINATION ${KDE_INSTALL_DATADIR}/ksmserver/screenlocker)
......
......@@ -3,21 +3,16 @@ add_definitions(-DTRANSLATION_DOMAIN=\"screenlocker_kcm\")
set(screenlocker_kcm_SRCS
kcm.cpp
../kscreensaversettings.cpp
../greeter/wallpaper_integration.cpp
../greeter/lnf_integration.cpp
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../)
kconfig_add_kcfg_files(screenlocker_kcm_SRCS ../kcfg/kscreensaversettingsbase.kcfgc)
qt5_add_dbus_interface(screenlocker_kcm_SRCS ../dbus/org.kde.screensaver.xml screenlocker_interface)
add_library(kcm_screenlocker MODULE ${screenlocker_kcm_SRCS})
add_dependencies(kcm_screenlocker KScreenLocker)
target_link_libraries(kcm_screenlocker
settings
Qt5::DBus
KF5::Declarative
KF5::I18n
......
......@@ -22,8 +22,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "kcm.h"
#include "kscreensaversettings.h"
#include "screenlocker_interface.h"
#include "../greeter/wallpaper_integration.h"
#include "../greeter/lnf_integration.h"
#include "wallpaper_integration.h"
#include "lnf_integration.h"
#include <KAboutData>
#include <KConfigLoader>
......
add_library(settings STATIC
kscreensaversettings.cpp
lnf_integration.cpp
wallpaper_integration.cpp
)
kconfig_add_kcfg_files(settings GENERATE_MOC kscreensaversettingsbase.kcfgc)
target_link_libraries(settings
KF5::ConfigWidgets
KF5::Declarative
KF5::GlobalAccel
KF5::I18n
KF5::Package
KF5::XmlGui
)
Markdown is supported
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