CMakeLists.txt 13.3 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5PimCommon")
2

Laurent Montel's avatar
Laurent Montel committed
3 4 5 6 7 8 9 10 11 12
configure_package_config_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/KF5PimCommonConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5PimCommonConfig.cmake"
    INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
    )


ecm_setup_version(PROJECT VARIABLE_PREFIX PIMCOMMON
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/pimcommon_version.h"
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5PimCommonConfigVersion.cmake"
13
    SOVERSION 5
Laurent Montel's avatar
Laurent Montel committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
    )

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

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

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/pimcommon_version.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
    )
29 30 31 32 33 34 35 36 37 38 39 40 41 42

set(libpimcommon_autocorrection_SRCS
    autocorrection/autocorrection.cpp
    autocorrection/autocorrectionwidget.cpp
    autocorrection/autocorrectionlistwidget.cpp
    autocorrection/autocorrectiontreewidget.cpp
    autocorrection/autocorrectionlanguage.cpp
    autocorrection/import/importlibreofficeautocorrection.cpp
    autocorrection/import/importkmailautocorrection.cpp
    autocorrection/import/importabstractautocorrection.cpp
    autocorrection/widgets/lineeditwithautocorrection.cpp
    autocorrection/widgets/richtexteditwithautocorrection.cpp
    )

43 44
set(libpimcommon_generericplugin_SRCS
    genericplugins/pluginutil.cpp
Laurent Montel's avatar
Laurent Montel committed
45 46 47 48
    genericplugins/genericpluginmanager.cpp
    genericplugins/genericplugin.cpp
    genericplugins/abstractgenericplugin.cpp
    genericplugins/abstractgenericplugininterface.cpp
49 50
    )

Laurent Montel's avatar
Laurent Montel committed
51

52 53 54 55 56 57
set(libpimcommon_configure_plugins_SRCS
    configureplugins/configurepluginslistwidget.cpp
    configureplugins/configurepluginswidget.cpp
    configureplugins/configureplugindialog.cpp
    )

58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
set(libpimcommon_translator_SRCS
    translator/translatorutil.cpp
    translator/translatorwidget.cpp
    translator/translatordebugdialog.cpp
    translator/googletranslator.cpp
    )

set(libpimcommon_templatewidgets_SRCS
    templatewidgets/templatelistwidget.cpp
    templatewidgets/templateeditdialog.cpp
    templatewidgets/templatemanager.cpp
    )


set(libpimcommon_widgets_SRCS
    widgets/renamefiledialog.cpp
    widgets/simplestringlisteditor.cpp
    widgets/customtreeview.cpp
    widgets/configureimmutablewidgetutils.cpp
    widgets/kactionmenuchangecase.cpp
    widgets/spellchecklineedit.cpp
    widgets/kpimprintpreviewdialog.cpp
80
    widgets/lineeditwithcompleterng.cpp
Laurent Montel's avatar
Laurent Montel committed
81
    widgets/purposemenuwidget.cpp
82
    widgets/customlogwidget.cpp
83 84 85 86 87 88 89 90 91 92 93
    )

set(libpimcommon_customtools_SRCS
    customtools/customtoolsplugin.cpp
    customtools/customtoolspluginmanager.cpp
    customtools/customtoolswidgetng.cpp
    customtools/customtoolsviewinterface.cpp
    )

set(libpimcommon_util_SRCS
    util/pimutil.cpp
94
    util/broadcaststatus.cpp
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
    )

set(libpimcommon_migrate_SRCS
    migration/migrateapplicationfiles.cpp
    migration/migratefileinfo.cpp
    )

set(libpimcommon_shareserviceurl_SRCS
    shareserviceurl/shareserviceurlmanager.cpp
    )

set(libpimcommon_logactivities_SRCS
    logactivities/logactivitiesmanager.cpp
    logactivities/logactivitiesdialog.cpp
    logactivities/logactivitieswidget.cpp
Laurent Montel's avatar
Laurent Montel committed
110
    logactivities/logactivitiespurposemenuwidget.cpp
111 112 113 114 115 116 117
    )


set(libpimcommon_networkmanager_SRCS
    network/networkmanager.cpp
    )

Laurent Montel's avatar
Laurent Montel committed
118 119 120 121 122
set(libpimcommon_misc_SRCS
    misc/emailvalidator.cpp
    )


123 124
set(libpimcommon_SRCS
    settings/pimcommonsettings.cpp
Laurent Montel's avatar
Laurent Montel committed
125
    ${libpimcommon_misc_SRCS}
126
    ${libpimcommon_configure_plugins_SRCS}
127 128 129 130 131 132 133 134 135 136 137 138 139
    ${libpimcommon_networkmanager_SRCS}
    ${libpimcommon_configure_plugins_SRCS}
    ${libpimcommon_shareserviceurl_SRCS}
    ${libpimcommon_migrate_SRCS}
    ${libpimcommon_util_SRCS}
    ${libpimcommon_texteditor_SRCS}
    ${libpimcommon_storageservice_SRCS}
    ${libpimcommon_autocorrection_SRCS}
    ${libpimcommon_translator_SRCS}
    ${libpimcommon_templatewidgets_SRCS}
    ${libpimcommon_widgets_SRCS}
    ${libpimcommon_customtools_SRCS}
    ${libpimcommon_logactivities_SRCS}
140
    ${libpimcommon_generericplugin_SRCS}
141
    )
Laurent Montel's avatar
Laurent Montel committed
142
qt5_add_resources(libpimcommon_SRCS widgets/icons.qrc)
143
ecm_qt_declare_logging_category(libpimcommon_SRCS HEADER pimcommon_debug.h IDENTIFIER PIMCOMMON_LOG CATEGORY_NAME org.kde.pim.pimcommon
Laurent Montel's avatar
Laurent Montel committed
144 145 146 147 148
        DESCRIPTION "kdepim (pimcommon)"
        OLD_CATEGORY_NAMES log_pimcommon
        EXPORT PIMCOMMON
    )

149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167

ki18n_wrap_ui(libpimcommon_SRCS
    autocorrection/ui/autocorrectionwidget.ui
    )

macro(add_resource_iface _kcfgFile _ifaceName _className _fileName)
    kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/${_kcfgFile} ${_ifaceName})
    qt5_add_dbus_interface(libpimcommon_SRCS
        ${CMAKE_CURRENT_BINARY_DIR}/${_ifaceName}.xml ${_fileName} ${_className}
        )
endmacro()

add_resource_iface(util/imapresource.kcfg org.kde.Akonadi.Imap.Settings ImapSettings imapresourcesettings)

kconfig_add_kcfg_files(libpimcommon_SRCS
    settings/pimcommonsetting_base.kcfgc
    )

add_library(KF5PimCommon ${libpimcommon_SRCS})
168 169 170
if (COMPILE_WITH_CMAKE_SUPPORT)
    set_target_properties(KF5PimCommon PROPERTIES UNITY_BUILD ON)
endif()
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
generate_export_header(KF5PimCommon BASE_NAME pimcommon)
add_library(KF5::PimCommon ALIAS KF5PimCommon)


target_link_libraries(KF5PimCommon
    PUBLIC
    Qt5::Network
    KF5::KIOCore
    KF5::ConfigWidgets
    PRIVATE
    KF5::I18n
    KF5::Libkdepim
    KF5::Archive
    KF5::NewStuff
    KF5::PimTextEdit
    KF5::XmlGui
    KF5::PimTextEdit
    KF5::KIOWidgets
    Qt5::PrintSupport
190 191
    KF5::Purpose
    KF5::PurposeWidgets
192 193
    )

Laurent Montel's avatar
Laurent Montel committed
194

195 196 197 198 199 200 201 202 203 204 205 206
target_include_directories(KF5PimCommon INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/PimCommon/;${KDE_INSTALL_INCLUDEDIR_KF5}/pimcommon>")

target_include_directories(KF5PimCommon PUBLIC "$<BUILD_INTERFACE:${pimcommon_SOURCE_DIR}/src;${pimcommon_BINARY_DIR}/src>")

set_target_properties(KF5PimCommon PROPERTIES
    VERSION ${PIMCOMMON_VERSION_STRING}
    SOVERSION ${PIMCOMMON_SOVERSION}
    EXPORT_NAME PimCommon
    )

install(TARGETS
    KF5PimCommon
207
    EXPORT KF5PimCommonTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} 
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
    )

if (BUILD_TESTING)
    add_subdirectory(translator/autotests)
    add_subdirectory(autocorrection/autotests)
    add_subdirectory(widgets/autotests)
    add_subdirectory(migration/autotests)
    add_subdirectory(shareserviceurl/autotests)
    add_subdirectory(translator/tests)
    add_subdirectory(widgets/tests)
    add_subdirectory(autocorrection/tests)
    add_subdirectory(customtools/autotests)
    add_subdirectory(autotests)
    add_subdirectory(logactivities/autotests)
    add_subdirectory(logactivities/tests)
223
    add_subdirectory(configureplugins/autotests)
Laurent Montel's avatar
Laurent Montel committed
224
    add_subdirectory(genericplugins/autotests)
Laurent Montel's avatar
Laurent Montel committed
225
    add_subdirectory(misc/autotests)
226 227
endif()

228 229 230
ecm_generate_headers(PimCommon_CamelCasegenericplugins_HEADERS
    HEADER_NAMES
    PluginUtil
Laurent Montel's avatar
Laurent Montel committed
231 232 233 234
    GenericPluginManager
    GenericPlugin
    AbstractGenericPlugin
    AbstractGenericPluginInterface
235 236 237 238 239
    REQUIRED_HEADERS PimCommon_genericplugins_HEADERS
    PREFIX PimCommon
    RELATIVE genericplugins
    )

240 241 242 243 244 245 246 247
ecm_generate_headers(PimCommon_CamelCasenetworkmanager_HEADERS
    HEADER_NAMES
    NetworkManager
    REQUIRED_HEADERS PimCommon_networkmanager_HEADERS
    PREFIX PimCommon
    RELATIVE network
    )

Laurent Montel's avatar
Laurent Montel committed
248 249 250 251 252 253 254 255
ecm_generate_headers(PimCommon_CamelCasemisc_HEADERS
    HEADER_NAMES
    EmailValidator
    REQUIRED_HEADERS PimCommon_misc_HEADERS
    PREFIX PimCommon
    RELATIVE misc
    )

256 257 258
ecm_generate_headers(PimCommon_CamelCase_HEADERS
    HEADER_NAMES
    PimUtil
259
    BroadcastStatus
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
    REQUIRED_HEADERS PimCommon_HEADERS
    PREFIX PimCommon
    RELATIVE util
    )

ecm_generate_headers(PimCommon_Camelcasesettings_HEADERS
    HEADER_NAMES
    PimCommonSettings
    REQUIRED_HEADERS PimCommon_settings_HEADERS
    PREFIX PimCommon
    RELATIVE settings
    )

ecm_generate_headers(PimCommon_Camelcaselogactivities_HEADERS
    HEADER_NAMES
    LogActivitiesManager
    REQUIRED_HEADERS PimCommon_logactivities_HEADERS
    PREFIX PimCommon
    RELATIVE logactivities
    )

ecm_generate_headers(PimCommon_Camelcaseshareserviceurl_HEADERS
    HEADER_NAMES
    ShareServiceUrlManager
    REQUIRED_HEADERS PimCommon_shareserviceurl_HEADERS
    PREFIX PimCommon
    RELATIVE shareserviceurl
    )

ecm_generate_headers(PimCommon_Camelcasetranslator_HEADERS
    HEADER_NAMES
    TranslatorWidget
    REQUIRED_HEADERS PimCommon_translator_HEADERS
    PREFIX PimCommon
    RELATIVE translator
    )

ecm_generate_headers(PimCommon_Camelcasecustomtools_HEADERS
    HEADER_NAMES
    CustomToolsWidgetng
    CustomToolsPlugin
    CustomToolsViewInterface
302
    CustomToolsPluginManager
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
    REQUIRED_HEADERS PimCommon_customtools_HEADERS
    PREFIX PimCommon
    RELATIVE customtools
    )

ecm_generate_headers(PimCommon_Camelcasemigrate_HEADERS
    HEADER_NAMES
    MigrateApplicationFiles
    MigrateFileInfo
    REQUIRED_HEADERS PimCommon_migrate_HEADERS
    PREFIX PimCommon
    RELATIVE migration
    )

ecm_generate_headers(PimCommon_Camelcaseautocorrectionwidgets_HEADERS
    HEADER_NAMES
    RichTexteditWithAutoCorrection
    LineEditWithAutoCorrection
    REQUIRED_HEADERS PimCommon_autocorrectionwidgets_HEADERS
    PREFIX PimCommon
    RELATIVE autocorrection/widgets/
    )

ecm_generate_headers(PimCommon_Camelcaseautocorrection_HEADERS
    HEADER_NAMES
    AutoCorrectionWidget
    AutoCorrectionLanguage
    AutoCorrection
    REQUIRED_HEADERS PimCommon_autocorrection_HEADERS
    PREFIX PimCommon
    RELATIVE autocorrection/
    )

ecm_generate_headers(PimCommon_Camelcasetemplatelist_HEADERS
    HEADER_NAMES
    TemplateListWidget
    TemplateManager
    REQUIRED_HEADERS PimCommon_templatelist_HEADERS
    PREFIX PimCommon
    RELATIVE templatewidgets
    )


ecm_generate_headers(PimCommon_Camelcasewidgets_HEADERS
    HEADER_NAMES
    CustomTreeView
    SpellCheckLineEdit
    ConfigureImmutableWidgetUtils
    RenameFileDialog
Laurent Montel's avatar
Laurent Montel committed
352
    SimpleStringListEditor
353 354
    KActionMenuChangeCase
    KPimPrintPreviewDialog
Laurent Montel's avatar
Laurent Montel committed
355
    LineEditWithCompleterNg
356
    CustomLogWidget
Laurent Montel's avatar
Laurent Montel committed
357
    PurposeMenuWidget
358 359 360 361 362
    REQUIRED_HEADERS PimCommon_widgets_HEADERS
    PREFIX PimCommon
    RELATIVE widgets
    )

363 364 365 366 367 368 369 370 371
ecm_generate_headers(PimCommon_Camelcaseconfigureplugins_HEADERS
    HEADER_NAMES
    ConfigurePluginsListWidget
    ConfigurePluginsWidget
    ConfigurePluginDialog
    REQUIRED_HEADERS PimCommon_configureplugins_HEADERS
    PREFIX PimCommon
    RELATIVE configureplugins
    )
372 373
ecm_generate_pri_file(BASE_NAME PimCommon
    LIB_NAME KF5PimCommon
Laurent Montel's avatar
Laurent Montel committed
374
    DEPS "network KIOCore KConfigWidgets" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/PimCommon
375 376 377 378
    )


install(FILES
379 380
    ${PimCommon_Camelcaseconfigureplugins_HEADERS}
    ${PimCommon_CamelCasegenericplugins_HEADERS}
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403
    ${PimCommon_Camelcaselogactivities_HEADERS}
    ${PimCommon_CamelCasenetworkmanager_HEADERS}
    ${PimCommon_CamelCase_HEADERS}
    ${PimCommon_CamelCasejob_HEADERS}
    ${PimCommon_Camelcaseautocorrection_HEADERS}
    ${PimCommon_Camelcaseautocorrectionwidgets_HEADERS}
    ${PimCommon_Camelcasecustomtools_HEADERS}
    ${PimCommon_Camelcasemanagerserversidesubscription_HEADERS}
    ${PimCommon_Camelcasemigrate_HEADERS}
    ${PimCommon_Camelcaseplaintexteditor_HEADERS}
    ${PimCommon_Camelcaserichtexteditor_HEADERS}
    ${PimCommon_Camelcasescript_HEADERS}
    ${PimCommon_Camelcasesettings_HEADERS}
    ${PimCommon_Camelcaseshareserviceurl_HEADERS}
    ${PimCommon_Camelcasestorageservice_HEADERS}
    ${PimCommon_Camelcasestorageservicedialog_HEADERS}
    ${PimCommon_Camelcasestorageserviceinterface_HEADERS}
    ${PimCommon_Camelcasestorageservicesettings_HEADERS}
    ${PimCommon_Camelcasestorageservicewidgets_HEADERS}
    ${PimCommon_Camelcasetemplatelist_HEADERS}
    ${PimCommon_Camelcasetexteditor_commonwidget_HEADERS}
    ${PimCommon_Camelcasetranslator_HEADERS}
    ${PimCommon_Camelcasewidgets_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
404
    ${PimCommon_CamelCasemisc_HEADERS}
405 406 407 408 409 410 411 412 413
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/PimCommon
    COMPONENT Devel
    )

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/imapresourcesettings.h
    ${CMAKE_CURRENT_BINARY_DIR}/pimcommon_export.h
    ${CMAKE_CURRENT_BINARY_DIR}/pimcommonsetting_base.h
    ${PimCommon_HEADERS}
414 415
    ${PimCommon_genericplugins_HEADERS}
    ${PimCommon_configureplugins_HEADERS}
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436
    ${PimCommon_networkmanager_HEADERS}
    ${PimCommon_autocorrection_HEADERS}
    ${PimCommon_autocorrectionwidgets_HEADERS}
    ${PimCommon_customtools_HEADERS}
    ${PimCommon_job_HEADERS}
    ${PimCommon_managerserversidesubscription_HEADERS}
    ${PimCommon_migrate_HEADERS}
    ${PimCommon_plaintexteditor_HEADERS}
    ${PimCommon_richtexteditor_HEADERS}
    ${PimCommon_settings_HEADERS}
    ${PimCommon_shareserviceurl_HEADERS}
    ${PimCommon_storageservice_HEADERS}
    ${PimCommon_storageservicedialog_HEADERS}
    ${PimCommon_storageserviceinterface_HEADERS}
    ${PimCommon_storageservicesettings_HEADERS}
    ${PimCommon_storageservicewidgets_HEADERS}
    ${PimCommon_templatelist_HEADERS}
    ${PimCommon_texteditor_commonwidget_HEADERS}
    ${PimCommon_translator_HEADERS}
    ${PimCommon_widgets_HEADERS}
    ${PimCommon_logactivities_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
437
    ${PimCommon_misc_HEADERS}
438 439 440 441 442 443 444 445 446

    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/pimcommon
    COMPONENT Devel
    )

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

447 448 449
if(BUILD_DESIGNERPLUGIN)
    add_subdirectory(designer)
endif()
450