CMakeLists.txt 7.78 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.15.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.72.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(AKONADINOTES_LIB_VERSION "5.15.40")
29
set(QT_REQUIRED_VERSION "5.13.0")
30

31

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

36
37
include(GenerateExportHeader)
include(ECMGenerateHeaders)
38

39
40
41
include(FeatureSummary)
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
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
57
find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)
58
59
60
61
62
63
64
65
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)
66
find_package(KF5GuiAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
67

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

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

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

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

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

Laurent Montel's avatar
Laurent Montel committed
150
add_definitions(-DQT_NO_FOREACH)
151
add_definitions(-DQT_NO_KEYWORDS)
152
option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
153
154
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

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

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

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

Laurent Montel's avatar
Laurent Montel committed
173
add_subdirectory(plugins)
174
add_subdirectory(korganizer)
Laurent Montel's avatar
Laurent Montel committed
175
176
add_subdirectory(kmail)
add_subdirectory(kaddressbook)
Laurent Montel's avatar
Laurent Montel committed
177
add_subdirectory(sieveeditor)
Laurent Montel's avatar
Laurent Montel committed
178
add_subdirectory(kmailtransport)
179
180
if(KPimImportWizard_FOUND)
  add_subdirectory(akonadi-import-wizard)
Laurent Montel's avatar
Laurent Montel committed
181
endif()
Laurent Montel's avatar
Laurent Montel committed
182

183
184
185
186
187
ecm_qt_install_logging_categories(
    EXPORT KDEPIMADDONS
    FILE kdepim-addons.categories
    DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
    )
Laurent Montel's avatar
Laurent Montel committed
188
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)