CMakeLists.txt 6.82 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
Laurent Montel's avatar
Laurent Montel committed
2
# Do NOT add quote
3
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
4
5
6

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

10
11
set(PIM_VERSION "5.17.40")
set(RELEASE_SERVICE_VERSION "21.07.40")
12

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

15
project(korganizer VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
16

17
18
if(POLICY CMP0063)
  cmake_policy(SET CMP0063 NEW)
Laurent Montel's avatar
Laurent Montel committed
19
endif()
20
set(KF5_MIN_VERSION "5.81.0")
Laurent Montel's avatar
Laurent Montel committed
21

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

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

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

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

Laurent Montel's avatar
Laurent Montel committed
33
include(FeatureSummary)
34
include(KDEGitCommitHooks)
Laurent Montel's avatar
Laurent Montel committed
35
36
37
38
39
include(CheckFunctionExists)
include(ECMGeneratePriFile)

include(KDEInstallDirs)
include(KDECMakeSettings)
40
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
41
42
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
43

Laurent Montel's avatar
Laurent Montel committed
44

45
46
47
48
49
50
51
52
53
54
55
56
set(AKONADI_MIMELIB_VERSION "5.17.40")
set(AKONADI_CONTACT_VERSION "5.17.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.17.40")
set(KLDAP_LIB_VERSION "5.17.40")
set(KMAILTRANSPORT_LIB_VERSION "5.17.40")
set(CALENDARUTILS_LIB_VERSION "5.17.40")
set(AKONADICALENDAR_LIB_VERSION "5.17.40")
set(KONTACTINTERFACE_LIB_VERSION "5.17.40")
set(KMIME_LIB_VERSION "5.17.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.17.40")
set(AKONADI_VERSION "5.17.40")
set(GRANTLEETHEME_LIB_VERSION "5.17.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.17.40")
Laurent Montel's avatar
Laurent Montel committed
61

62
set(QT_REQUIRED_VERSION "5.15.0")
Laurent Montel's avatar
Laurent Montel committed
63
option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE)
64
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Gui Widgets Test UiTools)
65

Laurent Montel's avatar
Laurent Montel committed
66
find_package(KUserFeedback 1.0.0 CONFIG) # Needs Provider::describeDataSources()
Laurent Montel's avatar
Laurent Montel committed
67
set_package_properties(KUserFeedback PROPERTIES DESCRIPTION "User Feedback lib" TYPE OPTIONAL PURPOSE "Allow to send Telemetry Information (optional). It can be disable in apps.")
68
69
70
71
72

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

73
74
75
76
77
78
set(PIMCOMMON_LIB_VERSION "5.17.40")
set(LIBKDEPIM_LIB_VERSION "5.17.40")
set(LIBINCIDENCEEDITOR_LIB_VERSION "5.17.40")
set(CALENDARSUPPORT_LIB_VERSION "5.17.40")
set(EVENTVIEW_LIB_VERSION "5.17.40")
set(AKONADI_SEARCH_VERSION "5.17.40")
Laurent Montel's avatar
Laurent Montel committed
79

Laurent Montel's avatar
Laurent Montel committed
80
find_package(KF5AkonadiSearch ${AKONADI_SEARCH_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
81
set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://www.kde.org" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi")
Laurent Montel's avatar
Laurent Montel committed
82
83

# Find KF5 package
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
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
102

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

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
128
129
130
131
132
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)
133
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
134
135
if(NOT APPLE)
  find_package(X11)
Laurent Montel's avatar
Laurent Montel committed
136
137
138
endif()

set(KDEPIM_HAVE_X11 ${X11_FOUND})
139
140
configure_file(config-korganizer.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-korganizer.h)
configure_file(korgac/config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h)
Laurent Montel's avatar
Laurent Montel committed
141
include_directories(${korganizer_SOURCE_DIR} ${korganizer_BINARY_DIR} ${korgac_SOURCE_DIR} ${korgac_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
142
configure_file(korganizer-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/korganizer-version.h @ONLY)
Laurent Montel's avatar
Laurent Montel committed
143

144

Laurent Montel's avatar
Laurent Montel committed
145
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
146
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055200)
147
set(CMAKE_CXX_STANDARD 17)
148
set(CMAKE_CXX_STANDARD_REQUIRED ON)
149
150
151
remove_definitions(-DQT_NO_FOREACH)
remove_definitions(-DQT_NO_KEYWORDS)
add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
152

153
154
155
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)

set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
156
if (USE_UNITY_CMAKE_SUPPORT)
157
    set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
158
endif()
159

160

Laurent Montel's avatar
Laurent Montel committed
161
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
162
add_subdirectory(korgac)
Laurent Montel's avatar
Laurent Montel committed
163

164
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
165
166
167
168
        EXPORT KORGANIZER
        FILE korganizer.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
169

170
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
171
ki18n_install(po)
Laurent Montel's avatar
Laurent Montel committed
172
173
174
175
176
177

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

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