CMakeLists.txt 7.65 KB
Newer Older
Rolf Eike Beer's avatar
Rolf Eike Beer committed
1
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
2

3
# KDE Application Version, managed by release script
4
set (RELEASE_SERVICE_VERSION_MAJOR "20")
5
set (RELEASE_SERVICE_VERSION_MINOR "11")
6
7
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
8

9
project(kgpg VERSION ${RELEASE_SERVICE_VERSION})
Laurent Montel's avatar
Laurent Montel committed
10
set(QT_MIN_VERSION "5.11.0")
Ahmad Samir's avatar
Ahmad Samir committed
11
set(KF5_MIN_VERSION "5.71.0")
Andrius Štikonas's avatar
Andrius Štikonas committed
12

Laurent Montel's avatar
Laurent Montel committed
13
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Andrius Štikonas's avatar
Andrius Štikonas committed
14
15
16
17
18
19
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")

include(ECMAddAppIcon)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECMakeSettings)
20
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Andrius Štikonas's avatar
Andrius Štikonas committed
21
22
include(FeatureSummary)
include(ECMSetupVersion)
Rolf Eike Beer's avatar
Rolf Eike Beer committed
23
include(CMakeFindDependencyMacro)
Laurent Montel's avatar
Laurent Montel committed
24
include(ECMQtDeclareLoggingCategory)
Andrius Štikonas's avatar
Andrius Štikonas committed
25
26
27

find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
  Core
28
  DBus
Andrius Štikonas's avatar
Andrius Štikonas committed
29
  Gui
30
  PrintSupport
Andrius Štikonas's avatar
Andrius Štikonas committed
31
32
  Widgets
)
Laurent Montel's avatar
Laurent Montel committed
33

Andrius Štikonas's avatar
Andrius Štikonas committed
34
# Load the frameworks we need
Laurent Montel's avatar
Laurent Montel committed
35
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
Andrius Štikonas's avatar
Andrius Štikonas committed
36
37
38
  Archive
  DocTools
  Codecs
39
  CoreAddons
Andrius Štikonas's avatar
Andrius Štikonas committed
40
  Crash
41
  DBusAddons
42
43
  I18n
  IconThemes
44
  JobWidgets
Andrius Štikonas's avatar
Andrius Štikonas committed
45
  KIO
46
  Notifications
Andrius Štikonas's avatar
Andrius Štikonas committed
47
  Service
Andrius Štikonas's avatar
Andrius Štikonas committed
48
  TextWidgets
49
  XmlGui
Andrius Štikonas's avatar
Andrius Štikonas committed
50
  WidgetsAddons
51
  WindowSystem
Andrius Štikonas's avatar
Andrius Štikonas committed
52
)
53

54
55
56
57
58
59
# kdepimlibs
find_package(KF5 REQUIRED
  AkonadiContact
  Contacts
)

60
# only headers are used
Andrius Štikonas's avatar
Andrius Štikonas committed
61
find_package(Gpgme REQUIRED)
62

63
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
64
65
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
66

67
add_subdirectory( icons )
Andrius Štikonas's avatar
Andrius Štikonas committed
68
add_subdirectory( doc )
Andrius Štikonas's avatar
Andrius Štikonas committed
69
include_directories(  ${KDEPIMLIBS_INCLUDE_DIR} ${GPGME_INCLUDES} )
70

71
72
option(KGPG_DEBUG_TRANSACTIONS "show commands and results of gpg calls in debug log" Off)

Laurent Montel's avatar
Laurent Montel committed
73
74
75



76
set(core_SRCS
Laurent Montel's avatar
Laurent Montel committed
77
78
   core/convert.cpp
   core/images.cpp
79
   core/emailvalidator.cpp
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
   core/kgpgkey.cpp
   core/KGpgExpandableNode.cpp
   core/KGpgKeyNode.cpp
   core/KGpgGroupMemberNode.cpp
   core/KGpgGroupNode.cpp
   core/KGpgNode.cpp
   core/KGpgOrphanNode.cpp
   core/KGpgRefNode.cpp
   core/KGpgRootNode.cpp
   core/KGpgSignableNode.cpp
   core/KGpgSignNode.cpp
   core/KGpgSubkeyNode.cpp
   core/KGpgUatNode.cpp
   core/KGpgUidNode.cpp
)
95

96
97
98
set(kgpg_editor_SRCS
   editor/kgpgmd5widget.cpp
   editor/kgpgeditor.cpp
99
   editor/kgpgtextedit.cpp
100
101
102
)

set(kgpg_model_SRCS
103
   model/gpgservermodel.cpp
104
105
106
   model/kgpgitemmodel.cpp
   model/groupeditproxymodel.cpp
   model/keylistproxymodel.cpp
107
   model/kgpgsearchresultmodel.cpp
108
109
110
   model/selectkeyproxymodel.cpp
)

111
112
set(kgpg_transaction_SRCS
   transactions/kgpgtransaction.cpp
113
   transactions/kgpgtransactionjob.cpp
Andrius Štikonas's avatar
Andrius Štikonas committed
114
   transactions/kgpgtransactionprivate.cpp
115
   transactions/kgpguidtransaction.cpp
116
   transactions/kgpgeditkeytransaction.cpp
117
   transactions/kgpgsigntransactionhelper.cpp
118
119
120
121
   transactions/kgpgchangedisable.cpp
   transactions/kgpgchangeexpire.cpp
   transactions/kgpgchangepass.cpp
   transactions/kgpgchangetrust.cpp
122
   transactions/kgpgdelsign.cpp
123
   transactions/kgpgdeluid.cpp
124
   transactions/kgpgencrypt.cpp
125
   transactions/kgpgexport.cpp
126
   transactions/kgpgaddphoto.cpp
127
128
   transactions/kgpgadduid.cpp
   transactions/kgpggeneratekey.cpp
129
   transactions/kgpggeneraterevoke.cpp
130
   transactions/kgpgdecrypt.cpp
131
   transactions/kgpgdelkey.cpp
Rolf Eike Beer's avatar
Rolf Eike Beer committed
132
   transactions/kgpgimport.cpp
133
134
   transactions/kgpgkeyservertransaction.cpp
   transactions/kgpgkeyservergettransaction.cpp
135
   transactions/kgpgkeyserversearchtransaction.cpp
136
   transactions/kgpgprimaryuid.cpp
137
   transactions/kgpgsendkeys.cpp
138
   transactions/kgpgsignkey.cpp
139
   transactions/kgpgsigntext.cpp
140
   transactions/kgpgsignuid.cpp
141
   transactions/kgpgtextorfiletransaction.cpp
142
   transactions/kgpgverify.cpp
143
144
145
)

set(kgpg_SRCS ${core_SRCS} ${kgpg_editor_SRCS} ${kgpg_model_SRCS} ${kgpg_transaction_SRCS}
146
   selectpublickeydialog.cpp
147
   selectsecretkey.cpp
148
149
   kgpgoptions.cpp
   keysmanager.cpp
150
151
152
   kgpg.cpp
   kgpgkeygenerate.cpp
   kgpginterface.cpp
153
   kgpgtextinterface.cpp
154
   gpgproc.cpp
155
   klinebufferedprocess.cpp
Andrius Štikonas's avatar
Andrius Štikonas committed
156
   klinebufferedprocessprivate.cpp
157
158
   keyservers.cpp
   detailedconsole.cpp
159
   keyinfodialog.cpp
Jimmy Gilles's avatar
Jimmy Gilles committed
160
161
162
   newkey.cpp
   keyexport.cpp
   conf_encryption.cpp
Laurent Montel's avatar
Laurent Montel committed
163
   kgpgrevokewidget.cpp
164
   keytreeview.cpp
165
   groupedit.cpp
166
167
   sourceselect.cpp
   kgpgchangekey.cpp
168
   kgpgfirstassistant.cpp
169
   kgpgexternalactions.cpp
170
   selectexpirydate.cpp
171
   caff.cpp
172
   foldercompressjob.cpp
173
)
Laurent Montel's avatar
Laurent Montel committed
174

Laurent Montel's avatar
Laurent Montel committed
175
176
ecm_qt_declare_logging_category(kgpg_SRCS HEADER kgpg_general_debug.h IDENTIFIER KGPG_LOG_GENERAL CATEGORY_NAME org.kde.kgpg_general)
ecm_qt_declare_logging_category(kgpg_SRCS HEADER kgpg_transactions_debug.h IDENTIFIER KGPG_LOG_TRANSACTIONS CATEGORY_NAME org.kde.kgpg_transactions)
Laurent Montel's avatar
Laurent Montel committed
177
178


179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
set(kgpg_HDRS
   caff.h
   caff_p.h
   conf_encryption.h
   detailedconsole.h
   foldercompressjob.h
   gpgproc.h
   groupedit.h
   keyexport.h
   keyinfodialog.h
   keyservers.h
   keysmanager.h
   keytreeview.h
   kgpg.h
   kgpgchangekey.h
   kgpgexternalactions.h
   kgpgfirstassistant.h
   kgpginterface.h
   kgpgkeygenerate.h
   kgpgoptions.h
   kgpgrevokewidget.h
   kgpgtextinterface.h
   klinebufferedprocess.h
   newkey.h
   selectexpirydate.h
   selectpublickeydialog.h
   selectsecretkey.h
   sourceselect.h
)

209
qt5_add_dbus_adaptor( kgpg_SRCS org.kde.kgpg.Key.xml keysmanager.h KeysManager)
Laurent Montel's avatar
Laurent Montel committed
210

211
qt5_add_dbus_interface(kgpg_SRCS org.kde.kgpg.Key.xml kgpg_interface )
212

Andrius Štikonas's avatar
Andrius Štikonas committed
213
ki18n_wrap_ui(kgpg_SRCS
Urs Wolfer's avatar
Urs Wolfer committed
214
215
216
217
218
219
220
221
222
223
    adduid.ui
    conf_gpg.ui
    searchres.ui
    groupedit.ui
    conf_ui2.ui
    conf_servers.ui
    conf_misc.ui
    newkey.ui
    keyexport.ui
    conf_encryption.ui
224
    kgpgKeyInfo.ui
225
    kgpgkeygenerate.ui
Urs Wolfer's avatar
Urs Wolfer committed
226
227
228
229
230
    kgpgrevokewidget.ui
    keyserver.ui
    conf_decryption.ui
    sourceselect.ui
)
Laurent Montel's avatar
Laurent Montel committed
231

232
233
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*-apps-kgpg.png")
ecm_add_app_icon(kgpg_SRCS ICONS ${ICONS_SRCS})
234

Andrius Štikonas's avatar
Andrius Štikonas committed
235
kconfig_add_kcfg_files(kgpg_SRCS kgpgsettings.kcfgc )
Laurent Montel's avatar
Laurent Montel committed
236

Kavinda Pitiduwa Gamage's avatar
Kavinda Pitiduwa Gamage committed
237
238
239
add_library(kgpg_lib STATIC ${kgpg_SRCS} ${kgpg_HDRS})
add_executable(kgpg main.cpp)
target_link_libraries(kgpg kgpg_lib)
Laurent Montel's avatar
Laurent Montel committed
240

241
if (KGPG_DEBUG_TRANSACTIONS)
242
	set_property(SOURCE ${kgpg_transaction_SRCS} APPEND PROPERTY COMPILE_DEFINITIONS "KGPG_DEBUG_TRANSACTIONS")
243
endif ()
244

245
set_property(SOURCE main.cpp APPEND PROPERTY COMPILE_DEFINITIONS "KGPG_VERSION=\"${RELEASE_SERVICE_VERSION}\"")
246

Kavinda Pitiduwa Gamage's avatar
Kavinda Pitiduwa Gamage committed
247
target_link_libraries(kgpg_lib
248
    KF5::AkonadiContact
Andrius Štikonas's avatar
Andrius Štikonas committed
249
250
251
    KF5::Archive
    KF5::Codecs
    KF5::Contacts
252
    KF5::CoreAddons
Andrius Štikonas's avatar
Andrius Štikonas committed
253
    KF5::Crash
254
    KF5::DBusAddons
255
    KF5::I18n
256
    KF5::IconThemes
257
    KF5::JobWidgets
Andrius Štikonas's avatar
Andrius Štikonas committed
258
    KF5::KIOCore
259
260
    KF5::KIOFileWidgets
    KF5::KIOWidgets
261
    KF5::Notifications
262
    KF5::Service
Andrius Štikonas's avatar
Andrius Štikonas committed
263
    KF5::TextWidgets
264
    KF5::XmlGui
265
    KF5::WidgetsAddons
266
267
    KF5::WindowSystem
    Qt5::PrintSupport
268
)
Laurent Montel's avatar
Laurent Montel committed
269

270
271
272
273
if(BUILD_TESTING)
  add_subdirectory(tests)
endif()

274
install(TARGETS kgpg  ${INSTALL_TARGETS_DEFAULT_ARGS} )
Laurent Montel's avatar
Laurent Montel committed
275
276
277

########### install files ###############

278
279
install( FILES editor/kgpgeditor.rc keysmanager.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kgpg)
install( FILES tips  DESTINATION ${DATA_INSTALL_DIR}/kgpg)
280
install( PROGRAMS org.kde.kgpg.desktop  DESTINATION ${XDG_APPS_INSTALL_DIR})
281
install( FILES org.kde.kgpg.appdata.xml  DESTINATION ${KDE_INSTALL_METAINFODIR})
282
install( FILES kgpg.kcfg  DESTINATION ${KCFG_INSTALL_DIR})
283
install( FILES org.kde.kgpg.desktop  DESTINATION ${AUTOSTART_INSTALL_DIR} )
284
install( FILES encryptfile.desktop encryptfolder.desktop viewdecrypted.desktop DESTINATION
285
${SERVICES_INSTALL_DIR}/ServiceMenus)
286
install( FILES org.kde.kgpg.Key.xml DESTINATION ${DBUS_INTERFACES_INSTALL_DIR})
Laurent Montel's avatar
Laurent Montel committed
287

288
289
290
291
292
ecm_install_icons(ICONS
    16-apps-kgpg.png
    22-apps-kgpg.png
    32-apps-kgpg.png
    48-apps-kgpg.png
293
294
295
    64-apps-kgpg.png
    128-apps-kgpg.png
    sc-apps-kgpg.svg
296
297
298
    DESTINATION ${KDE_INSTALL_ICONDIR}
    THEME hicolor
)
Andrius Štikonas's avatar
Andrius Štikonas committed
299

Laurent Montel's avatar
Laurent Montel committed
300
install(FILES kgpg.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Laurent Montel's avatar
Laurent Montel committed
301
302


Andrius Štikonas's avatar
Andrius Štikonas committed
303
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)