CMakeLists.txt 2.84 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1

2
3
4
5
cmake_minimum_required(VERSION 2.8.12)

project(MailImporter)

Laurent Montel's avatar
Laurent Montel committed
6
set(KF5_VERSION "5.26.0")
Laurent Montel's avatar
Laurent Montel committed
7
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
8
9
10
11
12
13
14
15
16
17
18
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
19
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
20
21
22
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)

Laurent Montel's avatar
Laurent Montel committed
23
set(PIM_VERSION "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
24
25
set(MAILIMPORTER_LIB ${PIM_VERSION})

26

Laurent Montel's avatar
Laurent Montel committed
27
28
set(AKONADIMIME_LIB_VERSION "5.3.40")
set(KDEPIM_LIB_VERSION "5.3.40")
29
set(QT_REQUIRED_VERSION "5.5.0")
Laurent Montel's avatar
Laurent Montel committed
30
31
set(KMIME_LIB_VERSION "5.3.40")
set(AKONADI_VERSION "5.3.40")
32

33
34
35
36
37
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test Xml)

find_package(KF5Archive ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5CoreAddons ${KF5_VERSION} CONFIG REQUIRED)
38
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
39
40

find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
41
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
42
find_package(KF5AkonadiMime ${AKONADIMIME_LIB_VERSION} CONFIG REQUIRED)
43
44
find_package(KF5Libkdepim ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)

Laurent Montel's avatar
Laurent Montel committed
45
ecm_setup_version(${MAILIMPORTER_LIB} VARIABLE_PREFIX MAILIMPORTER
46
47
48
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
84
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/mailimporter_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfigVersion.cmake"
                        SOVERSION 5
)

########### Targets ###########

add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
remove_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MailImporter")

ecm_configure_package_config_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5MailImporterConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfig.cmake"
  INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
)

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

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

install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/mailimporter_version.h
  DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)


add_definitions(-DTRANSLATION_DOMAIN=\"libmailimporter\")
add_subdirectory(src)
if (BUILD_TESTING)
   add_subdirectory(autotests)
endif()

Laurent Montel's avatar
Laurent Montel committed
85
install( FILES mailimporter.renamecategories mailimporter.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
Laurent Montel's avatar
Laurent Montel committed
86
87

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)