CMakeLists.txt 7.53 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
KDE4_NO_ENABLE_FINAL(messageviewer)
2 3
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}" )

Laurent Montel's avatar
Laurent Montel committed
4
include_directories(${Grantlee_INCLUDE_DIRS} ${QJSON_INCLUDE_DIR})
5

6 7
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
Laurent Montel's avatar
Laurent Montel committed
8 9


10 11 12 13
# KCFG files:
# The main messageviewer.kcfg is configured by CMake and put in the build directory.

if(KDEPIM_ENTERPRISE_BUILD)
14 15
  set(LEGACY_MANGLE_FROM_TO_HEADERS true)
  set(LEGACY_BODY_INVITES true)
16 17
  set(EXCHANGE_COMPATIBLE_INVITATIONS true)
  set(OUTLOOK_COMPATIBLE_INVITATION_REPLY_COMMENTS true)
18
else()
19 20
  set(LEGACY_MANGLE_FROM_TO_HEADERS false)
  set(LEGACY_BODY_INVITES false)
21 22
  set(EXCHANGE_COMPATIBLE_INVITATIONS false)
  set(OUTLOOK_COMPATIBLE_INVITATION_REPLY_COMMENTS false)
23
endif()
24

Laurent Montel's avatar
Laurent Montel committed
25
configure_file(settings/messageviewer.kcfg.cmake ${CMAKE_CURRENT_BINARY_DIR}/messageviewer.kcfg)
26

27 28 29 30
check_include_files(sys/inotify.h SYS_INOTIFY_H_FOUND)
macro_bool_to_01(SYS_INOTIFY_H_FOUND HAVE_SYS_INOTIFY_H)
configure_file(config-messageviewer.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-messageviewer.h)

31
add_subdirectory(about)
Laurent Montel's avatar
Laurent Montel committed
32
add_subdirectory(tests)
33
add_subdirectory(pics)
34

35 36
if(DEBUG_SIGNATURE)
   add_definitions(-DDEBUG_SIGNATURE)
37
endif()
38

39
if(KDEPIM_NO_WEBKIT)
Laurent Montel's avatar
Laurent Montel committed
40
  set(_mailwebview_cpp viewer/mailwebview_textbrowser.cpp )
41
  set(_mailwebview_lib )
42
else()
Laurent Montel's avatar
Laurent Montel committed
43 44 45 46 47 48 49 50 51 52 53
  set(_mailwebview_cpp viewer/mailwebview_webkit.cpp 
                       adblock/networkaccessmanager.cpp 
                       adblock/webpage.cpp
                       adblock/adblockelementhiding.cpp
                       adblock/adblockhostmatcher.cpp
                       adblock/adblockmanager.cpp
                       adblock/adblockrule.cpp
                       adblock/adblockrulefallbackimpl.cpp
                       adblock/adblockrulenullimpl.cpp
                       adblock/adblockruletextmatchimpl.cpp
                       adblock/adblocksettingwidget.cpp
Laurent Montel's avatar
Laurent Montel committed
54 55
                       adblock/adblockutil.cpp
                       adblock/adblockaddsubscriptiondialog.cpp
Laurent Montel's avatar
Laurent Montel committed
56
                       adblock/adblocklistwidget.cpp
57
                       adblock/adblocksyntaxhighlighter.cpp
58
                       adblock/adblockshowlistdialog.cpp
59
                       adblock/adblockblockableitemsdialog.cpp
60
                       adblock/adblockcreatefilterdialog.cpp
Laurent Montel's avatar
Laurent Montel committed
61
                       adblock/adblockblockableitemswidget.cpp
Laurent Montel's avatar
Laurent Montel committed
62
                       )
63 64
  set(_mailwebview_lib ${KDE4_KDEWEBKIT_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
  add_subdirectory(a11y)
65
endif()
66

Laurent Montel's avatar
Laurent Montel committed
67
set(libmessageviewer_viewer_SRCS
Laurent Montel's avatar
Laurent Montel committed
68
  viewer/attachmentstrategy.cpp
Laurent Montel's avatar
Laurent Montel committed
69
  viewer/bodypartformatter.cpp
Laurent Montel's avatar
Laurent Montel committed
70
  viewer/bodypartformatterfactory.cpp
Laurent Montel's avatar
Laurent Montel committed
71
  viewer/chiasmuskeyselector.cpp
Laurent Montel's avatar
Laurent Montel committed
72 73
  viewer/csshelper.cpp
  viewer/csshelperbase.cpp
Laurent Montel's avatar
Laurent Montel committed
74
  viewer/editorwatcher.cpp
Laurent Montel's avatar
Laurent Montel committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
  viewer/kleojobexecutor.cpp
  viewer/mailsourceviewer.cpp
  viewer/htmlquotecolorer.cpp
  viewer/mimetreemodel.cpp
  viewer/nodehelper.cpp
  viewer/attachmenttemporaryfilesdirs.cpp
  viewer/objecttreeemptysource.cpp
  viewer/objecttreeparser.cpp
  viewer/objecttreeviewersource.cpp
  viewer/partnodebodypart.cpp
  viewer/pluginloaderbase.cpp
  viewer/viewer.cpp
  viewer/viewer_p.cpp
  viewer/messagedisplayformatattribute.cpp
  viewer/urlhandlermanager.cpp
90
  viewer/mimeparttreeview.cpp
Laurent Montel's avatar
Laurent Montel committed
91 92 93 94
  viewer/memento/cryptobodypartmemento.cpp
  viewer/memento/decryptverifybodypartmemento.cpp
  viewer/memento/verifydetachedbodypartmemento.cpp
  viewer/memento/verifyopaquebodypartmemento.cpp
Laurent Montel's avatar
Laurent Montel committed
95 96 97
)

set(libmessageviewer_widgets_SRCS
Laurent Montel's avatar
Laurent Montel committed
98
  widgets/customheadersettingdialog.cpp
Laurent Montel's avatar
Laurent Montel committed
99
  widgets/attachmentdialog.cpp
Laurent Montel's avatar
Laurent Montel committed
100 101 102 103 104
  widgets/configurewidget.cpp
  widgets/printingsettings.cpp
  widgets/htmlstatusbar.cpp
  widgets/vcardviewer.cpp
  widgets/invitationsettings.cpp
105
  widgets/todoedit.cpp
Laurent Montel's avatar
Laurent Montel committed
106
  widgets/eventedit.cpp
107
  widgets/openattachmentfolderwidget.cpp
108
  widgets/eventdatetimewidget.cpp
Laurent Montel's avatar
Laurent Montel committed
109
)
110

Laurent Montel's avatar
Laurent Montel committed
111
set(libmessageviewer_header_SRCS
Laurent Montel's avatar
Laurent Montel committed
112
  header/contactdisplaymessagememento.cpp
Laurent Montel's avatar
Laurent Montel committed
113
  header/headerstrategy.cpp
Laurent Montel's avatar
Laurent Montel committed
114
  header/headerstrategy_p.cpp
Laurent Montel's avatar
Laurent Montel committed
115
  header/headerstyle.cpp
Laurent Montel's avatar
Laurent Montel committed
116 117 118 119 120 121 122 123
  header/briefheaderstyle.cpp
  header/grantleeheaderstyle.cpp
  header/customheaderstyle.cpp
  header/plainheaderstyle.cpp
  header/mobileheaderstyle.cpp
  header/entrepriseheaderstyle.cpp
  header/headerstyle_util.cpp
  header/fancyheaderstyle.cpp
Laurent Montel's avatar
Laurent Montel committed
124 125 126 127
  header/customheadersettingwidget.cpp
  header/grantleeheaderformatter.cpp
  header/grantleeheaderteststyle.cpp
  header/kxface.cpp
Laurent Montel's avatar
Laurent Montel committed
128 129 130
)

set(libmessageviewer_scamdetection_SRCS
131 132
  scamdetection/scamdetectionwarningwidget.cpp
  scamdetection/scamdetection.cpp
Laurent Montel's avatar
Laurent Montel committed
133
  scamdetection/scamdetectiondetailsdialog.cpp
134
  scamdetection/scamattribute.cpp
Laurent Montel's avatar
Laurent Montel committed
135
  scamdetection/scamcheckshorturl.cpp
Laurent Montel's avatar
Laurent Montel committed
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
)

set(libmessageviewer_findbar_SRCS
  findbar/findbarbase.cpp
  findbar/findbarmailwebview.cpp
  findbar/findbarsourceview.cpp
)

set(libmessageviewer_utils_SRCS
  utils/iconnamecache.cpp
  utils/markmessagereadhandler.cpp
  utils/util.cpp
)

set(libmessageviewer_htmlwriter_SRCS
  htmlwriter/filehtmlwriter.cpp
  htmlwriter/teehtmlwriter.cpp
  htmlwriter/webkitparthtmlwriter.cpp
)

set(libmessageviewer_antispam_SRCS
Laurent Montel's avatar
Laurent Montel committed
157 158
  antispam/spamheaderanalyzer.cpp
  antispam/antispamconfig.cpp
Laurent Montel's avatar
Laurent Montel committed
159 160
)

161 162
set(libmessageviewer_job_SRCS
  job/createtodojob.cpp
Laurent Montel's avatar
Laurent Montel committed
163
  job/createeventjob.cpp
164
  job/attachmentencryptwithchiasmusjob.cpp
165
  job/attachmenteditjob.cpp
Laurent Montel's avatar
Laurent Montel committed
166
  job/modifymessagedisplayformatjob.cpp
167 168
)

Laurent Montel's avatar
Laurent Montel committed
169 170 171 172 173 174 175 176 177
set(libmessageviewer_SRCS
  ${libmessageviewer_viewer_SRCS}
  ${libmessageviewer_widgets_SRCS}
  ${libmessageviewer_header_SRCS}
  ${libmessageviewer_scamdetection_SRCS}
  ${libmessageviewer_findbar_SRCS}
  ${libmessageviewer_utils_SRCS}
  ${libmessageviewer_htmlwriter_SRCS}
  ${libmessageviewer_antispam_SRCS}
178
  ${libmessageviewer_job_SRCS}
Laurent Montel's avatar
Laurent Montel committed
179
  settings/globalsettings.cpp
Tobias Koenig's avatar
cleanup  
Tobias Koenig committed
180 181
  ${_mailwebview_cpp}
)
182

183
kde4_add_kcfg_files(libmessageviewer_SRCS
Laurent Montel's avatar
Laurent Montel committed
184
  settings/globalsettings_base.kcfgc
185
)
Andras Mantia's avatar
Andras Mantia committed
186

187
kde4_add_ui_files(libmessageviewer_SRCS
Laurent Montel's avatar
Laurent Montel committed
188 189
  ui/settings.ui
  ui/invitationsettings.ui
Laurent Montel's avatar
Laurent Montel committed
190
  ui/printingsettings.ui
Laurent Montel's avatar
Laurent Montel committed
191
  adblock/ui/settings_adblock.ui
192
  adblock/ui/adblockcreatefilterwidget.ui
193 194
)

Laurent Montel's avatar
Laurent Montel committed
195

196
kde4_add_library(messageviewer ${LIBRARY_TYPE} ${libmessageviewer_SRCS})
Andras Mantia's avatar
Andras Mantia committed
197

198
target_link_libraries(messageviewer messagecore kdepim kpgp kleo
199
  ${KDEPIMLIBS_KMIME_LIBS}
Laurent Montel's avatar
Laurent Montel committed
200
  ${KDEPIMLIBS_KMBOX_LIBS}
201
  ${KDEPIMLIBS_AKONADI_LIBS}
202
  ${KDEPIMLIBS_AKONADI_KMIME_LIBS}
203 204 205 206
  ${KDEPIMLIBS_KPIMUTILS_LIBS}
  ${KDEPIMLIBS_KABC_LIBS}
  ${KDEPIMLIBS_MAILTRANSPORT_LIBS}
  ${KDE4_KDEUI_LIBS}
207
  ${KDE4_KPRINTUTILS_LIBS}
208
  ${QGPGME_LIBRARIES}
209
  ${_mailwebview_lib}
Laurent Montel's avatar
Laurent Montel committed
210
  ${Grantlee_CORE_LIBRARIES} 
211
  ${KDE4_KNEWSTUFF3_LIBS}
Laurent Montel's avatar
Laurent Montel committed
212
  ${QJSON_LIBRARIES}
213
  ${KDE4_SOLID_LIBS}
214
  pimcommon
215
  grantleetheme
216
  kaddressbookgrantlee
217
  incidenceeditorsng
218
)
219

Till Adam's avatar
Till Adam committed
220
include_directories(
221
    ${CMAKE_SOURCE_DIR}/grantleetheme
Laurent Montel's avatar
Laurent Montel committed
222
    ${CMAKE_SOURCE_DIR}/messagecore
223
    ${CMAKE_SOURCE_DIR}/pimcommon
Laurent Montel's avatar
Laurent Montel committed
224
    ${CMAKE_SOURCE_DIR}/libkdepim
225
    ${CMAKE_SOURCE_DIR}/libkleo
Laurent Montel's avatar
Laurent Montel committed
226
    ${CMAKE_SOURCE_DIR}/kaddressbookgrantlee
Till Adam's avatar
Till Adam committed
227
    ${Boost_INCLUDE_DIR}
Till Adam's avatar
Till Adam committed
228 229 230
    ${GPGME_INCLUDES}
)

231
set_target_properties( messageviewer PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
232
install(TARGETS messageviewer ${INSTALL_TARGETS_DEFAULT_ARGS} )
Andras Mantia's avatar
Andras Mantia committed
233

Laurent Montel's avatar
Laurent Montel committed
234
#install( FILES viewer/viewer.h viewer/attachmentstrategy.h header/headerstrategy.h messageviewer_export.h DESTINATION  ${INCLUDE_INSTALL_DIR}/messageviewer COMPONENT devel)
Laurent Montel's avatar
Laurent Montel committed
235 236 237


install(DIRECTORY themes DESTINATION ${DATA_INSTALL_DIR}/messageviewer )
Laurent Montel's avatar
Laurent Montel committed
238

Laurent Montel's avatar
Laurent Montel committed
239
install(FILES header/data/messageviewer_header_themes.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
Laurent Montel's avatar
Laurent Montel committed
240

Laurent Montel's avatar
Laurent Montel committed
241
add_subdirectory(grantleefilters)
242
add_subdirectory(scamdetection/tests)
Laurent Montel's avatar
Laurent Montel committed
243
add_subdirectory(adblock/tests/)
244
add_subdirectory(findbar/tests)
Laurent Montel's avatar
Laurent Montel committed
245
install(FILES notify/messageviewer.notifyrc DESTINATION ${DATA_INSTALL_DIR}/messageviewer )
Laurent Montel's avatar
Laurent Montel committed
246
install(FILES scamdetection/data/longurlServices.json DESTINATION ${DATA_INSTALL_DIR}/messageviewer )