diff --git a/CMakeLists.txt b/CMakeLists.txt index c5d069ec..ab829fc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,69 +1,65 @@ cmake_minimum_required(VERSION 3.5) set(PIM_VERSION "5.10.90") project(Akonadi-Contact VERSION ${PIM_VERSION}) # ECM setup set(KF5_MIN_VERSION "5.56.0") find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) include(GenerateExportHeader) include(ECMGenerateHeaders) include(ECMGeneratePriFile) include(ECMSetupVersion) include(FeatureSummary) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMInstallIcons) include(ECMQtDeclareLoggingCategory) set(AKONADI_CONTACTS_VERSION ${PIM_VERSION}) set(KCONTACTS_VERSION "5.10.90") set(KMIMELIB_VERSION "5.10.90") set(AKONADI_VERSION "5.10.90") set(QT_REQUIRED_VERSION "5.10.0") find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test) ########### Find packages ########### find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Completion ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5IconThemes ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5TextWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Prison ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Contacts ${KCONTACTS_VERSION} CONFIG REQUIRED) find_package(KF5Mime ${KMIMELIB_VERSION} CONFIG REQUIRED) find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED) ########### Targets ########### # workaround for https://bugreports.qt.io/browse/QTBUG-74665 (bug in qt5.13 reevaluate it) if (${Qt5Widgets_VERSION} STRGREATER "5.13") MESSAGE(STATUS "Qt version: ${Qt5Widgets_VERSION} DISABLE compile without deprecated methods. bug QTBUG-74665") else() add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000) endif() add_definitions(-DQT_NO_URL_CAST_FROM_STRING) -if(BUILD_TESTING) - add_definitions(-DBUILD_TESTING) -endif() - add_subdirectory(src) add_subdirectory(kcm) add_subdirectory(serializers) install( FILES akonadi-contacts.renamecategories akonadi-contacts.categories DESTINATION ${KDE_INSTALL_CONFDIR} ) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/akonadi-contacts/CMakeLists.txt b/src/akonadi-contacts/CMakeLists.txt index cd81d6aa..8c28f244 100644 --- a/src/akonadi-contacts/CMakeLists.txt +++ b/src/akonadi-contacts/CMakeLists.txt @@ -1,222 +1,224 @@ set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5AkonadiContact") ecm_setup_version(PROJECT VARIABLE_PREFIX AKONADICONTACT VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/akonadi-contact_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfigVersion.cmake" SOVERSION 5 ) configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/KF5AkonadiContactConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfig.cmake" INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfigVersion.cmake" DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel ) install(EXPORT KF5AkonadiContactTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5AkonadiContactTargets.cmake NAMESPACE KF5::) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfigVersion.cmake" DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel ) set( AKONADI_PHONE_DIAL_DEFAULT "UseSkype" ) set( AKONADI_SEND_SMS_DEFAULT "UseSkypeSms" ) ########### next target ############### set(akonadicontact_actions_SRCS actions/dialphonenumberaction.cpp actions/showaddressaction.cpp actions/qdialer.cpp actions/qskypedialer.cpp actions/sendsmsaction.cpp actions/smsdialog.cpp actions/qsflphonedialer.cpp actions/qekigadialer.cpp ) configure_file(config-akonadi-contact.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-akonadi-contact.h) configure_file( actions/contactactionssettings.kcfg.cmake ${CMAKE_CURRENT_BINARY_DIR}/contactactionssettings.kcfg @ONLY) kconfig_add_kcfg_files(akonadicontact_actions_SRCS actions/contactactionssettings.kcfgc) set(akonadicontact_attributes_SRCS attributes/contactmetadataattribute.cpp attributes/attributeregistrar.cpp ) set(akonadicontact_job_SRCS job/contactgroupexpandjob.cpp job/contactgroupsearchjob.cpp job/contactsearchjob.cpp ) set(akonadicontact_LIB_SRC ${akonadicontact_customfieldseditor_SRCS} ${akonadicontact_attributes_SRCS} ${akonadicontact_job_SRCS} abstractcontactformatter.cpp abstractcontactgroupformatter.cpp collectionfiltermodel.cpp contactcompletionmodel.cpp contactdefaultactions.cpp contacteditor.cpp contacteditordialog.cpp contactgroupeditor.cpp contactgroupeditordelegate.cpp contactgroupeditordialog.cpp contactgroupmodel.cpp contactgroupviewer.cpp contactgroupviewerdialog.cpp contactmetadataakonadi.cpp contactparts.cpp contactsfilterproxymodel.cpp contactstreemodel.cpp contactviewer.cpp contactviewerdialog.cpp emailaddressselection.cpp emailaddressselectiondialog.cpp emailaddressselectionproxymodel.cpp emailaddressselectionwidget.cpp emailaddressrequester.cpp emailaddressselectionmodel.cpp textbrowser.cpp leafextensionproxymodel.cpp standardcontactactionmanager.cpp standardcontactformatter.cpp standardcontactgroupformatter.cpp waitingoverlay.cpp selectaddressbookdialog.cpp ${akonadicontact_actions_SRCS} ) ecm_qt_declare_logging_category(akonadicontact_LIB_SRC HEADER akonadi_contact_debug.h IDENTIFIER AKONADICONTACT_LOG CATEGORY_NAME org.kde.pim.akonadicontact) set(akonadicontact_LIB_SRC ${akonadicontact_LIB_SRC} ) ki18n_wrap_ui(akonadicontact_LIB_SRC contactgroupeditor.ui) add_library(KF5AkonadiContact ${akonadicontact_LIB_SRC}) - +if (BUILD_TESTING) + target_compile_definitions(KF5AkonadiContact PRIVATE BUILD_TESTING) +endif() generate_export_header(KF5AkonadiContact BASE_NAME akonadi-contact) add_library(KF5::AkonadiContact ALIAS KF5AkonadiContact) target_include_directories(KF5AkonadiContact INTERFACE "$") target_include_directories(KF5AkonadiContact INTERFACE "$") target_include_directories(KF5AkonadiContact PUBLIC "$") target_link_libraries(KF5AkonadiContact PUBLIC KF5::AkonadiCore KF5::Contacts KF5::AkonadiWidgets Qt5::Widgets PRIVATE KF5::ConfigCore KF5::ConfigWidgets KF5::IconThemes KF5::KIOWidgets KF5::Mime KF5::DBusAddons KF5::I18n KF5::TextWidgets KF5::XmlGui KF5::ContactEditor KF5::Prison ) set_target_properties(KF5AkonadiContact PROPERTIES VERSION ${AKONADICONTACT_VERSION_STRING} SOVERSION ${AKONADICONTACT_SOVERSION} EXPORT_NAME AkonadiContact ) install(TARGETS KF5AkonadiContact EXPORT KF5AkonadiContactTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} ) ecm_generate_pri_file(BASE_NAME AkonadiContact LIB_NAME KF5AkonadiContact DEPS "AkonadiCore Contacts" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/Akonadi/Contact ) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) ecm_generate_headers(AkonadiContactJob_CamelCase_HEADERS HEADER_NAMES ContactGroupExpandJob ContactGroupSearchJob ContactSearchJob REQUIRED_HEADERS AkonadiContactJob_HEADERS PREFIX Akonadi/Contact RELATIVE job ) ecm_generate_headers(AkonadiContact_CamelCase_HEADERS HEADER_NAMES AbstractContactFormatter AbstractContactGroupFormatter ContactDefaultActions ContactEditor ContactEditorDialog ContactGroupEditor ContactGroupEditorDialog ContactGroupViewer ContactGroupViewerDialog ContactsFilterProxyModel ContactsTreeModel ContactParts ContactViewer ContactViewerDialog EmailAddressSelection EmailAddressSelectionDialog EmailAddressSelectionWidget EmailAddressSelectionModel EmailAddressRequester StandardContactActionManager StandardContactFormatter StandardContactGroupFormatter SelectAddressBookDialog REQUIRED_HEADERS AkonadiContact_HEADERS PREFIX Akonadi/Contact ) install( FILES ${AkonadiContact_CamelCase_HEADERS} ${AkonadiContactJob_CamelCase_HEADERS} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/Akonadi/Contact COMPONENT Devel ) install( FILES ${AkonadiContact_HEADERS} ${AkonadiContactJob_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/akonadi-contact_export.h DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/akonadi/contact COMPONENT Devel ) if (BUILD_TESTING) add_subdirectory(autotests) add_subdirectory(tests) endif() add_subdirectory(plugins) diff --git a/src/contact-editor/CMakeLists.txt b/src/contact-editor/CMakeLists.txt index d4ac6153..3e75089d 100644 --- a/src/contact-editor/CMakeLists.txt +++ b/src/contact-editor/CMakeLists.txt @@ -1,243 +1,245 @@ set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5ContactEditor") ecm_setup_version(PROJECT VARIABLE_PREFIX AKONADICONTACT 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_abstractaddresslocation_SRCS editor/addresseditor/abstractaddresslocationwidget.cpp) 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 editor/widgets/contacteditorcombobox.cpp ) 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 editor/generalinfoeditor/web/webselecttypecombobox.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 editor/generalinfoeditor/contactselecttypecombobox.cpp editor/generalinfoeditor/messageformattingwidget.cpp editor/generalinfoeditor/blogfeedwidget.cpp ${contacteditor_editor_generalinfo_messaging_SRCS} ${contacteditor_editor_generalinfo_phone_SRCS} ${contacteditor_editor_generalinfo_web_SRCS} ${contacteditor_editor_generalinfo_mail_SRCS} ${contacteditor_abstractaddresslocation_SRCS} ) set(contacteditor_addresslocation_editor_SRCS editor/addresseditor/addresseslocationwidget.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 editor/widgets/categorieseditabstractwidget.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} ) ecm_qt_declare_logging_category(contacteditor_LIB_SRC HEADER contacteditor_debug.h IDENTIFIER CONTACTEDITOR_LOG CATEGORY_NAME org.kde.pim.contacteditor) set(contacteditor_LIB_SRC ${contacteditor_LIB_SRC} ${contacteditor_editor_SRCS} ) add_library(KF5ContactEditor ${contacteditor_LIB_SRC}) - +if (BUILD_TESTING) + target_compile_definitions(KF5ContactEditor PRIVATE BUILD_TESTING) +endif() generate_export_header(KF5ContactEditor BASE_NAME contacteditor) add_library(KF5::ContactEditor ALIAS KF5ContactEditor) target_include_directories(KF5ContactEditor INTERFACE "$") target_include_directories(KF5ContactEditor INTERFACE "$") target_include_directories(KF5ContactEditor PUBLIC "$") target_link_libraries(KF5ContactEditor PUBLIC KF5::Contacts Qt5::Widgets PRIVATE KF5::Completion KF5::ConfigCore KF5::ConfigWidgets KF5::IconThemes KF5::KIOWidgets KF5::Mime KF5::Codecs KF5::I18n KF5::Service KF5::TextWidgets KF5::WidgetsAddons ) 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 DEPS "Contacts" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor ) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) ecm_generate_headers(ContactEditor_CamelCase_HEADERS HEADER_NAMES ContactEditorPagePlugin REQUIRED_HEADERS ContactEditor_HEADERS PREFIX ContactEditor ) ecm_generate_headers(ContactEditorWidget_CamelCase_HEADERS HEADER_NAMES CategoriesEditAbstractWidget REQUIRED_HEADERS ContactEditorWidget_HEADERS PREFIX ContactEditor RELATIVE editor/widgets/ ) ecm_generate_headers(ContactEditorAddressLocationWidget_CamelCase_HEADERS HEADER_NAMES AbstractAddressLocationWidget REQUIRED_HEADERS ContactEditorAddressLocationWidget_HEADERS PREFIX ContactEditor RELATIVE editor/addresseditor/ ) install( FILES ${ContactEditor_CamelCase_HEADERS} ${ContactEditorWidget_CamelCase_HEADERS} ${ContactEditorAddressLocationWidget_CamelCase_HEADERS} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor COMPONENT Devel ) install( FILES ${ContactEditor_HEADERS} ${ContactEditorWidget_HEADERS} ${ContactEditorAddressLocationWidget_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/contacteditor_export.h editor/im/improtocols.h DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/contacteditor COMPONENT Devel ) if (BUILD_TESTING) add_subdirectory(editor/generalinfoeditor/autotests/) add_subdirectory(editor/generalinfoeditor/tests) add_subdirectory(editor/customfieldeditor/autotests/) add_subdirectory(editor/customfieldeditor/tests) add_subdirectory(editor/widgets/autotests/) endif() 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)