kdeconnect-kde/daemon/CMakeLists.txt
Alexander Lohnau f740a8bda8 Use target-centric CMake approach for declaring debug category
This makes it easier to read, because we do not have to handle a list of
files that get added to the targets. In other KDE projects, we also
prefer the target centric approach.

In case one wants to reuse the same category in multiple places, it
would be best to create a small static lib. But for now, this is not
needed.
2023-07-22 20:51:19 +00:00

34 lines
1.5 KiB
CMake

add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kded")
add_executable(kdeconnectd kdeconnectd.cpp ${CMAKE_SOURCE_DIR}/icons/custom_icons.qrc)
ecm_qt_declare_logging_category(kdeconnectd
HEADER kdeconnectd_debug.h
IDENTIFIER KDECONNECT_DAEMON CATEGORY_NAME kdeconnect.daemon
DEFAULT_SEVERITY Warning
EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (daemon)")
target_link_libraries(kdeconnectd
kdeconnectcore kdeconnectversion
KF${QT_MAJOR_VERSION}::KIOWidgets
KF${QT_MAJOR_VERSION}::DBusAddons
KF${QT_MAJOR_VERSION}::Notifications
KF${QT_MAJOR_VERSION}::I18n
KF${QT_MAJOR_VERSION}::WindowSystem
Qt::Widgets)
ecm_mark_nongui_executable(kdeconnectd)
configure_file(org.kde.kdeconnect.daemon.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.daemon.desktop)
# Conditionally configure the daemon service according to the target OS
if(WIN32)
set(SERV_EXEC kdeconnectd)
else()
set(SERV_EXEC ${KDE_INSTALL_FULL_LIBEXECDIR}/kdeconnectd)
endif()
configure_file(org.kde.kdeconnect.service.in ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.daemon.desktop DESTINATION ${KDE_INSTALL_AUTOSTARTDIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.daemon.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.service DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR})
install(TARGETS kdeconnectd DESTINATION ${KDE_INSTALL_LIBEXECDIR})