CMakeLists.txt 6.06 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/kleoexception.cpp
Ingo Klöcker's avatar
Ingo Klöcker committed
32
   kleo/oidmap.cpp
33
34
   models/keycache.cpp
   models/keylistmodel.cpp
35
   models/keylistmodelinterface.cpp
36
37
38
39
40
41
   models/keylistsortfilterproxymodel.cpp
   models/keyrearrangecolumnsproxymodel.cpp
   models/subkeylistmodel.cpp
   models/useridlistmodel.cpp
   utils/filesystemwatcher.cpp
   utils/formatting.cpp
42
   utils/classify.cpp
43
   utils/gnupg.cpp
44
   utils/gnupg-registry.c
45
   utils/hex.cpp
46
   utils/compat.cpp
47
   )
48
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
49
50
51
52
        DESCRIPTION "libkleo (kleo_core)"
        EXPORT LIBKLEO
    )

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

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
66

67
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
68
69
70
71
72
        DESCRIPTION "libkleo (kleo_ui)"
        OLD_CATEGORY_NAMES log_kleo_ui
        EXPORT LIBKLEO
    )

73
74
75
76
77
78

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

ki18n_wrap_ui(libkleo_ui_common_SRCS
    ui/directoryserviceswidget.ui
)

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

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

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

104
add_library(KF5Libkleo ${kleo_LIB_SRCS})
Laurent Montel's avatar
Laurent Montel committed
105
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
106
107
    set_target_properties(KF5Libkleo PROPERTIES UNITY_BUILD ON)
endif()
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
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
124
    EXPORT KF5LibkleoTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
125
126
127
128
)



129
target_include_directories(KF5Libkleo PUBLIC "$<BUILD_INTERFACE:${libkleo_SOURCE_DIR}/src;${libkleo_BINARY_DIR}/src>")
130
131
132
133
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
134
  ChecksumDefinition
135
  Debug
136
137
  DefaultKeyFilter
  DefaultKeyGenerationJob
138
  Dn
139
140
  Enum
  KConfigBasedKeyFilter
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
141
142
  KeyFilter
  KeyFilterManager
143
  KeyGroup
144
  KeyResolver
145
  KleoException
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
146
  OidMap
147
  Predicates
148
  Stl_Util
149
150
151
152
153
  REQUIRED_HEADERS libkleo_HEADERS
  PREFIX Libkleo
  RELATIVE kleo
)

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

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

ecm_generate_headers(libkleo_CamelCase_ui_HEADERS
182
183
184
185
  HEADER_NAMES
  CryptoConfigDialog
  CryptoConfigModule
  DNAttributeOrderConfigWidget
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
186
187
188
189
  DirectoryServicesWidget
  FileNameRequester
  KDHorizontalLine
  KeyApprovalDialog
190
  NewKeyApprovalDialog
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
191
192
193
194
195
  KeyRequester
  KeySelectionCombo
  KeySelectionDialog
  MessageBox
  ProgressDialog
196
  REQUIRED_HEADERS libkleo_ui_HEADERS
197
198
199
200
201
202
203
204
205
206
207
208
  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}
209
210
    ${libkleo_CamelCase_models_HEADERS}
    ${libkleo_CamelCase_ui_HEADERS}
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
211
    ${libkleo_CamelCase_utils_HEADERS}
212
213
214
215
216
217
218
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkleo
    COMPONENT Devel
)

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/kleo_export.h
    ${libkleo_HEADERS}
219
220
    ${libkleo_models_HEADERS}
    ${libkleo_ui_HEADERS}
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
221
    ${libkleo_utils_HEADERS}
222
223
224
225
226
227
228
229
230
231
232
233
234
    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 ()