project(Dekko-AccountsPlugin)

set(PLUGIN_TARGET accounts-plugin)

list(APPEND PLUGIN_SRCS
    AccountsPlugin.cpp
    PresetProviderModel.cpp
)

add_library(${PLUGIN_TARGET} SHARED ${PLUGIN_SRCS})

message(AUTHOR_WARNING "Should the IMAP & POP3 options be checked before setting these defines here? qbs code didn't seem to do this.")
target_compile_definitions(${PLUGIN_TARGET}
    PRIVATE
    IMAP_ENABLED
    POP3_ENABLED
)

# QMF doesn't set these as target includes, so we must manually specify these
target_include_directories(${PLUGIN_TARGET}
    PRIVATE
    ${QmfMessageServer_INCLUDE_DIRS}
)

target_link_libraries(${PLUGIN_TARGET}
    PUBLIC
    accounts
    dekko-utils
    ${QmfMessageServer_LIBRARIES}
    Qt5::Quick
    Qt5::Qml
)

install(TARGETS
    ${PLUGIN_TARGET}
    DESTINATION ${QT_IMPORTS_DIR}/Dekko/Mail/Accounts
)

install(FILES
    qmldir
    DESTINATION ${QT_IMPORTS_DIR}/Dekko/Mail/Accounts
)
