backport 1145339: no error box spam
[kdepim.git] / kmail / CMakeLists.txt
blobee2fbd1204bc412b5504eea7310276e6323518cc
1 project(kmail)
3 include(CheckIncludeFiles)
5 add_definitions(-DQT3_SUPPORT_WARNINGS)
6 add_definitions(-DDISABLE_NEPOMUK_LEGACY)
8 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${KDE4_DATA_DIR}/cmake/modules)
10 qt4_generate_dbus_interface(kmkernel.h org.kde.kmail.kmail.xml OPTIONS -a)
12 add_custom_target(kmail_xml ALL
13   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kmail.kmail.xml
14   COMMENT "Helper target for XML stuff. The Kontact plugin, KOrganizer and others depend on it."
17 include_directories(
18   ${CMAKE_SOURCE_DIR}/libkdepim
19   ${CMAKE_BINARY_DIR}/libkdepim
20   ${CMAKE_SOURCE_DIR}/libksieve
21   ${CMAKE_SOURCE_DIR}/libkleo
22   ${CMAKE_SOURCE_DIR}/messagelist
23   ${CMAKE_SOURCE_DIR}/messageviewer
24   ${CMAKE_SOURCE_DIR}/templateparser
25   ${CMAKE_BINARY_DIR}/templateparser
26   ${CMAKE_SOURCE_DIR}/messagecomposer
27   ${CMAKE_BINARY_DIR}/messagecomposer
28   ${CMAKE_SOURCE_DIR}/messagecore
29   ${CMAKE_SOURCE_DIR}/korganizer
30   ${GPGME_INCLUDES}
31   ${Boost_INCLUDE_DIR}
32   ${CMAKE_SOURCE_DIR}/akonadi/
33   ${CMAKE_CURRENT_BINARY_DIR}/../ontologies
34   ${NEPOMUK_INCLUDES}
35   ${SOPRANO_INCLUDE_DIR}
36  )
38 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
41 if (QT_QT3SUPPORT_FOUND)
42 add_subdirectory(about)
43 add_subdirectory(pics)
44 add_subdirectory(icons)
45 add_subdirectory(avscripts)
46 add_subdirectory(tests)
47 add_subdirectory(kconf_update)
48 endif (QT_QT3SUPPORT_FOUND)
49 add_subdirectory(kcm_kpimidentities)
51 ########### kmailprivate ###############
53 if (QT_QT3SUPPORT_FOUND)
54 set(kmailprivate_LIB_SRCS
55    foldercollectionmonitor.cpp
56    readablecollectionproxymodel.cpp
57    entitycollectionorderproxymodel.cpp
58    collectionpane.cpp
59    foldertreewidget.cpp
60    folderselectiondialog.cpp
61    foldercollection.cpp
62    foldertreeview.cpp
63    collectionannotationsattribute.cpp
64    collectiontemplatespage.cpp
65    collectionmaintenancepage.cpp
66    collectiongeneralpage.cpp
67    collectionviewpage.cpp
68    collectionquotapage.cpp
69    collectionquotapage_p.cpp
70    collectionaclpage.cpp
71    colorlistbox.cpp
72    imapaclattribute.cpp
73    kmmainwin.cpp
74    configagentdelegate.cpp
75    configuredialoglistview.cpp
76    configuredialog.cpp
77    configuredialog_p.cpp
78    simplestringlisteditor.cpp
79    identitylistview.cpp
80    identitydialog.cpp
81    globalsettings.cpp
82    snippetdlg.cpp
83    snippetwidget.cpp
84    snippetitem.cpp
85    kmreaderwin.cpp
86    messageproperty.cpp
87    kmsystemtray.cpp
88    kmfiltermgr.cpp
89    filterimporterexporter.cpp
90    kmsearchpatternedit.cpp
91    kmfilteraction.cpp
92    kmsearchpattern.cpp
93    kmfilter.cpp
94    kmfilterdlg.cpp
95    xfaceconfigurator.cpp
96    undostack.cpp
97    kmkernel.cpp
98    searchwindow.cpp
99    vacationdialog.cpp
100    vacation.cpp
101    sievedebugdialog.cpp
102    sievejob.cpp
103    kmcommands.cpp
104    kmreadermainwin.cpp
105    kmstartup.cpp
106    kmmainwidget.cpp
107    folderjob.cpp
108    aboutdata.cpp
109    mailserviceimpl.cpp
110    kmcomposereditor.cpp
111    composer.cpp
112    antispamwizard.cpp
113    secondarywindow.cpp
114    filterlog.cpp
115    filterlogdlg.cpp
116    codecaction.cpp
117    codecmanager.cpp
118    regexplineedit.cpp
119    rulewidgethandlermanager.cpp
120    expirejob.cpp
121    jobscheduler.cpp
122    redirectdialog.cpp
123    foldershortcutdialog.cpp
124    folderrequester.cpp
125    expirypropertiesdialog.cpp
126    mailinglistpropertiesdialog.cpp
127    managesievescriptsdialog.cpp
128    util.cpp
129    korghelper.cpp
130    messageactions.cpp
131    statusbarlabel.cpp
132    kmcomposewin.cpp
133    attachmentcontroller.cpp
134    attachmentview.cpp
135    backupjob.cpp
136    archivefolderdialog.cpp
137    searchdescriptionattribute.cpp
138    tag.cpp
139    tagactionmanager.cpp
140    foldershortcutactionmanager.cpp
141    mdnadvicedialog.cpp
142    kmsoundtestwidget.cpp
143    addressvalidationjob.cpp
144    identitypage.cpp
145    newidentitydialog.cpp
148 soprano_add_ontology(kmailprivate_LIB_SRCS
149   ${CMAKE_SOURCE_DIR}/messagecore/messagetag.trig
150   "MessageTag"
151   "Vocabulary"
152   "trig"
155 macro(add_resource_iface _kcfgFile _ifaceName _className)
156   kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/${_kcfgFile} ${_ifaceName})
157   string(TOLOWER ${_className} _codeFile)
158   set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/${_ifaceName}.xml PROPERTIES INCLUDE "metatype.h")
159   qt4_add_dbus_interface(kmailprivate_LIB_SRCS
160     ${CMAKE_CURRENT_BINARY_DIR}/${_ifaceName}.xml ${_codeFile} ${_className}
161   )
162 endmacro(add_resource_iface)
164 add_resource_iface( imapresource.kcfg org.kde.Akonadi.Imap.Settings ImapSettings )
165 # Pop3
166 add_resource_iface( settings.kcfg org.kde.Akonadi.POP3.Settings Pop3Settings )
169 # TODO PORT
170 # qt4_generate_dbus_interface(kmcomposewin.h org.kde.kmail.mailcomposer.xml OPTIONS -a)
171 # qt4_add_dbus_adaptor(kmailprivate_LIB_SRCS
172 #   ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.mailcomposer.xml kmcomposewin.h KMComposeWin
173 # )
175 qt4_add_dbus_adaptor(kmailprivate_LIB_SRCS
176   ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml kmkernel.h KMKernel
178 qt4_add_dbus_adaptor(kmailprivate_LIB_SRCS
179   ${CMAKE_SOURCE_DIR}/libkdepim/interfaces/org.kde.mailtransport.service.xml mailserviceimpl.h
180   KMail::MailServiceImpl
183 qt4_add_dbus_interfaces(kmailprivate_LIB_SRCS
184   ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml
185   ${CMAKE_SOURCE_DIR}/korganizer/org.kde.Korganizer.Calendar.xml
188 kde4_add_ui_files(kmailprivate_LIB_SRCS
189   ui/composercryptoconfiguration.ui
190   ui/warningconfiguration.ui
191   ui/smimeconfiguration.ui
192   ui/snippetdlgbase.ui
193   ui/miscpagemaintab.ui
194   ui/securitypagegeneraltab.ui
195   ui/identitypage.ui
196   ui/accountspagereceivingtab.ui
199 # KCFG files. The main kmail.kcfg is configured by CMake and put
200 # in the build directory.
202 if(KDEPIM_ENTERPRISE_BUILD)
203   set(WARN_TOOMANY_RECIPIENTS_DEFAULT true)
204   set(DELETE_INVITATIONS_AFTER_REPLY_DEFAULT true)
205   set(ALLOW_SEMICOLON_AS_ADDRESS_SEPARATOR_DEFAULT true)
206 else(KDEPIM_ENTERPRISE_BUILD)
207   set(WARN_TOOMANY_RECIPIENTS_DEFAULT false)
208   set(DELETE_INVITATIONS_AFTER_REPLY_DEFAULT false)
209   set(ALLOW_SEMICOLON_AS_ADDRESS_SEPARATOR_DEFAULT false)
210 endif(KDEPIM_ENTERPRISE_BUILD)
212 configure_file(kmail.kcfg.cmake ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg)
214 kde4_add_kcfg_files(kmailprivate_LIB_SRCS
215   globalsettings_base.kcfgc
216   custommimeheader.kcfgc
220 kde4_add_library(kmailprivate SHARED ${kmailprivate_LIB_SRCS})
221 target_link_libraries(kmailprivate
222   ${KDEPIMLIBS_KMIME_LIBRARY}
223   ${KDEPIMLIBS_AKONADI_LIBS}
224   ${KDEPIMLIBS_AKONADI_KMIME_LIBS}
225   messagecore
226   messagecomposer
227   messagelist
228   templateparser
229   ${KDEPIMLIBS_KPIMIDENTITIES_LIBRARY}
230   ${KDEPIMLIBS_KONTACTINTERFACE_LIBS}
231   ${KDE4_PHONON_LIBRARY}
232   ${KDE4_KNOTIFYCONFIG_LIBRARY}
233   ${KDEPIMLIBS_KTNEF_LIBRARY}
234   ${KDEPIMLIBS_MAILTRANSPORT_LIBRARY}
235   ${KDEPIMLIBS_KIMAP_LIBRARY}
236   ${KDE4_KPARTS_LIBRARY}
237   ${KDE4_KRESOURCES_LIBRARY}
238   ${KDE4_KCMUTILS_LIBS}
239   kleo
240   ${QGPGME_LIBRARIES}
241   ksieve
242   kpgp
243   kdepim
244   ${KDE4_KIO_LIBS}
245   ${KDEPIMLIBS_KABC_LIBS}
246   ${KDEPIMLIBS_KPIMUTILS_LIBS}
247   ${KDEPIMLIBS_KPIMTEXTEDIT_LIBS}
248   messageviewer
249   akonadi_next
250   ${SOPRANO_LIBRARIES}
251   niefast_apps
252   ${QT_QTWEBKIT_LIBRARY}
253   ${NEPOMUK_LIBRARIES}
254   ${NEPOMUK_QUERY_LIBRARIES}
257 set_target_properties(kmailprivate
258   PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}
261 ########### kcm_kmail ###############
263 set(kcm_kmail_PART_SRCS kcm_kmail.cpp )
264 kde4_add_plugin(kcm_kmail ${kcm_kmail_PART_SRCS})
265 target_link_libraries(kcm_kmail ${KDE4_KDEUI_LIBS} kmailprivate )
267 ########### kmailpart ###############
269 set(kmailpart_PART_SRCS kmail_part.cpp )
270 qt4_generate_dbus_interface(kmail_part.h org.kde.kmail.kmailpart.xml OPTIONS -a)
271 qt4_add_dbus_adaptor(kmailpart_PART_SRCS
272   ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmailpart.xml kmail_part.h KMailPart
274 qt4_add_dbus_interfaces(kmailpart_PART_SRCS ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmailpart.xml)
275 kde4_add_plugin(kmailpart ${kmailpart_PART_SRCS})
276 target_link_libraries(kmailpart
277   ${KDE4_KDECORE_LIBS}
278   ${KDEPIMLIBS_AKONADI_LIBS}
279   kmailprivate
280   ${KDE4_KPARTS_LIBS}
281   ${KDE4_KCMUTILS_LIBS}
284 ########### KMail executable ###############
286 set(kmail_SRCS main.cpp)
287 kde4_add_app_icon(kmail_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/hi*-apps-kmail.png")
288 kde4_add_executable(kmail ${kmail_SRCS})
289 target_link_libraries(kmail
290   ${KDE4_KDEUI_LIBS}
291   ${KDE4_KDECORE_LIBS}
292   ${KDEPIMLIBS_AKONADI_KCAL_LIBS}
293   ${KDEPIMLIBS_KONTACTINTERFACE_LIBS}
294   kmailprivate
295   kdepim
298 ########### install files ###############
300 install(TARGETS kmailprivate ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
301 install(TARGETS kmail ${INSTALL_TARGETS_DEFAULT_ARGS})
302 install(FILES KMail.desktop kmail_view.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
303 install(FILES
304   ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg
305   custommimeheader.kcfg
306   DESTINATION ${KCFG_INSTALL_DIR}
308 install(FILES kmail.antispamrc kmail.antivirusrc  DESTINATION ${CONFIG_INSTALL_DIR})
309 install(FILES tips  DESTINATION ${DATA_INSTALL_DIR}/kmail2)
310 install(FILES
311   kmail_config_misc.desktop
312   kmail_config_appearance.desktop
313   kmail_config_identity.desktop
314   kmail_config_accounts.desktop
315   kmail_config_composer.desktop
316   kmail_config_security.desktop
317   DESTINATION ${SERVICES_INSTALL_DIR}
319 install(FILES
320   kmcomposerui.rc
321   kmmainwin.rc
322   kmreadermainwin.rc
323   kmail2.notifyrc
324   kmail_part.rc
325   DESTINATION ${DATA_INSTALL_DIR}/kmail2
327 install(FILES dbusmail.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
328 install(TARGETS
329   kmailpart
330   kcm_kmail
331   DESTINATION ${PLUGIN_INSTALL_DIR}
333 install(FILES
334   ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmailpart.xml
335   ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml
336   DESTINATION ${DBUS_INTERFACES_INSTALL_DIR}
339 endif (QT_QT3SUPPORT_FOUND)