CMakeLists.txt 2.82 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.15.40")
3
project( sieveeditor VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4
set(RELEASE_SERVICE_VERSION "20.11.80")
Laurent Montel's avatar
Laurent Montel committed
5 6 7 8
if (POLICY CMP0063)
    cmake_policy(SET CMP0063 NEW)
endif()

9

10
set(KF5_MIN_VERSION "5.72.0")
11

12
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Laurent Montel's avatar
Laurent Montel committed
13 14 15
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(ECMInstallIcons)

16

Laurent Montel's avatar
Laurent Montel committed
17 18
include(ECMSetupVersion)
include(ECMAddTests)
19

Laurent Montel's avatar
Laurent Montel committed
20 21
include(GenerateExportHeader)
include(ECMGenerateHeaders)
22

Laurent Montel's avatar
Laurent Montel committed
23 24 25 26 27 28
include(FeatureSummary)
include(CheckFunctionExists)
include(ECMGeneratePriFile)

include(KDEInstallDirs)
include(KDECMakeSettings)
29
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
30 31
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
32

Laurent Montel's avatar
Laurent Montel committed
33
# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
34
set(KDEPIM_DEV_VERSION rc)
Laurent Montel's avatar
Laurent Montel committed
35 36 37 38

# add an extra space
if(DEFINED KDEPIM_DEV_VERSION)
    set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
39
endif()
Laurent Montel's avatar
Laurent Montel committed
40

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

43 44
set(KMAILTRANSPORT_LIB_VERSION "5.15.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.15.40")
Laurent Montel's avatar
Laurent Montel committed
45

46
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
47 48
set(KDEPIM_LIB_SOVERSION "5")

49 50 51
set(LIBKSIEVE_LIB_VERSION "5.15.40")
set(PIMCOMMON_LIB_VERSION "5.15.40")
set(KIMAP_LIB_VERSION "5.15.40")
Laurent Montel's avatar
Laurent Montel committed
52

Laurent Montel's avatar
Laurent Montel committed
53

54
set(QT_REQUIRED_VERSION "5.13.0")
Laurent Montel's avatar
Laurent Montel committed
55 56 57
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Network Test)

# Find KF5 package
58 59 60 61 62 63
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5Bookmarks ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5IconThemes ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
64 65 66 67 68

# Find KdepimLibs Package
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MailTransport ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)

Laurent Montel's avatar
Laurent Montel committed
69 70
find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5LibKSieve ${LIBKSIEVE_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
71
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
72

73
find_package(KUserFeedback 0.9.90 CONFIG) # Needs Provider::describeDataSources()
Laurent Montel's avatar
Laurent Montel committed
74
set_package_properties(KUserFeedback PROPERTIES DESCRIPTION "User Feedback lib" TYPE OPTIONAL PURPOSE "Allow to send Telemetry Information (optional). It can be disable in apps.")
75

Laurent Montel's avatar
Laurent Montel committed
76 77
include_directories(${sieveeditor_SOURCE_DIR} ${sieveeditor_BINARY_DIR})

78
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
79
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054800)
80 81
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
82

83 84
if(BUILD_TESTING)
   add_definitions(-DBUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
85
endif()
Laurent Montel's avatar
Laurent Montel committed
86
add_definitions(-DQT_NO_FOREACH)
87
add_definitions(-DQT_NO_KEYWORDS)
Laurent Montel's avatar
Laurent Montel committed
88
add_subdirectory(src)
89 90 91
if (BUILD_TESTING)
    add_subdirectory(autotests)
endif()
Laurent Montel's avatar
Laurent Montel committed
92

Laurent Montel's avatar
Laurent Montel committed
93 94
add_subdirectory(doc)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
Laurent Montel's avatar
Laurent Montel committed
95