CMakeLists.txt 8.27 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1 2 3
add_definitions(-DTRANSLATION_DOMAIN=\"akonadicontact5\")
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5ContactEditor")

Laurent Montel's avatar
Laurent Montel committed
4
ecm_setup_version(PROJECT VARIABLE_PREFIX AKONADICONTACT
Laurent Montel's avatar
Laurent Montel committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/contact-editor_version.h"
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfigVersion.cmake"
    SOVERSION 5
    )
configure_package_config_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/KF5ContactEditorConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfig.cmake"
    INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
    )
install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
    )

install(EXPORT KF5ContactEditorTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5ContactEditorTargets.cmake NAMESPACE KF5::)

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
    )

configure_file(config-contact-editor.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-contact-editor.h)

add_subdirectory(editor/im)

set(contacteditor_customfieldseditor_SRCS
    editor/customfieldeditor/customfieldswidget.cpp
    editor/customfieldeditor/customfieldeditorwidget.cpp
    editor/customfieldeditor/customfieldslistwidget.cpp
    editor/customfieldeditor/customfieldslistdelegate.cpp
    editor/customfieldeditor/customfieldsmodel.cpp
    )

set(contacteditor_editor_utils_SRCS
    editor/utils/utils.cpp
    )

set(contacteditor_editor_widgets_SRCS
    editor/widgets/kwidgetlister.cpp
Laurent Montel's avatar
Laurent Montel committed
48
    editor/widgets/contacteditorcombobox.cpp
Laurent Montel's avatar
Laurent Montel committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
    )

set(contacteditor_editor_generalinfo_phone_SRCS
    editor/generalinfoeditor/phone/phonewidgetlister.cpp
    editor/generalinfoeditor/phone/phonewidget.cpp
    editor/generalinfoeditor/phone/phonelistwidget.cpp
    editor/generalinfoeditor/phone/phonecomboboxtype.cpp
    editor/generalinfoeditor/phone/phonetypedialog.cpp
    )

set(contacteditor_editor_generalinfo_web_SRCS
    editor/generalinfoeditor/web/webwidgetlister.cpp
    editor/generalinfoeditor/web/weblistwidget.cpp
    editor/generalinfoeditor/web/webwidget.cpp
    )
set(contacteditor_editor_generalinfo_mail_SRCS
    editor/generalinfoeditor/mail/maillistwidget.cpp
    editor/generalinfoeditor/mail/mailwidget.cpp
    editor/generalinfoeditor/mail/mailwidgetlister.cpp
    )

set(contacteditor_editor_generalinfo_messaging_SRCS
    editor/generalinfoeditor/messaging/messaginglistwidget.cpp
    editor/generalinfoeditor/messaging/messagingwidget.cpp
    editor/generalinfoeditor/messaging/messagingwidgetlister.cpp
    )


set(contacteditor_editor_generalinfo_SRCS
    editor/generalinfoeditor/generalinfowidget.cpp
    editor/generalinfoeditor/namewidget.cpp
    editor/generalinfoeditor/nicknamewidget.cpp
    editor/generalinfoeditor/categorieseditwidget.cpp
    editor/generalinfoeditor/nameeditdialog.cpp
    editor/generalinfoeditor/displaynameeditwidget.cpp
Laurent Montel's avatar
Laurent Montel committed
84
    editor/generalinfoeditor/contactselecttypecombobox.cpp
Laurent Montel's avatar
Laurent Montel committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
    editor/generalinfoeditor/messageformattingwidget.cpp
    ${contacteditor_editor_generalinfo_messaging_SRCS}
    ${contacteditor_editor_generalinfo_phone_SRCS}
    ${contacteditor_editor_generalinfo_web_SRCS}
    ${contacteditor_editor_generalinfo_mail_SRCS}
    )

set(contacteditor_addresslocation_web_editor_SRCS
    editor/addresseditor/webengine/addresseslocationengineviewer.cpp
    editor/addresseditor/webengine/addresseslocationenginepage.cpp
    )

set(contacteditor_addresslocation_editor_SRCS
    ${contacteditor_addresslocation_web_editor_SRCS}
    editor/addresseditor/addresslocationwidget.cpp
    editor/addresseditor/addresseslocationgrantleeformater.cpp
    editor/addresseditor/addressgrantleeobject.cpp
    editor/addresseditor/iconnamecache.cpp
    editor/addresseditor/addresseslocationwidget.cpp
    editor/addresseditor/selectaddresstypecombobox.cpp
    editor/addresseditor/addresstypedialog.cpp
    )

set(contacteditor_personal_editor_SRCS
    editor/personaleditor/personaleditorwidget.cpp
    editor/personaleditor/dateeditwidget.cpp
    editor/personaleditor/kdatepickerpopup.cpp
    )

set(contacteditor_business_editor_SRCS
    editor/businesseditor/businesseditorwidget.cpp
    editor/businesseditor/freebusyeditwidget.cpp
    )

set(contacteditor_editor_SRCS
    ${contacteditor_personal_editor_SRCS}
    ${contacteditor_editor_utils_SRCS}
    ${contacteditor_business_editor_SRCS}
    editor/contacteditorwidget.cpp
    editor/im/imaddress.cpp
    editor/im/improtocols.cpp
    editor/widgets/imagewidget.cpp
    editor/widgets/preferredlineeditwidget.cpp
    customfields.cpp
    customfieldmanager.cpp
    contactmetadatabase.cpp
)

set(contacteditor_LIB_SRC
    ${contacteditor_addresslocation_editor_SRCS}
    ${contacteditor_editor_widgets_SRCS}
    ${contacteditor_editor_generalinfo_SRCS}
    ${contacteditor_customfieldseditor_SRCS}
    ${contacteditor_attributes_SRCS}
    ${contacteditor_job_SRCS}
    )

Laurent Montel's avatar
Laurent Montel committed
142
ecm_qt_declare_logging_category(contacteditor_LIB_SRC HEADER contacteditor_debug.h IDENTIFIER CONTACTEDITOR_LOG CATEGORY_NAME org.kde.pim.contacteditor)
Laurent Montel's avatar
Laurent Montel committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164

set(contacteditor_LIB_SRC
    ${contacteditor_LIB_SRC}
    ${contacteditor_editor_SRCS}
    )



add_library(KF5ContactEditor ${contacteditor_LIB_SRC})

generate_export_header(KF5ContactEditor BASE_NAME contacteditor)

add_library(KF5::ContactEditor ALIAS KF5ContactEditor)

target_include_directories(KF5ContactEditor INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor;${KDE_INSTALL_INCLUDEDIR_KF5}>")
target_include_directories(KF5ContactEditor INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/contacteditor>")
target_include_directories(KF5ContactEditor PUBLIC "$<BUILD_INTERFACE:${Akonadi-Contact_SOURCE_DIR}/src/contact-editor;${Akonadi-Contact_BINARY_DIR}/src/contact-editor>")

target_link_libraries(KF5ContactEditor
    PUBLIC
    KF5::Contacts
    Qt5::Widgets
Laurent Montel's avatar
Laurent Montel committed
165 166
    KF5::AkonadiCore
    KF5::AkonadiWidgets
Laurent Montel's avatar
Laurent Montel committed
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
    PRIVATE
    KF5::Completion
    KF5::ConfigCore
    KF5::ConfigWidgets
    KF5::IconThemes
    KF5::KIOWidgets
    KF5::Mime
    KF5::Codecs
    KF5::DBusAddons
    KF5::I18n
    KF5::Service
    KF5::TextWidgets
    KF5::WidgetsAddons
    KF5::XmlGui
    Grantlee5::Templates
    Qt5::WebEngine
    Qt5::WebEngineWidgets
    )

if(KF5Prison_FOUND)
    target_link_libraries(KF5ContactEditor PRIVATE KF5::Prison)
endif()


set_target_properties(KF5ContactEditor PROPERTIES
    VERSION ${AKONADICONTACT_VERSION_STRING}
    SOVERSION ${AKONADICONTACT_SOVERSION}
    EXPORT_NAME ContactEditor
    )

install(TARGETS
    KF5ContactEditor
    EXPORT KF5ContactEditorTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
    )

ecm_generate_pri_file(BASE_NAME ContactEditor
    LIB_NAME KF5ContactEditor
Laurent Montel's avatar
Laurent Montel committed
204
    DEPS "Contacts" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor
Laurent Montel's avatar
Laurent Montel committed
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
    )

install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})

ecm_generate_headers(ContactEditor_CamelCase_HEADERS
    HEADER_NAMES
    ContactEditorPagePlugin
    REQUIRED_HEADERS ContactEditor_HEADERS
    PREFIX ContactEditor
    )

install( FILES
    ${ContactEditor_CamelCase_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor COMPONENT Devel
    )

install( FILES
    ${ContactEditor_HEADERS}
    ${CMAKE_CURRENT_BINARY_DIR}/contacteditor_export.h
    editor/im/improtocols.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/contacteditor COMPONENT Devel
    )



install( FILES
    ${CMAKE_CURRENT_BINARY_DIR}/akonadi-contact_export.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/akonadi/contact COMPONENT Devel
    )

if (BUILD_TESTING)
    add_subdirectory(editor/addresseditor/autotests/)
    add_subdirectory(editor/addresseditor/tests)
    add_subdirectory(editor/generalinfoeditor/autotests/)
    add_subdirectory(editor/generalinfoeditor/tests)
Laurent Montel's avatar
Laurent Montel committed
240 241
    add_subdirectory(editor/customfieldeditor/autotests/)
    add_subdirectory(editor/customfieldeditor/tests)
Laurent Montel's avatar
Laurent Montel committed
242 243 244
    add_subdirectory(editor/widgets/autotests/)
endif()

Laurent Montel's avatar
Laurent Montel committed
245 246 247
install(FILES editor/pics/world.jpg DESTINATION ${KDE_INSTALL_DATADIR_KF5}/akonadi/contact/pics)
install(FILES editor/data/zone.tab DESTINATION ${KDE_INSTALL_DATADIR_KF5}/akonadi/contact/data)

Laurent Montel's avatar
Laurent Montel committed
248 249
add_subdirectory(editor/addresseditor/html)