# SPDX-FileCopyrightText: 2026 Laurent Montel <montel@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
add_definitions(-DTRANSLATION_DOMAIN=\"akonadimcpprotocol\")

add_executable(akonadimcpprotocol)
ecm_qt_declare_logging_category(akonadimcpprotocol HEADER akonadimcpprotocol_debug.h IDENTIFIER AKONADI_MCP_PROTOCOL_LOG
    CATEGORY_NAME org.kde.akonadimcpprotocol DESCRIPTION "akonadi mcp protocol" EXPORT KDEPIMADDONS
)

target_sources(
    akonadimcpprotocol
    PRIVATE
        main.cpp
        akonadimcpprotocolmanager.h
        akonadimcpprotocolmanager.cpp
        common/tooljobbase.h
        common/tooljobbase.cpp
        common/toolutils.h
        common/toolutils.cpp
        common/toolbase.cpp
        common/toolbase.h
        common/kmaildbustooljobbase.h
        common/kmaildbustooljobbase.cpp
        contactsearchtool/contactsearchtool.h
        contactsearchtool/contactsearchtool.cpp
        contactsearchtool/contactsearchtooljob.h
        contactsearchtool/contactsearchtooljob.cpp
        contactgroupexpandtool/contactgroupexpandtool.cpp
        contactgroupexpandtool/contactgroupexpandtool.h
        contactgroupexpandtool/contactgroupexpandtooljob.cpp
        contactgroupexpandtool/contactgroupexpandtooljob.h
        listaddressbooks/listaddressbookstool.h
        listaddressbooks/listaddressbookstool.cpp
        listaddressbooks/listaddressbookstooljob.h
        listaddressbooks/listaddressbookstooljob.cpp
        upcomingbirthdaystool/upcomingbirthdaystool.h
        upcomingbirthdaystool/upcomingbirthdaystool.cpp
        upcomingbirthdaystool/upcomingbirthdaystooljob.h
        upcomingbirthdaystool/upcomingbirthdaystooljob.cpp
        calendarcommon/calendartoolutils.h
        calendarcommon/calendartoolutils.cpp
        calendarcommon/calendartooljobbase.h
        calendarcommon/calendartooljobbase.cpp
        calendarcommon/createincidencetooljob.h
        calendarcommon/createincidencetooljob.cpp
        calendareventstool/calendareventstool.h
        calendareventstool/calendareventstool.cpp
        calendareventstool/calendareventstooljob.h
        calendareventstool/calendareventstooljob.cpp
        freebusytool/freebusytool.h
        freebusytool/freebusytool.cpp
        freebusytool/freebusytooljob.h
        freebusytool/freebusytooljob.cpp
        todolisttool/todolisttool.h
        todolisttool/todolisttool.cpp
        todolisttool/todolisttooljob.h
        todolisttool/todolisttooljob.cpp
        akonadiresourcesstatus/akonadiresourcesstatustool.h
        akonadiresourcesstatus/akonadiresourcesstatustool.cpp
        createcontacttool/createcontacttool.h
        createcontacttool/createcontacttool.cpp
        createcontacttool/createcontacttooljob.h
        createcontacttool/createcontacttooljob.cpp
        createcontactgrouptool/createcontactgrouptool.h
        createcontactgrouptool/createcontactgrouptool.cpp
        createcontactgrouptool/createcontactgrouptooljob.h
        createcontactgrouptool/createcontactgrouptooljob.cpp
        mailsearch/searchmailtool.h
        mailsearch/searchmailtool.cpp
        mailsearch/searchmailtooljob.h
        mailsearch/searchmailtooljob.cpp
        createmailtool/createmailtool.h
        createmailtool/createmailtool.cpp
        createmailtool/createmailtooljob.h
        createmailtool/createmailtooljob.cpp
        openmailtool/openmailtool.h
        openmailtool/openmailtool.cpp
        openmailtool/openmailtooljob.h
        openmailtool/openmailtooljob.cpp
        replymailtool/replymailtool.h
        replymailtool/replymailtool.cpp
        replymailtool/replymailtooljob.h
        replymailtool/replymailtooljob.cpp
        forwardmailtool/forwardmailtool.h
        forwardmailtool/forwardmailtool.cpp
        forwardmailtool/forwardmailtooljob.h
        forwardmailtool/forwardmailtooljob.cpp
        editmailtool/editmailtool.h
        editmailtool/editmailtool.cpp
        editmailtool/editmailtooljob.h
        editmailtool/editmailtooljob.cpp
        createeventtool/createeventtool.h
        createeventtool/createeventtool.cpp
        createtodotool/createtodotool.h
        createtodotool/createtodotool.cpp
        createjournaltool/createjournaltool.h
        createjournaltool/createjournaltool.cpp
        listcalendars/listcalendarstool.cpp
        listcalendars/listcalendarstool.h
        listcalendars/listcalendarstooljob.cpp
        listcalendars/listcalendarstooljob.h
        listidentities/listidentitiestool.h
        listidentities/listidentitiestool.cpp
        createtransporttool/createtransporttool.h
        createtransporttool/createtransporttool.cpp
        createidentitytool/createidentitytool.h
        createidentitytool/createidentitytool.cpp
        markmailtool/markmailtool.h
        markmailtool/markmailtool.cpp
        markmailtool/markmailtooljob.h
        markmailtool/markmailtooljob.cpp
        movemailtool/movemailtool.h
        movemailtool/movemailtool.cpp
        movemailtool/movemailtooljob.h
        movemailtool/movemailtooljob.cpp
        updatecontacttool/updatecontacttool.h
        updatecontacttool/updatecontacttool.cpp
        updatecontacttool/updatecontacttooljob.h
        updatecontacttool/updatecontacttooljob.cpp
        updateincidencetool/updateincidencetool.h
        updateincidencetool/updateincidencetool.cpp
        updateincidencetool/updateincidencetooljob.h
        updateincidencetool/updateincidencetooljob.cpp
        deletecontacttool/deletecontacttool.h
        deletecontacttool/deletecontacttool.cpp
        deletecontacttool/deletecontacttooljob.h
        deletecontacttool/deletecontacttooljob.cpp
        deleteincidencetool/deleteincidencetool.h
        deleteincidencetool/deleteincidencetool.cpp
        deleteincidencetool/deleteincidencetooljob.h
        deleteincidencetool/deleteincidencetooljob.cpp
)
target_link_libraries(
    akonadimcpprotocol
    KF6::TextAutoGenerateTextMcpProtocolCore
    KF6::I18n
    KPim6::AkonadiContactCore
    KPim6::AkonadiCalendar
    KF6::CalendarCore
    KPim6::AkonadiMime
    KF6::Mime
    KF6::Codecs
    KPim6::IdentityManagementCore
    KPim6::MailTransport
    Qt::DBus
    KF6::DBusAddons
    KF6::Crash
    KF6::Notifications
)

install(
    TARGETS
        akonadimcpprotocol
        ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
)

add_subdirectory(kcm)
add_subdirectory(data)
