CMakeLists.txt 8.12 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")
Laurent Montel's avatar
Laurent Montel committed
3
4

project(kdepim-addons VERSION ${PIM_VERSION})
5
6
if(POLICY CMP0063)
  cmake_policy(SET CMP0063 NEW)
Laurent Montel's avatar
Laurent Montel committed
7
8
endif()

9
set(KF5_MIN_VERSION "5.79.0")
Laurent Montel's avatar
Laurent Montel committed
10

11
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
12
set(CMAKE_MODULE_PATH  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ ${ECM_MODULE_PATH})
Laurent Montel's avatar
Laurent Montel committed
13
14

# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
15
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
16
17

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

set(KDEPIMADDONS_VERSION_NUMBER ${PIM_VERSION})
23
set(KDEPIMADDONS_VERSION "${KDEPIMADDONS_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
24
25
26
27

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

28
set(QT_REQUIRED_VERSION "5.14.0")
29

30

31
32
33
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMAddTests)
34

35
36
include(GenerateExportHeader)
include(ECMGenerateHeaders)
37

38
include(FeatureSummary)
39
include(KDEGitCommitHooks)
40
41
include(CheckFunctionExists)
include(ECMGeneratePriFile)
42

Laurent Montel's avatar
Laurent Montel committed
43

44
45
include(KDEInstallDirs)
include(KDECMakeSettings)
46
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
47
48
49
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)

50
51
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
52
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED WebEngine WebEngineWidgets Widgets Test)
Laurent Montel's avatar
Laurent Montel committed
53

54
55
56
57
58
59
60
61
62
63
64
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)
65
find_package(KF5GuiAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
66

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

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

Laurent Montel's avatar
Laurent Montel committed
132
set(CMAKE_CXX_STANDARD 14)
133
set(CMAKE_CXX_STANDARD_REQUIRED ON)
134

135
136
137
if(BUILD_TESTING)
   add_definitions(-DBUILD_TESTING)
endif(BUILD_TESTING)
138

139
if(KDEPIM_ENTERPRISE_BUILD)
140
  set(KDEPIM_ENTERPRISE_BUILD true)
141
else()
142
  set(KDEPIM_ENTERPRISE_BUILD false)
143
144
endif()

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

151
option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
152
153
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

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

Laurent Montel's avatar
Laurent Montel committed
156
157
158
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
159
        URL "https://www.pell.portland.or.us/~orc/Code/discount/"
Laurent Montel's avatar
Laurent Montel committed
160
161
162
        TYPE RECOMMENDED
        PURPOSE "Generate Markdown file.")

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

Laurent Montel's avatar
Laurent Montel committed
172
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE)
173

Laurent Montel's avatar
Laurent Montel committed
174
175
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if (USE_UNITY_CMAKE_SUPPORT)
176
177
178
    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()
Laurent Montel's avatar
Laurent Montel committed
179
        set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true)
180
181
    endif()
endif()
Laurent Montel's avatar
Laurent Montel committed
182
add_subdirectory(plugins)
183
add_subdirectory(korganizer)
Laurent Montel's avatar
Laurent Montel committed
184
185
add_subdirectory(kmail)
add_subdirectory(kaddressbook)
Laurent Montel's avatar
Laurent Montel committed
186
add_subdirectory(sieveeditor)
Laurent Montel's avatar
Laurent Montel committed
187
add_subdirectory(kmailtransport)
188
189
if(KPimImportWizard_FOUND)
  add_subdirectory(akonadi-import-wizard)
Laurent Montel's avatar
Laurent Montel committed
190
endif()
Laurent Montel's avatar
Laurent Montel committed
191

192
193
194
195
196
ecm_qt_install_logging_categories(
    EXPORT KDEPIMADDONS
    FILE kdepim-addons.categories
    DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
    )
197
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
198
ki18n_install(po)
Laurent Montel's avatar
Laurent Montel committed
199
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)