CMakeLists.txt 4.9 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1 2
configure_file(kaddressbook-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kaddressbook-version.h @ONLY)

3 4 5 6 7
set(kaddressbook_userfeedback_LIB)
if (TARGET KUserFeedbackWidgets)
    set(kaddressbook_userfeedback_LIB KUserFeedbackWidgets)
endif()

Laurent Montel's avatar
Laurent Montel committed
8

Laurent Montel's avatar
Laurent Montel committed
9 10 11 12 13 14 15 16
include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/printing/
    )


add_subdirectory(icons)
add_subdirectory(printing)
add_subdirectory(kconf_update)
17 18
add_subdirectory(configuration)

Laurent Montel's avatar
Laurent Montel committed
19

Daniel Vrátil's avatar
Daniel Vrátil committed
20 21
if(QGpgme_FOUND)
    add_definitions(-DHAVE_QGPGME)
Laurent Montel's avatar
Laurent Montel committed
22 23
endif()

Laurent Montel's avatar
Laurent Montel committed
24 25
set(kaddressbook_qrc_SRCS)
qt5_add_resources(kaddressbook_qrc_SRCS kaddressbook.qrc)
Laurent Montel's avatar
Laurent Montel committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

set(kaddressbook_printing_SRCS
    printing/detailled/detailledstyle.cpp
    printing/mike/mikesstyle.cpp
    printing/printingwizard.cpp
    printing/printprogress.cpp
    printing/printstyle.cpp
    printing/ringbinder/ringbinderstyle.cpp
    printing/compact/compactstyle.cpp
    printing/grantlee/grantleeprintstyle.cpp
    printing/stylepage.cpp
    )

ki18n_wrap_ui(kaddressbook_printing_SRCS
    printing/ringbinder/rbs_appearance.ui
    printing/detailled/ds_appearance.ui
    printing/compact/compactstyle.ui
    )

set(kaddressbook_plugin_SRCS
    plugininterface/kaddressbookplugininterface.cpp
    )

49 50 51 52
set(kaddressbook_userfeedback_SRCS)
if (TARGET KUserFeedbackWidgets)
    set(kaddressbook_userfeedback_SRCS ${kaddressbook_userfeedback_SRCS}
        userfeedback/userfeedbackmanager.cpp
53
        userfeedback/kaddressbookuserfeedbackprovider.cpp
54 55 56 57
        )
endif()


Laurent Montel's avatar
Laurent Montel committed
58 59 60 61 62 63 64 65
set(kaddressbook_LIB_SRCS
    aboutdata.cpp
    categoryfilterproxymodel.cpp
    categoryselectwidget.cpp
    contactsorter.cpp
    contactswitcher.cpp
    globalcontactmodel.cpp
    mainwidget.cpp
Laurent Montel's avatar
Laurent Montel committed
66
    manageshowcollectionproperties.cpp
Laurent Montel's avatar
Laurent Montel committed
67 68 69 70 71
    modelcolumnmanager.cpp
    widgets/quicksearchwidget.cpp
    kaddressbookmigrateapplication.cpp
    ${kaddressbook_printing_SRCS}
    ${kaddressbook_plugin_SRCS}
72
    ${kaddressbook_userfeedback_SRCS}
Laurent Montel's avatar
Laurent Montel committed
73 74
    )

75
ecm_qt_declare_logging_category(kaddressbook_LIB_SRCS HEADER kaddressbook_debug.h IDENTIFIER KADDRESSBOOK_LOG CATEGORY_NAME org.kde.pim.kaddressbook
Laurent Montel's avatar
Laurent Montel committed
76 77 78 79 80
        DESCRIPTION "kaddressbook (kaddressbook)"
        OLD_CATEGORY_NAMES log_kaddressbook
        EXPORT KADDRESSBOOK
    )

Laurent Montel's avatar
Laurent Montel committed
81 82 83 84 85 86 87 88

qt5_add_dbus_adaptor( kaddressbook_LIB_SRCS org.kde.kaddressbook.xml mainwidget.h MainWidget)

kconfig_add_kcfg_files(kaddressbook_LIB_SRCS settings/settings.kcfgc)
add_library(kaddressbookprivate ${kaddressbook_LIB_SRCS})
generate_export_header(kaddressbookprivate BASE_NAME kaddressbook)
target_link_libraries(kaddressbookprivate
    PUBLIC
89
    KF5::PimCommonAkonadi
Laurent Montel's avatar
Laurent Montel committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
    PRIVATE
    KF5::Libkdepim
    KF5::KaddressbookGrantlee
    KF5::AkonadiCore
    KF5::Contacts
    KF5::AkonadiContact
    KF5::KCMUtils
    KF5::Codecs
    KF5::GrantleeTheme
    KF5::Completion
    KF5::XmlGui
    KF5::JobWidgets
    KF5::KIOWidgets
    Qt5::PrintSupport
    KF5::AkonadiSearchDebug
    KF5::I18n
Laurent Montel's avatar
Laurent Montel committed
106
    KF5::KaddressbookImportExport
107
    KF5::Prison
108
    ${kaddressbook_userfeedback_LIB}
Laurent Montel's avatar
Laurent Montel committed
109 110
    )

Daniel Vrátil's avatar
Daniel Vrátil committed
111 112
if(QGpgme_FOUND)
    target_link_libraries(kaddressbookprivate PRIVATE QGpgme)
Laurent Montel's avatar
Laurent Montel committed
113 114 115 116 117 118 119 120 121 122 123 124 125
endif()

target_include_directories(kaddressbookprivate PUBLIC "$<BUILD_INTERFACE:${kaddressbook_SOURCE_DIR};${kaddressbook_BINARY_DIR}>")

set_target_properties(kaddressbookprivate PROPERTIES VERSION ${KDEPIM_LIB_VERSION} SOVERSION ${KDEPIM_LIB_SOVERSION})
install(TARGETS kaddressbookprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)

########### next target ###############

set(kaddressbook_SRCS
    kaddressbook_debug.cpp
    main.cpp
    mainwindow.cpp
Laurent Montel's avatar
Laurent Montel committed
126
    ${kaddressbook_qrc_SRCS}
Laurent Montel's avatar
Laurent Montel committed
127 128
    )

Daniel Vrátil's avatar
Daniel Vrátil committed
129
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*-apps-kaddressbook.png")
Laurent Montel's avatar
Laurent Montel committed
130 131 132 133 134 135 136
ecm_add_app_icon(kaddressbook_SRCS ICONS ${ICONS_SRCS})

add_executable(kaddressbook ${kaddressbook_SRCS})

target_link_libraries(kaddressbook
    KF5::KontactInterface
    kaddressbookprivate
Laurent Montel's avatar
Laurent Montel committed
137
    KF5::Crash
Laurent Montel's avatar
Laurent Montel committed
138
    ${kaddressbook_userfeedback_LIB}
Laurent Montel's avatar
Laurent Montel committed
139 140 141 142 143 144
    )

install(TARGETS kaddressbook ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS data/org.kde.kaddressbook.desktop data/kaddressbook-importer.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES data/org.kde.kaddressbook.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})

Laurent Montel's avatar
Laurent Montel committed
145
set(kaddressbook_PART_SRCS kaddressbookpart.cpp kaddressbook_debug.cpp ${kaddressbook_qrc_SRCS})
Laurent Montel's avatar
Laurent Montel committed
146
add_library(kaddressbookpart MODULE ${kaddressbook_PART_SRCS})
147
target_link_libraries(kaddressbookpart  kaddressbookprivate KF5::Parts)
Laurent Montel's avatar
Laurent Montel committed
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
install(TARGETS kaddressbookpart DESTINATION ${KDE_INSTALL_PLUGINDIR})

install(FILES
    viewertemplates/contact.html
    viewertemplates/contact_embedded.html
    viewertemplates/contact_row.html
    viewertemplates/contactgroup.html
    viewertemplates/contactgroup_embedded.html
    viewertemplates/contactgroup_additionalfieldrow.html
    viewertemplates/contactgroup_memberrow.html
    viewertemplates/theme.desktop
    DESTINATION ${KDE_INSTALL_DATADIR}/kaddressbook/viewertemplates/default/
    )

install(DIRECTORY printing/grantlee/themes/ DESTINATION ${KDE_INSTALL_DATADIR}/kaddressbook/printing/themes/ )
163