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

Laurent Montel's avatar
Laurent Montel committed
5
set(KF5_MIN_VERSION "5.74.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
Laurent Montel's avatar
Laurent Montel committed
30 31
set(KDEPIM_DEV_VERSION alpha)
set(RELEASE_SERVICE_VERSION "20.11.80")
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

39
set(AKONADI_VERSION "5.15.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.13.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
set(LIBMAILIMPORTER_VERSION "5.15.40")
set(MAILCOMMON_LIB_VERSION "5.15.40")
48
set(PIMCOMMON_LIB_VERSION "5.15.40")
49
set(GRANTLEETHEME_LIB_VERSION "5.15.40")
Laurent Montel's avatar
Laurent Montel committed
50

Laurent Montel's avatar
Laurent Montel committed
51
# Find KF5 package
52 53 54 55
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
56

57

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

Laurent Montel's avatar
Laurent Montel committed
61 62
find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MailImporterAkonadi ${LIBMAILIMPORTER_VERSION} CONFIG REQUIRED)
63
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
64
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
65
include_directories(${mbox-importer_SOURCE_DIR} ${mbox-importer_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
66

67
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
68
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054A00)
69

Laurent Montel's avatar
Laurent Montel committed
70
add_definitions(-DQT_NO_FOREACH)
71
add_definitions(-DQT_NO_KEYWORDS)
72 73
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Laurent Montel's avatar
Laurent Montel committed
74

Laurent Montel's avatar
Laurent Montel committed
75
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
76

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