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

5
set(KF5_MIN_VERSION "5.81.0")
6
set(RELEASE_SERVICE_VERSION "21.07.40")
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
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.15.0")
Laurent Montel's avatar
Laurent Montel committed
44

45
46
47
48
49
set(KONTACTINTERFACE_LIB_VERSION "5.17.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.17.40")
set(LIBGRANTLEETHEME_LIB_VERSION "5.17.40")
set(LIBKDEPIM_LIB_VERSION "5.17.40")
set(LIBKLEO_LIB_VERSION "5.17.40")
50
set(MESSAGELIB_LIB_VERSION "5.17.47")
51
set(PIMCOMMON_LIB_VERSION "5.17.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
find_package(KF5Crash ${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)
64
find_package(KF5TextWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
65
66
67
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
68
69
70
71
72
73
find_package(KF5DocTools ${KF5_MIN_VERSION})
set_package_properties(KF5DocTools PROPERTIES DESCRIPTION
    "Tools to generate documentation"
    TYPE OPTIONAL
)

Laurent Montel's avatar
Laurent Montel committed
74
75

# Find KdepimLibs Package
Laurent Montel's avatar
Laurent Montel committed
76
find_package(KF5GrantleeTheme ${LIBGRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
77
find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
78
79
80
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
81
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
82
find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
83

Laurent Montel's avatar
Laurent Montel committed
84
85
# Fix plugin support for removing theses dependancies
find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
86
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
87

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


92
include_directories(${akregator_SOURCE_DIR} ${akregator_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
93
add_definitions(-DTRANSLATION_DOMAIN=\"akregator\")
94
set(CMAKE_CXX_STANDARD 17)
95
set(CMAKE_CXX_STANDARD_REQUIRED ON)
96
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
97
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055200)
Laurent Montel's avatar
Laurent Montel committed
98
99
100
if (TARGET KUserFeedbackWidgets)
    add_definitions(-DWITH_KUSERFEEDBACK)
endif()
101

102
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
103

104
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
105
if (USE_UNITY_CMAKE_SUPPORT)
106
    set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
107
endif()
108
109
110
111
112
add_subdirectory(export)
add_subdirectory(interfaces)
add_subdirectory(plugins)
add_subdirectory(configuration)
add_subdirectory(src)
113
add_subdirectory(kontactplugin)
114
add_subdirectory(kconf_update)
Laurent Montel's avatar
Laurent Montel committed
115

116
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
117
118
119
120
        EXPORT AKREGATOR
        FILE akregator.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
121
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
122
ki18n_install(po)
Laurent Montel's avatar
Laurent Montel committed
123
124
125
126
127
if(KF5DocTools_FOUND)
    kdoctools_install(po)
    add_subdirectory(doc)
endif()

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