CMakeLists.txt 7.92 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
2
set(PIM_VERSION "5.17.40")
Laurent Montel's avatar
Laurent Montel committed
3
4

project(kdepim-addons VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
5

6
set(KF5_MIN_VERSION "5.83.0")
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
set(CMAKE_MODULE_PATH  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ ${ECM_MODULE_PATH})
Laurent Montel's avatar
Laurent Montel committed
10
11

# Do NOT add quote
12
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
13
14

# add an extra space
15
if(DEFINED KDEPIM_DEV_VERSION)
16
  set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
17
endif()
Laurent Montel's avatar
Laurent Montel committed
18
19

set(KDEPIMADDONS_VERSION_NUMBER ${PIM_VERSION})
20
set(KDEPIMADDONS_VERSION "${KDEPIMADDONS_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
21
22
23
24

set(KDEPIMADDONS_LIB_VERSION "${KDEPIMADDONS_VERSION_NUMBER}")
set(KDEPIMADDONS_LIB_SOVERSION "5")

25
set(QT_REQUIRED_VERSION "5.15.0")
26

27

28
29
30
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMAddTests)
31

32
33
include(GenerateExportHeader)
include(ECMGenerateHeaders)
34

35
include(FeatureSummary)
36
include(KDEGitCommitHooks)
37
38
include(CheckFunctionExists)
include(ECMGeneratePriFile)
39

Laurent Montel's avatar
Laurent Montel committed
40

41
42
include(KDEInstallDirs)
include(KDECMakeSettings)
43
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
44
45
46
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)

47
48
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)

Laurent Montel's avatar
Laurent Montel committed
49
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED WebEngine WebEngineWidgets Widgets Test)
Laurent Montel's avatar
Laurent Montel committed
50

51
52
53
54
55
56
57
58
59
60
61
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Declarative ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5SyntaxHighlighting ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5IconThemes ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Parts ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Prison ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
62
find_package(KF5GuiAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
63

64
65
66
67
68
69
70
71
72
73
74
75
set(MAILCOMMON_LIB_VERSION "5.17.40")
set(GRAVATAR_LIB_VERSION "5.17.40")
set(PIMCOMMON_LIB_VERSION "5.17.40")
set(GRANTLEETHEME_LIB_VERSION "5.17.40")
set(CALENDARSUPPORT_LIB_VERSION "5.17.40")
set(EVENTVIEW_LIB_VERSION "5.17.40")
set(LIBKDEPIM_LIB_VERSION "5.17.40")
set(KADDRESSBOOK_IMPORTEXPORT_LIB_VERSION "5.17.40")
set(LIBKLEO_LIB_VERSION "5.17.40")
set(AKONADI_LIB_VERSION "5.17.40")
set(INCIDENCEEDITOR_LIB_VERSION "5.17.40")
set(KTNEF_LIB_VERSION "5.17.40")
Laurent Montel's avatar
Laurent Montel committed
76
set(MESSAGELIB_LIB_VERSION "5.17.53")
77
78
79
80
81
82
83
84
85
86
set(AKONADICALENDAR_LIB_VERSION "5.17.40")
set(CALENDAR_UTILS_VERSION "5.17.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.17.40")
set(KIMAP_LIB_VERSION "5.17.40")
set(LIBKSIEVE_LIB_VERSION "5.17.40")
set(KMAILTRANSPORT_LIB_VERSION "5.17.40")
set(AKONADICONTACT_LIB_VERSION "5.17.40")
set(IMPORTWIZARD_LIB_VERSION "5.17.40")
set(MAILIMPORTER_LIB_VERSION "5.17.40")
set(KPIMPKPASS_LIB_VERSION "5.17.40")
87
set(KPIMITINERARY_LIB_VERSION "5.17.41")
88
89
set(KONTACTINTERFACE_LIB_VERSION "5.17.40")
set(AKONADINOTES_LIB_VERSION "5.17.40")
90
find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)
91
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
92
find_package(KF5CalendarUtils ${CALENDAR_UTILS_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
93
find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
94
find_package(KF5TemplateParser ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
95
find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
96
find_package(KF5MessageViewer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
97
find_package(KPimAddressbookImportExport ${KADDRESSBOOK_IMPORTEXPORT_LIB_VERSION} CONFIG)
Laurent Montel's avatar
Laurent Montel committed
98
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
99
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
100
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
101
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
102
find_package(KF5IncidenceEditor ${INCIDENCEEDITOR_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
103
104
105
find_package(KF5MessageCore ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MessageComposer ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MessageList ${MESSAGELIB_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
106
107
find_package(KF5CalendarSupport ${CALENDARSUPPORT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5EventViews ${EVENTVIEW_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
108
find_package(KF5Akonadi ${AKONADI_LIB_VERSION} CONFIG REQUIRED)
109
find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
110
find_package(KF5Gravatar ${GRAVATAR_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
111
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
112
find_package(KF5IdentityManagement ${KIDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
113
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
114
find_package(KF5LibKSieve ${LIBKSIEVE_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
115
find_package(KF5Tnef ${KTNEF_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
116
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
117
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
118
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
119
find_package(KF5ContactEditor ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
120
find_package(KPimImportWizard ${IMPORTWIZARD_LIB_VERSION} CONFIG)
Laurent Montel's avatar
Laurent Montel committed
121
find_package(KF5MailImporterAkonadi ${MAILIMPORTER_LIB_VERSION} CONFIG REQUIRED)
122
find_package(KPimPkPass ${KPIMPKPASS_LIB_VERSION} CONFIG REQUIRED)
123
find_package(KPimItinerary ${KPIMITINERARY_LIB_VERSION} CONFIG REQUIRED)
124
find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
125
126
127

set(GRANTLEE_LIB_VERSION "5.2.0")
find_package(Grantlee5 ${GRANTLEE_LIB_VERSION} CONFIG REQUIRED)
128

129
set(CMAKE_CXX_STANDARD 17)
130
set(CMAKE_CXX_STANDARD_REQUIRED ON)
131

132
133
134
if(BUILD_TESTING)
   add_definitions(-DBUILD_TESTING)
endif(BUILD_TESTING)
135

136
if(KDEPIM_ENTERPRISE_BUILD)
137
  set(KDEPIM_ENTERPRISE_BUILD true)
138
else()
139
  set(KDEPIM_ENTERPRISE_BUILD false)
140
141
endif()

Laurent Montel's avatar
Laurent Montel committed
142
# Extra package
143
find_package(Gpgmepp 1.13.1 CONFIG)
144
set_package_properties(Gpgmepp PROPERTIES DESCRIPTION "GpgME library" URL "https://www.gnupg.org" TYPE REQUIRED)
145
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
146
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055400)
147

148
option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
149
150
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

Laurent Montel's avatar
Laurent Montel committed
151
set(QTCREATOR_TEMPLATE_INSTALL_DIR ${KDE_INSTALL_DATADIR}/qtcreator/templates CACHE PATH "Define qtcreator template install path (default is /usr/share/qtcreator/templates)")
152

Laurent Montel's avatar
Laurent Montel committed
153
154
155
find_package(Discount "2")
set_package_properties("discount" PROPERTIES
        DESCRIPTION "A library that gives you formatting functions suitable for marking down entire documents or lines of text"
Laurent Montel's avatar
Laurent Montel committed
156
        URL "https://www.pell.portland.or.us/~orc/Code/discount/"
Laurent Montel's avatar
Laurent Montel committed
157
158
159
        TYPE RECOMMENDED
        PURPOSE "Generate Markdown file.")

160
if(discount_FOUND)
161
162
   if (${PC_LIBMARKDOWN_VERSION})
      if (${PC_LIBMARKDOWN_VERSION} VERSION_GREATER "2.2.5")
Laurent Montel's avatar
Laurent Montel committed
163
           set(DISCOUNT_HAS_HIGHLIGHTING_SUPPORT TRUE)
164
           MESSAGE(STATUS "Discount ${PC_LIBMARKDOWN_VERSION}: has hightlighting support")
Laurent Montel's avatar
Laurent Montel committed
165
166
      endif()
   endif()
167
endif()
Laurent Montel's avatar
Laurent Montel committed
168

169
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
170

171
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
Laurent Montel's avatar
Laurent Montel committed
172
if (USE_UNITY_CMAKE_SUPPORT)
173
174
    set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
    add_definitions(-DCOMPILE_WITH_UNITY_CMAKE_SUPPORT)
175
endif()
176

Laurent Montel's avatar
Laurent Montel committed
177
add_subdirectory(plugins)
178
add_subdirectory(korganizer)
Laurent Montel's avatar
Laurent Montel committed
179
180
add_subdirectory(kmail)
add_subdirectory(kaddressbook)
Laurent Montel's avatar
Laurent Montel committed
181
add_subdirectory(sieveeditor)
Laurent Montel's avatar
Laurent Montel committed
182
add_subdirectory(kmailtransport)
183
184
if(KPimImportWizard_FOUND)
  add_subdirectory(akonadi-import-wizard)
Laurent Montel's avatar
Laurent Montel committed
185
endif()
Laurent Montel's avatar
Laurent Montel committed
186

187
188
189
190
191
ecm_qt_install_logging_categories(
    EXPORT KDEPIMADDONS
    FILE kdepim-addons.categories
    DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
    )
192
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
193
ki18n_install(po)
Laurent Montel's avatar
Laurent Montel committed
194
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)