CMakeLists.txt 4.31 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.16.40")
3
project(akregator VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4

5
set(KF5_MIN_VERSION "5.79.0")
Laurent Montel's avatar
Laurent Montel committed
6
set(RELEASE_SERVICE_VERSION "21.03.80")
Laurent Montel's avatar
Laurent Montel committed
7

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

12

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

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

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

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

30

Laurent Montel's avatar
Laurent Montel committed
31
# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
32
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
33
34
35

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

39
40
set(KDEPIM_VERSION "${PIM_VERSION}${KDEPIM_DEV_VERSION} (${RELEASE_SERVICE_VERSION})")
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
41
42
set(KDEPIM_LIB_SOVERSION "5")

43
set(QT_REQUIRED_VERSION "5.14.0")
Laurent Montel's avatar
Laurent Montel committed
44

45
46
47
48
49
50
51
set(KONTACTINTERFACE_LIB_VERSION "5.16.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.16.40")
set(LIBGRANTLEETHEME_LIB_VERSION "5.16.40")
set(LIBKDEPIM_LIB_VERSION "5.16.40")
set(LIBKLEO_LIB_VERSION "5.16.40")
set(MESSAGELIB_LIB_VERSION "5.16.40")
set(PIMCOMMON_LIB_VERSION "5.16.40")
Laurent Montel's avatar
Laurent Montel committed
52

53
54
55
option(KDEPIM_KUSERFEEDBACK "Enable user feedback support (experimental)" FALSE)


56
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test WebEngine WebEngineWidgets PrintSupport)
Laurent Montel's avatar
Laurent Montel committed
57
find_package(Grantlee5 "5.2" CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
58
59

# Find KF5 package
60
61
62
63
64
65
66
67
68
find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5NotifyConfig ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Parts ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5TextEditor ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Syndication ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
69
70

# Find KdepimLibs Package
Laurent Montel's avatar
Laurent Montel committed
71
find_package(KF5GrantleeTheme ${LIBGRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
72
find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
73
74
75
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MessageViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
76
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
77
find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
78

Laurent Montel's avatar
Laurent Montel committed
79
80
# Fix plugin support for removing theses dependancies
find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
81
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
82

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


87
include_directories(${akregator_SOURCE_DIR} ${akregator_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
88
add_definitions(-DTRANSLATION_DOMAIN=\"akregator\")
89
set(CMAKE_CXX_STANDARD 14)
90
set(CMAKE_CXX_STANDARD_REQUIRED ON)
91
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
92
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055000)
Laurent Montel's avatar
Laurent Montel committed
93
94
95
if (TARGET KUserFeedbackWidgets)
    add_definitions(-DWITH_KUSERFEEDBACK)
endif()
96
97


98
99
100
101
102
103
104
105
106
107
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE)

set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if (USE_UNITY_CMAKE_SUPPORT)
    if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
        message(STATUS "CMAKE version is less than 3.16.0 . We can't use cmake unify build support")
    else()
        set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true)
    endif()
endif()
108

109
110
111
112
113
add_subdirectory(export)
add_subdirectory(interfaces)
add_subdirectory(plugins)
add_subdirectory(configuration)
add_subdirectory(src)
114
add_subdirectory(kontactplugin)
115
add_subdirectory(kconf_update)
Laurent Montel's avatar
Laurent Montel committed
116

117
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
118
119
120
121
        EXPORT AKREGATOR
        FILE akregator.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
122
add_subdirectory(doc)
123
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
Laurent Montel's avatar
Laurent Montel committed
124
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)