CMakeLists.txt 2.12 KB
Newer Older
1
set(PIM_VERSION "5.14.40")
2
cmake_minimum_required(VERSION 3.5)
3
project(mbox-importer VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4

5
set(KF5_MIN_VERSION "5.69.0")
6

7
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
8
9
10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(ECMInstallIcons)

11

Laurent Montel's avatar
Laurent Montel committed
12
13
include(ECMSetupVersion)
include(ECMAddTests)
14

Laurent Montel's avatar
Laurent Montel committed
15
16
include(GenerateExportHeader)
include(ECMGenerateHeaders)
17

Laurent Montel's avatar
Laurent Montel committed
18
19
20
21
22
23
include(FeatureSummary)
include(CheckFunctionExists)
include(ECMGeneratePriFile)

include(KDEInstallDirs)
include(KDECMakeSettings)
Laurent Montel's avatar
Laurent Montel committed
24
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
25
26
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
27

Laurent Montel's avatar
Laurent Montel committed
28
29

# Do NOT add quote
30
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
31
set(RELEASE_SERVICE_VERSION "20.07.40")
Laurent Montel's avatar
Laurent Montel committed
32
33
34
35
# add an extra space
if(DEFINED KDEPIM_DEV_VERSION)
    set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
endif()
Laurent Montel's avatar
Laurent Montel committed
36

37
set(KDEPIM_VERSION "${PIM_VERSION}${KDEPIM_DEV_VERSION} (${RELEASE_SERVICE_VERSION})")
Laurent Montel's avatar
Laurent Montel committed
38

Laurent Montel's avatar
Laurent Montel committed
39
set(AKONADI_VERSION "5.14.40")
Laurent Montel's avatar
Laurent Montel committed
40

41
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
42
set(KDEPIM_LIB_SOVERSION "5")
Laurent Montel's avatar
Laurent Montel committed
43

44
set(QT_REQUIRED_VERSION "5.12.0")
Laurent Montel's avatar
Laurent Montel committed
45
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Gui Widgets)
Laurent Montel's avatar
Laurent Montel committed
46
47
48
set(LIBMAILIMPORTER_VERSION_LIB "5.14.40")
set(MAILCOMMON_LIB_VERSION_LIB "5.14.40")
set(PIMCOMMON_LIB_VERSION "5.14.40")
Laurent Montel's avatar
Laurent Montel committed
49

Laurent Montel's avatar
Laurent Montel committed
50
# Find KF5 package
51
52
53
54
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
55

Laurent Montel's avatar
Laurent Montel committed
56
57
# Find KdepimLibs Package
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
58

Laurent Montel's avatar
Laurent Montel committed
59
find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
60
find_package(KF5MailImporterAkonadi ${LIBMAILIMPORTER_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
61
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
62
include_directories(${mbox-importer_SOURCE_DIR} ${mbox-importer_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
63

64
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
65
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
66
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054400)
67
68
endif()

Laurent Montel's avatar
Laurent Montel committed
69
add_definitions(-DQT_NO_FOREACH)
Laurent Montel's avatar
Laurent Montel committed
70

Laurent Montel's avatar
Laurent Montel committed
71
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
72

Laurent Montel's avatar
Laurent Montel committed
73
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)