CMakeLists.txt 6.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

# target_include_directories does not handle empty include paths
include_directories(${GPGME_INCLUDES})

add_definitions(-DTRANSLATION_DOMAIN=\"libkleopatra\")

#add_definitions( -DQT_NO_CAST_FROM_ASCII )
#add_definitions( -DQT_NO_CAST_TO_ASCII )

kde_enable_exceptions()

add_definitions( -DGPGMEPP_ERR_SOURCE_DEFAULT=13 ) # 13 is GPG_ERR_SOURCE_KLEO, even if gpg-error's too old to know about

add_subdirectory( pics )
if (BUILD_TESTING)
   add_subdirectory( tests )
endif()

########### next target ###############
set(libkleo_core_SRCS
   kleo/checksumdefinition.cpp
22
   kleo/debug.cpp
23
24
25
   kleo/defaultkeyfilter.cpp
   kleo/defaultkeygenerationjob.cpp
   kleo/dn.cpp
26
27
28
   kleo/enum.cpp
   kleo/kconfigbasedkeyfilter.cpp
   kleo/keyfiltermanager.cpp
29
   kleo/keygroup.cpp
30
   kleo/keyresolver.cpp
31
   kleo/keyresolvercore.cpp
32
   kleo/kleoexception.cpp
Ingo Klöcker's avatar
Ingo Klöcker committed
33
   kleo/oidmap.cpp
34
35
   models/keycache.cpp
   models/keylistmodel.cpp
36
   models/keylistmodelinterface.cpp
37
38
39
40
41
42
   models/keylistsortfilterproxymodel.cpp
   models/keyrearrangecolumnsproxymodel.cpp
   models/subkeylistmodel.cpp
   models/useridlistmodel.cpp
   utils/filesystemwatcher.cpp
   utils/formatting.cpp
43
   utils/classify.cpp
44
   utils/gnupg.cpp
45
   utils/gnupg-registry.c
46
   utils/hex.cpp
47
   utils/compat.cpp
48
   )
49
ecm_qt_declare_logging_category(libkleo_core_SRCS HEADER libkleo_debug.h IDENTIFIER LIBKLEO_LOG CATEGORY_NAME org.kde.pim.libkleo
Laurent Montel's avatar
Laurent Montel committed
50
51
52
53
        DESCRIPTION "libkleo (kleo_core)"
        EXPORT LIBKLEO
    )

54
55
56
57
58
59
60
61
62
63
64
65
66

set(libkleo_ui_common_SRCS
   ui/dnattributeorderconfigwidget.cpp
   ui/kdhorizontalline.cpp
   ui/filenamerequester.cpp
   ui/messagebox.cpp
   ui/cryptoconfigmodule.cpp
   ui/cryptoconfigdialog.cpp
   ui/directoryserviceswidget.cpp
   ui/progressbar.cpp
   ui/progressdialog.cpp
   ui/auditlogviewer.cpp
   )
Laurent Montel's avatar
Laurent Montel committed
67

68
ecm_qt_declare_logging_category(libkleo_ui_common_SRCS HEADER kleo_ui_debug.h IDENTIFIER KLEO_UI_LOG CATEGORY_NAME org.kde.pim.kleo_ui
Laurent Montel's avatar
Laurent Montel committed
69
70
71
72
73
        DESCRIPTION "libkleo (kleo_ui)"
        OLD_CATEGORY_NAMES log_kleo_ui
        EXPORT LIBKLEO
    )

74
75
76
77
78
79

set(libkleo_ui_SRCS    # make this a separate lib.
    ui/keylistview.cpp
    ui/keyselectiondialog.cpp
    ui/keyrequester.cpp
    ui/keyapprovaldialog.cpp
80
    ui/newkeyapprovaldialog.cpp
81
    ui/keyselectioncombo.cpp
82
83
84
85
86
87
    )

ki18n_wrap_ui(libkleo_ui_common_SRCS
    ui/directoryserviceswidget.ui
)

88
89
90
set(kleo_LIB_SRCS ${libkleo_core_SRCS} ${libkleo_ui_SRCS}
                                       ${libkleo_ui_common_SRCS})

91
set(kleo_LIB_LIBS PUBLIC QGpgme Gpgmepp PRIVATE Qt5::Widgets
92
93
94
95
                                                KF5::I18n
                                                KF5::Completion
                                                KF5::ConfigCore
                                                KF5::CoreAddons
96
97
98
                                                KF5::WidgetsAddons
                                                KF5::ItemModels
                                                KF5::Codecs)
99

100
101
if (KF5PimTextEdit_FOUND)
  add_definitions(-DHAVE_PIMTEXTEDIT)
102
  set(kleo_LIB_LIBS ${kleo_LIB_LIBS} PRIVATE KF5::PimTextEdit)
103
104
endif()

105
add_library(KF5Libkleo ${kleo_LIB_SRCS})
Laurent Montel's avatar
Laurent Montel committed
106
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
107
108
    set_target_properties(KF5Libkleo PROPERTIES UNITY_BUILD ON)
endif()
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
generate_export_header(KF5Libkleo BASE_NAME kleo)
add_library(KF5::Libkleo ALIAS KF5Libkleo)
if(WIN32)
target_link_libraries(KF5Libkleo ${kleo_LIB_LIBS}  ${GPGME_VANILLA_LIBRARIES} )
else()
target_link_libraries(KF5Libkleo ${kleo_LIB_LIBS} )
endif()

set_target_properties(KF5Libkleo PROPERTIES
    VERSION ${LIBKLEO_VERSION_STRING}
    SOVERSION ${LIBKLEO_SOVERSION}
    EXPORT_NAME Libkleo
)

install(TARGETS
    KF5Libkleo
125
    EXPORT KF5LibkleoTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
126
127
128
129
)



130
target_include_directories(KF5Libkleo PUBLIC "$<BUILD_INTERFACE:${libkleo_SOURCE_DIR}/src;${libkleo_BINARY_DIR}/src>")
131
132
133
134
target_include_directories(KF5Libkleo INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/Libkleo/;${KDE_INSTALL_INCLUDEDIR_KF5}/libkleo>")

ecm_generate_headers(libkleo_CamelCase_HEADERS
  HEADER_NAMES
135
  ChecksumDefinition
136
  Debug
137
138
  DefaultKeyFilter
  DefaultKeyGenerationJob
139
  Dn
140
141
  Enum
  KConfigBasedKeyFilter
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
142
143
  KeyFilter
  KeyFilterManager
144
  KeyGroup
145
  KeyResolver
146
  KeyResolverCore
147
  KleoException
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
148
  OidMap
149
  Predicates
150
  Stl_Util
151
152
153
154
155
  REQUIRED_HEADERS libkleo_HEADERS
  PREFIX Libkleo
  RELATIVE kleo
)

156
157
158
ecm_generate_headers(libkleo_CamelCase_models_HEADERS
  HEADER_NAMES
  KeyCache
159
  KeyList
160
161
162
163
164
165
166
167
168
169
170
171
172
  KeyListModel
  KeyListModelInterface
  KeyListSortFilterProxyModel
  KeyRearrangeColumnsProxyModel
  SubkeyListModel
  UserIDListModel
  REQUIRED_HEADERS libkleo_models_HEADERS
  PREFIX Libkleo
  RELATIVE models
)

ecm_generate_headers(libkleo_CamelCase_utils_HEADERS
  HEADER_NAMES
173
  Algorithm
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
174
  Classify
175
176
  FileSystemWatcher
  Formatting
177
  GnuPG
178
  Compat
179
180
181
182
183
184
  REQUIRED_HEADERS libkleo_utils_HEADERS
  PREFIX Libkleo
  RELATIVE utils
)

ecm_generate_headers(libkleo_CamelCase_ui_HEADERS
185
186
187
188
  HEADER_NAMES
  CryptoConfigDialog
  CryptoConfigModule
  DNAttributeOrderConfigWidget
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
189
190
191
192
  DirectoryServicesWidget
  FileNameRequester
  KDHorizontalLine
  KeyApprovalDialog
193
  NewKeyApprovalDialog
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
194
195
196
197
198
  KeyRequester
  KeySelectionCombo
  KeySelectionDialog
  MessageBox
  ProgressDialog
199
  REQUIRED_HEADERS libkleo_ui_HEADERS
200
201
202
203
204
205
206
207
208
209
210
211
  PREFIX Libkleo
  RELATIVE ui
)

ecm_generate_pri_file(BASE_NAME Libkleo
    LIB_NAME KF5Libkleo
    DEPS "QGpgme" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkleo
)


install(FILES
    ${libkleo_CamelCase_HEADERS}
212
213
    ${libkleo_CamelCase_models_HEADERS}
    ${libkleo_CamelCase_ui_HEADERS}
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
214
    ${libkleo_CamelCase_utils_HEADERS}
215
216
217
218
219
220
221
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkleo
    COMPONENT Devel
)

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/kleo_export.h
    ${libkleo_HEADERS}
222
223
    ${libkleo_models_HEADERS}
    ${libkleo_ui_HEADERS}
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
224
    ${libkleo_utils_HEADERS}
225
226
227
228
229
230
231
232
233
234
235
236
237
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libkleo
    COMPONENT Devel
)
install(FILES
    ${PRI_FILENAME}
    DESTINATION ${ECM_MKSPECS_INSTALL_DIR})


if ( WIN32 )
install ( FILES libkleopatrarc-win32.desktop DESTINATION ${KDE_INSTALL_CONFDIR} RENAME libkleopatrarc )
else ()
install ( FILES libkleopatrarc.desktop DESTINATION ${KDE_INSTALL_CONFDIR} RENAME libkleopatrarc )
endif ()