1 cmake_minimum_required(VERSION 2.8.12)
5 if(${CMAKE_SOURCE_DIR} STREQUAL ${MailImporter_SOURCE_DIR})
7 find_package(ECM 5.16.0 CONFIG REQUIRED)
8 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
10 include(GenerateExportHeader)
11 include(ECMSetupVersion)
12 include(ECMGenerateHeaders)
13 include(ECMGeneratePriFile)
14 include(ECMPackageConfigHelpers)
15 include(ECMSetupVersion)
16 include(FeatureSummary)
17 include(KDEInstallDirs)
18 include(KDECMakeSettings)
19 include(KDEFrameworkCompilerSettings)
20 include(ECMQtDeclareLoggingCategory)
24 set(KF5_VERSION "5.16.0")
25 set(KDEPIMLIBS_LIB_VERSION "5.0.81")
26 set(KDEPIM_LIB_VERSION "5.0.90")
27 set(QT_REQUIRED_VERSION "5.4.0")
28 set(KMIME_LIB_VERSION "4.87.0")
30 find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
31 find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools Xml)
32 find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
33 find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
34 find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
35 find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
36 find_package(KF5Archive ${KF5_VERSION} CONFIG REQUIRED)
37 find_package(KF5Libkdepim ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
38 find_package(KF5AkonadiContact ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
40 ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX MAILIMPORTER
41 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/mailimporter_version.h"
42 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfigVersion.cmake"
46 ########### Targets ###########
48 add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
49 remove_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
50 ########### CMake Config Files ###########
51 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MailImporter")
53 ecm_configure_package_config_file(
54 "${CMAKE_CURRENT_SOURCE_DIR}/KF5MailImporterConfig.cmake.in"
55 "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfig.cmake"
56 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
60 "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfig.cmake"
61 "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfigVersion.cmake"
62 DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
66 install(EXPORT KF5MailImporterTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5MailImporterTargets.cmake NAMESPACE KF5::)
69 ${CMAKE_CURRENT_BINARY_DIR}/mailimporter_version.h
70 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
73 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
75 ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX MAILIMPORTER
76 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/mailimporter_version.h"
77 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfigVersion.cmake"
82 add_definitions(-DTRANSLATION_DOMAIN=\"libmailimporter\")
85 add_subdirectory(autotests)