CMakeLists.txt 5.92 KB
Newer Older
1
2
# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: BSD-3-Clause
3
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
Laurent Montel's avatar
Laurent Montel committed
4
# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
5
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
6
7
8

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

Laurent Montel's avatar
Laurent Montel committed
12
13
set(PIM_VERSION "5.19.40")
set(RELEASE_SERVICE_VERSION "22.03.40")
14

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

17
project(korganizer VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
18

19
set(KF5_MIN_VERSION "5.91.0")
Laurent Montel's avatar
Laurent Montel committed
20

21
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
22

Laurent Montel's avatar
Laurent Montel committed
23
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
24

Laurent Montel's avatar
Laurent Montel committed
25
26
27
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMAddTests)
28

Laurent Montel's avatar
Laurent Montel committed
29
30
include(GenerateExportHeader)
include(ECMGenerateHeaders)
31

Laurent Montel's avatar
Laurent Montel committed
32
include(FeatureSummary)
33
include(KDEGitCommitHooks)
34
35
36
include(KDEClangFormat)
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h *.c)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
Laurent Montel's avatar
Laurent Montel committed
37
38
39
40
include(CheckFunctionExists)

include(KDEInstallDirs)
include(KDECMakeSettings)
41
include(KDECompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
42
43
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
44
include(ECMDeprecationSettings)
45

Laurent Montel's avatar
Laurent Montel committed
46

47
set(AKONADI_CONTACT_VERSION "5.19.41")
48
49
50
51
set(IDENTITYMANAGEMENT_LIB_VERSION "5.19.40")
set(KLDAP_LIB_VERSION "5.19.40")
set(KMAILTRANSPORT_LIB_VERSION "5.19.40")
set(CALENDARUTILS_LIB_VERSION "5.19.40")
52
set(AKONADICALENDAR_LIB_VERSION "5.19.42")
53
54
55
56
set(KONTACTINTERFACE_LIB_VERSION "5.19.40")
set(KMIME_LIB_VERSION "5.19.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.19.40")
set(AKONADI_VERSION "5.19.40")
Laurent Montel's avatar
Laurent Montel committed
57

58
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
59
set(KDEPIM_LIB_SOVERSION "5")
60
set(AKONADINOTES_LIB_VERSION "5.19.41")
Laurent Montel's avatar
Laurent Montel committed
61

62
set(QT_REQUIRED_VERSION "5.15.2")
63
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Gui Widgets Test UiTools)
64

65
find_package(KUserFeedback 1.2.0 CONFIG) 
Laurent Montel's avatar
Laurent Montel committed
66
set_package_properties(KUserFeedback PROPERTIES DESCRIPTION "User Feedback lib" TYPE OPTIONAL PURPOSE "Allow to send Telemetry Information (optional).")
67
68
69
70
71

if (TARGET KUserFeedbackWidgets)
    add_definitions(-DWITH_KUSERFEEDBACK)
endif()

72
set(PIMCOMMON_LIB_VERSION "5.19.40")
73
set(LIBKDEPIM_LIB_VERSION "5.19.41")
74
75
76
set(LIBINCIDENCEEDITOR_LIB_VERSION "5.19.40")
set(CALENDARSUPPORT_LIB_VERSION "5.19.40")
set(EVENTVIEW_LIB_VERSION "5.19.40")
Laurent Montel's avatar
Laurent Montel committed
77

Laurent Montel's avatar
Laurent Montel committed
78
# Find KF5 package
79
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5IconThemes ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5ItemViews ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5JobWidgets ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5NewStuff ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Parts ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WindowSystem ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
97

Laurent Montel's avatar
Laurent Montel committed
98
99
100
101
102
103
104
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
105
106
107
# Find KdepimLibs Package
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
108
109
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
110
111
find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
112
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
113
114
115
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
116
find_package(Phonon4Qt${QT_MAJOR_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
117
118
119
120
121

find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)

Laurent Montel's avatar
Laurent Montel committed
122
123
124
125
126
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5IncidenceEditor ${LIBINCIDENCEEDITOR_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarSupport ${CALENDARSUPPORT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5EventViews ${EVENTVIEW_LIB_VERSION} CONFIG REQUIRED)
127

128
129
if(NOT APPLE)
  find_package(X11)
Laurent Montel's avatar
Laurent Montel committed
130
131
132
endif()

set(KDEPIM_HAVE_X11 ${X11_FOUND})
133
configure_file(config-korganizer.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-korganizer.h)
134
include_directories(${korganizer_SOURCE_DIR} ${korganizer_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
135
configure_file(korganizer-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/korganizer-version.h @ONLY)
Laurent Montel's avatar
Laurent Montel committed
136

137

138
ecm_set_disabled_deprecation_versions(QT 5.15.2
139
    KF 5.92.0
140
141
142
143
    KCOREADDONS 5.88.0 #KPluginFactory::registerPlugin
    KSERVICE 5.89.0 #KServiceTypeTrader::self

)
144

145
146
147
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)

set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
148
if (USE_UNITY_CMAKE_SUPPORT)
149
    set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
150
endif()
151

152

Laurent Montel's avatar
Laurent Montel committed
153
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
154

155
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
156
157
158
159
        EXPORT KORGANIZER
        FILE korganizer.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
160

161
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
162
ki18n_install(po)
Laurent Montel's avatar
Laurent Montel committed
163
164
165
166
167
168

if(KF5DocTools_FOUND)
    kdoctools_install(po)
    add_subdirectory(doc)
endif()

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