Do not quit application on last closed window when running in systray
[trojita.git] / CMakeLists.txt
blobf1a07ade0c8c6cb6b80cf7a2d18329f44265b28e
1 if(WITH_QT5)
2     # The Qt5's qt5_use_modules is only available on 2.8.9 or later -- sweet, isn't it?
3     cmake_minimum_required(VERSION 2.8.9)
4 else()
5     cmake_minimum_required(VERSION 2.8.7)
6 endif()
7 project(trojita)
8 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
10 include(FindCXXFeatures)
11 if(NOT CXXFeatures_auto_FOUND)
12     message(SEND_ERROR "Your compiler doesn't support C++11's auto")
13 endif()
14 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_COMPILER_FLAGS}")
16 if(HARMATTAN)
17     set(BUILD_DESKTOP_GUI false)
18     set(BUILD_HARMATTAN true)
19     set(WITHOUT_TESTS true)
20     message(STATUS "Building version for MeeGo Harmattan")
21 else()
22     set(BUILD_DESKTOP_GUI true)
23     set(BUILD_HARMATTAN false)
24     message(STATUS "Building the desktop version")
25 endif()
27 if(WITH_QT5)
28     message(STATUS "Building the Qt5 version")
29     find_package(Qt5Gui REQUIRED)
30     find_package(Qt5Network REQUIRED)
31     find_package(Qt5Sql REQUIRED)
32     find_package(Qt5WebKitWidgets REQUIRED)
33     find_package(Qt5Widgets REQUIRED)
34     find_package(Qt5LinguistTools)
35     if(NOT WITHOUT_TESTS)
36         find_package(Qt5Test REQUIRED)
37     endif()
38     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
39     if(Qt5LinguistTools_FOUND)
40         find_package(Qt5LinguistForTrojita)
41     endif()
42 else()
43     message(STATUS "Building the Qt4 version")
44     set(QT_USE_QTNETWORK 1)
45     set(QT_USE_QTSQL 1)
46     set(QT_USE_QTWEBKIT 1)
47     if(NOT WITHOUT_TESTS)
48         set(QT_USE_QTTEST 1)
49     endif()
50     if(BUILD_HARMATTAN)
51         set(QT_USE_QTDECLARATIVE 1)
52     endif()
53     find_package(Qt4 4.6 REQUIRED)
54     include(${QT_USE_FILE})
55     add_definitions(${QT_DEFINITIONS})
56     find_package(LinguistForTrojita)
57 endif()
58 find_package(Git)
60 if(WIN32 AND WITH_NSIS)
61     if(NOT MAKENSIS)
62         find_program(MAKENSIS makensis)
63         if(NOT MAKENSIS)
64             message(STATUS "makensis not found")
65         else()
66             message(STATUS "Found makensis: ${MAKENSIS}")
67         endif()
68         mark_as_advanced(MAKENSIS)
69     endif()
70 endif()
72 # Add support for Mingw RC compiler
73 if(WIN32)
74     enable_language(RC)
75     include(CMakeDetermineRCCompiler)
77     if(MINGW)
78         set(CMAKE_RC_COMPILER_INIT windres)
79         set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
80     endif()
81 endif()
83 if(NOT WIN32 AND NOT MSVC)
84     # Check if we are NOT on Windows and don't use MSVC since -g is not supported by VC
85     # and Wall makes the build very noisy.
86     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g")
87     #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual")
88 endif(NOT WIN32 AND NOT MSVC)
90 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
91 # The following is required so that the moc_*.cpp and ui_*.h are found
92 include_directories(${CMAKE_CURRENT_BINARY_DIR})
93 add_definitions(-DQT_STRICT_ITERATORS)
95 if(NOT WITH_QT5 AND CMAKE_VERSION VERSION_LESS 2.8.10)
96     set(SUPPORTS_TARGET_INCLUDES 0)
97     include_directories(
98         ${QT_MKSPECS_DIR}/default
99         ${CMAKE_CURRENT_SOURCE_DIR}/src/Gui/
100         ${CMAKE_CURRENT_SOURCE_DIR}/src/mimetypes-qt4/io/
101         ${CMAKE_CURRENT_SOURCE_DIR}/src/Harmattan/qmlapplicationviewer
102         ${CMAKE_CURRENT_SOURCE_DIR}/tests
103         ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_LibMailboxSync)
104 else()
105     set(SUPPORTS_TARGET_INCLUDES 1)
106 endif()
108 set(CMAKE_AUTOMOC True)
110 if(WITH_RAGEL)
111     find_package(RagelForTrojita)
112 endif()
114 if(NOT WITHOUT_ZLIB)
116     if(NOT WIN32) # Check if we are NOT on Windows
117         find_package(ZLIB)
118     else(NOT WIN32)
119         # On win32, qt can statically link to zlib and export their symbols.
120         # We check if we can find the string " zlib " in the QT_CONFIG list in
121         # ${QT_MKSPECS_DIR}/qconfig.pri and include on success ${QT_QTCORE_LIBRARY}
122         # and ${QTDIR}/src/3rdparty/zlib as lib and include folder
123         if(QT_QTCORE_FOUND)
124             message(STATUS "We are on Windows with Qt. Checking if zlib is built into Qt")
126             if(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
127                 file(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents_ZLIB_CHECK)
128                 string(REGEX MATCH "QT_CONFIG[^\n]+" QT_CONFIG_ZLIB_CHECK ${_qconfig_FILE_contents_ZLIB_CHECK})
130                 set(ENV_QTDIR $ENV{QTDIR})
131                 if(NOT DEFINED ENV_QTDIR)
132                     message(STATUS "QTDIR not specified in environment, will not use zlib")
133                 elseif(QT_CONFIG_ZLIB_CHECK)
134                     if(QT_CONFIG_ZLIB_CHECK MATCHES " zlib ")
135                         message(STATUS "Found zlib in QT_QCONFIG. zlib seems to be built into Qt")
136                         set(ZLIB_LIBRARY_RELEASE ${QT_QTCORE_LIBRARY_RELEASE})
137                         set(ZLIB_LIBRARY_DEBUG ${QT_QTCORE_LIBRARY_DEBUG})
138                         set(ZLIB_LIBRARY ${QT_QTCORE_LIBRARY})
140                         string(REGEX REPLACE "\\\\" "/" QTDIR ${ENV_QTDIR})
141                         set(ZLIB_INCLUDE_DIR "${QTDIR}/src/3rdparty/zlib")
143                         set(ZLIB_FOUND TRUE)
144                         set(ZLIB_LIBRARIES ${ZLIB_LIBRARY} )
145                         mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR ZLIB_FOUND)
146                     else(QT_CONFIG_ZLIB_CHECK MATCHES " zlib ")
147                         message(STATUS "Could not determine if Qt was built with zlib support.")
148                     endif(QT_CONFIG_ZLIB_CHECK MATCHES " zlib ")
150                 endif()
151             endif(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
152         endif(QT_QTCORE_FOUND)
153     endif(NOT WIN32)
154 endif()
156 if(ZLIB_FOUND)
157     set(TROJITA_HAVE_ZLIB True)
158     message(STATUS "Support for COMPRESS=DEFLATE enabled")
159 else()
160     set(TROJITA_HAVE_ZLIB False)
161     message(STATUS "Disabling COMPRESS=DEFLATE, zlib is not available")
162 endif()
164 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/configure.cmake.in
165     ${CMAKE_CURRENT_BINARY_DIR}/configure.cmake.h)
167 set(path_Common ${CMAKE_CURRENT_SOURCE_DIR}/src/Common)
168 set(libCommon_HEADERS
169     ${path_Common}/Application.h
170     ${path_Common}/ConnectionId.h
171     ${path_Common}/DeleteAfter.h
172     ${path_Common}/FileLogger.h
173     ${path_Common}/Paths.h
174     ${path_Common}/SettingsNames.h
176 set(libCommon_SOURCES
177     ${path_Common}/Application.cpp
178     ${path_Common}/ConnectionId.cpp
179     ${path_Common}/DeleteAfter.cpp
180     ${path_Common}/FileLogger.cpp
181     ${path_Common}/Paths.cpp
182     ${path_Common}/SettingsNames.cpp
185 set(path_Composer ${CMAKE_CURRENT_SOURCE_DIR}/src/Composer)
186 set(libComposer_HEADERS
187     ${path_Composer}/ComposerAttachments.h
188     ${path_Composer}/MessageComposer.h
189     ${path_Composer}/PlainTextFormatter.h
190     ${path_Composer}/Recipients.h
191     ${path_Composer}/ReplaceSignature.h
192     ${path_Composer}/SenderIdentitiesModel.h
193     ${path_Composer}/SubjectMangling.h
194     ${path_Composer}/Submission.h
196 set(libComposer_SOURCES
197     ${path_Composer}/ComposerAttachments.cpp
198     ${path_Composer}/MessageComposer.cpp
199     ${path_Composer}/PlainTextFormatter.cpp
200     ${path_Composer}/Recipients.cpp
201     ${path_Composer}/ReplaceSignature.cpp
202     ${path_Composer}/SenderIdentitiesModel.cpp
203     ${path_Composer}/SubjectMangling.cpp
204     ${path_Composer}/Submission.cpp
207 set(path_MSA ${CMAKE_CURRENT_SOURCE_DIR}/src/MSA)
208 set(libMSA_HEADERS
209     ${path_MSA}/AbstractMSA.h
210     ${path_MSA}/FakeMSA.h
211     ${path_MSA}/ImapSubmit.h
212     ${path_MSA}/SMTP.h
213     ${path_MSA}/Sendmail.h
215 set(libMSA_SOURCES
216     ${path_MSA}/AbstractMSA.cpp
217     ${path_MSA}/FakeMSA.cpp
218     ${path_MSA}/ImapSubmit.cpp
219     ${path_MSA}/SMTP.cpp
220     ${path_MSA}/Sendmail.cpp
223 set(path_Streams ${CMAKE_CURRENT_SOURCE_DIR}/src/Streams)
224 set(libStreams_HEADERS
225     ${path_Streams}/DeletionWatcher.h
226     ${path_Streams}/FakeSocket.h
227     ${path_Streams}/IODeviceSocket.h
228     ${path_Streams}/Socket.h
229     ${path_Streams}/SocketFactory.h
231 set(libStreams_SOURCES
232     ${path_Streams}/DeletionWatcher.cpp
233     ${path_Streams}/FakeSocket.cpp
234     ${path_Streams}/IODeviceSocket.cpp
235     ${path_Streams}/Socket.cpp
236     ${path_Streams}/SocketFactory.cpp
239 if(ZLIB_FOUND)
240     set(libStreams_SOURCES ${libStreams_SOURCES}
241         ${path_Streams}/3rdparty/rfc1951.cpp)
242     include_directories(${ZLIB_INCLUDE_DIR})
243 endif()
245 set(path_mimetypesqt4 ${CMAKE_CURRENT_SOURCE_DIR}/src/mimetypes-qt4)
246 set(libMimetypesQt4_HEADERS
247     ${path_mimetypesqt4}/io/qstandardpaths.h
248     ${path_mimetypesqt4}/mimetypes/qmimedatabase_p.h
249     ${path_mimetypesqt4}/mimetypes/qmimeglobpattern_p.h
250     ${path_mimetypesqt4}/mimetypes/qmimemagicrule_p.h
251     ${path_mimetypesqt4}/mimetypes/qmimemagicrulematcher_p.h
252     ${path_mimetypesqt4}/mimetypes/qmimeprovider_p.h
253     ${path_mimetypesqt4}/mimetypes/qmimetype_p.h
254     ${path_mimetypesqt4}/mimetypes/qmimetypeparser_p.h
255     ${path_mimetypesqt4}/mimetypes/qmimetype.h
256     ${path_mimetypesqt4}/mimetypes/qmimedatabase.h
258 set(libMimetypesQt4_SOURCES
259     ${path_mimetypesqt4}/io/qstandardpaths.cpp
260     ${path_mimetypesqt4}/mimetypes/qmimedatabase.cpp
261     ${path_mimetypesqt4}/mimetypes/qmimeglobpattern.cpp
262     ${path_mimetypesqt4}/mimetypes/qmimemagicrule.cpp
263     ${path_mimetypesqt4}/mimetypes/qmimemagicrulematcher.cpp
264     ${path_mimetypesqt4}/mimetypes/qmimetype.cpp
265     ${path_mimetypesqt4}/mimetypes/qmimetypeparser.cpp
266     ${path_mimetypesqt4}/mimetypes/qmimeprovider.cpp
268 if(WIN32)
269     set(libMimetypesQt4_SOURCES ${libMimetypesQt4_SOURCES}
270         ${path_mimetypesqt4}/io/qstandardpaths_win.cpp)
271 elseif(APPLE)
272     set(libMimetypesQt4_SOURCES ${libMimetypesQt4_SOURCES}
273         ${path_mimetypesqt4}/io/qstandardpaths_mac.cpp)
274 elseif (OS2)
275     set(libMimetypesQt4_SOURCES ${libMimetypesQt4_SOURCES}
276         ${path_mimetypesqt4}/io/qstandardpaths_os2.cpp)
277 elseif (UNIX)
278     set(libMimetypesQt4_SOURCES ${libMimetypesQt4_SOURCES}
279         ${path_mimetypesqt4}/io/qstandardpaths_unix.cpp)
280 else()
281     message(FATAL_ERROR "Unsupported platform -- mimetypes-Qt4 support only Unix, MacOSX, Windows and OS/2")
282 endif()
284 set(path_DesktopGui ${CMAKE_CURRENT_SOURCE_DIR}/src/Gui)
285 set(libDesktopGui_HEADERS
286     ${path_DesktopGui}/AttachmentView.h
287     ${path_DesktopGui}/AutoCompletion.h
288     ${path_DesktopGui}/CompleteMessageWidget.h
289     ${path_DesktopGui}/ComposeWidget.h
290     ${path_DesktopGui}/ComposerAttachmentsList.h
291     ${path_DesktopGui}/ComposerTextEdit.h
292     ${path_DesktopGui}/EmbeddedWebView.h
293     ${path_DesktopGui}/EnvelopeView.h
294     ${path_DesktopGui}/ExternalElementsWidget.h
295     ${path_DesktopGui}/FindBar.h
296     ${path_DesktopGui}/FlowLayout.h
297     ${path_DesktopGui}/FromAddressProxyModel.h
298     ${path_DesktopGui}/LineEdit.h
299     ${path_DesktopGui}/LoadablePartWidget.h
300     ${path_DesktopGui}/MailBoxTreeView.h
301     ${path_DesktopGui}/MessageListWidget.h
302     ${path_DesktopGui}/MessageSourceWidget.h
303     ${path_DesktopGui}/MessageView.h
304     ${path_DesktopGui}/MsgListView.h
305     ${path_DesktopGui}/OnePanelAtTimeWidget.h
306     ${path_DesktopGui}/OverlayWidget.h
307     ${path_DesktopGui}/PartWidget.h
308     ${path_DesktopGui}/PartWidgetFactory.h
309     ${path_DesktopGui}/PasswordDialog.h
310     ${path_DesktopGui}/ProgressPopUp.h
311     ${path_DesktopGui}/ProtocolLoggerWidget.h
312     ${path_DesktopGui}/ReplaceCharValidator.h
313     ${path_DesktopGui}/SettingsDialog.h
314     ${path_DesktopGui}/SimplePartWidget.h
315     ${path_DesktopGui}/Spinner.h
316     ${path_DesktopGui}/TagListWidget.h
317     ${path_DesktopGui}/TagWidget.h
318     ${path_DesktopGui}/TaskProgressIndicator.h
319     ${path_DesktopGui}/UserAgentWebPage.h
320     ${path_DesktopGui}/Util.h
321     ${path_DesktopGui}/Window.h
322     ${path_DesktopGui}/ShortcutHandler/ShortcutConfigDialog.h
323     ${path_DesktopGui}/ShortcutHandler/ShortcutConfigWidget.h
324     ${path_DesktopGui}/ShortcutHandler/ShortcutHandler.h
325     )
326 set(libDesktopGui_SOURCES
327     ${path_DesktopGui}/AttachmentView.cpp
328     ${path_DesktopGui}/AutoCompletion.cpp
329     ${path_DesktopGui}/CompleteMessageWidget.cpp
330     ${path_DesktopGui}/ComposeWidget.cpp
331     ${path_DesktopGui}/ComposerAttachmentsList.cpp
332     ${path_DesktopGui}/ComposerTextEdit.cpp
333     ${path_DesktopGui}/EmbeddedWebView.cpp
334     ${path_DesktopGui}/EnvelopeView.cpp
335     ${path_DesktopGui}/ExternalElementsWidget.cpp
336     ${path_DesktopGui}/FindBar.cpp
337     ${path_DesktopGui}/FlowLayout.cpp
338     ${path_DesktopGui}/FromAddressProxyModel.cpp
339     ${path_DesktopGui}/LineEdit.cpp
340     ${path_DesktopGui}/LoadablePartWidget.cpp
341     ${path_DesktopGui}/MailBoxTreeView.cpp
342     ${path_DesktopGui}/MessageListWidget.cpp
343     ${path_DesktopGui}/MessageSourceWidget.cpp
344     ${path_DesktopGui}/MessageView.cpp
345     ${path_DesktopGui}/MsgListView.cpp
346     ${path_DesktopGui}/OnePanelAtTimeWidget.cpp
347     ${path_DesktopGui}/OverlayWidget.cpp
348     ${path_DesktopGui}/PartWidget.cpp
349     ${path_DesktopGui}/PartWidgetFactory.cpp
350     ${path_DesktopGui}/PasswordDialog.cpp
351     ${path_DesktopGui}/ProgressPopUp.cpp
352     ${path_DesktopGui}/ProtocolLoggerWidget.cpp
353     ${path_DesktopGui}/ReplaceCharValidator.cpp
354     ${path_DesktopGui}/SettingsDialog.cpp
355     ${path_DesktopGui}/SimplePartWidget.cpp
356     ${path_DesktopGui}/Spinner.cpp
357     ${path_DesktopGui}/TagListWidget.cpp
358     ${path_DesktopGui}/TagWidget.cpp
359     ${path_DesktopGui}/TaskProgressIndicator.cpp
360     ${path_DesktopGui}/UserAgentWebPage.cpp
361     ${path_DesktopGui}/Util.cpp
362     ${path_DesktopGui}/Window.cpp
363     ${path_DesktopGui}/ShortcutHandler/ShortcutConfigDialog.cpp
364     ${path_DesktopGui}/ShortcutHandler/ShortcutConfigWidget.cpp
365     ${path_DesktopGui}/ShortcutHandler/ShortcutHandler.cpp
367 set(libDesktopGui_UI
368     ${path_DesktopGui}/CreateMailboxDialog.ui
369     ${path_DesktopGui}/SettingsOutgoingPage.ui
370     ${path_DesktopGui}/SettingsGeneralPage.ui
371     ${path_DesktopGui}/ComposeWidget.ui
372     ${path_DesktopGui}/ProgressPopUpOld.ui
373     ${path_DesktopGui}/ShortcutHandler/ShortcutConfigWidget.ui
374     ${path_DesktopGui}/SettingsImapPage.ui
375     ${path_DesktopGui}/PasswordDialog.ui
376     ${path_DesktopGui}/SettingsCachePage.ui
377     ${path_DesktopGui}/EditIdentity.ui
378     ${path_DesktopGui}/ProgressPopUp.ui
380 set(libDesktopGui_RESOURCES
381     ${CMAKE_CURRENT_SOURCE_DIR}/src/icons.qrc
384 set(libqwwsmtpclient_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/qwwsmtpclient/qwwsmtpclient.h)
385 set(libqwwsmtpclient_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/qwwsmtpclient/qwwsmtpclient.cpp)
387 set(libAppVersion_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/AppVersion/SetCoreApplication.h)
388 set(libAppVersion_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/AppVersion/SetCoreApplication.cpp)
390 set(path_Imap ${CMAKE_CURRENT_SOURCE_DIR}/src/Imap)
391 set(libImap_HEADERS
392     ${path_Imap}/ConnectionState.h
393     ${path_Imap}/Exceptions.h
394     ${path_Imap}/Encoders.h
395     ${path_Imap}/Parser/3rdparty/kcodecs.h
396     ${path_Imap}/Parser/3rdparty/rfccodecs.h
398     ${path_Imap}/Parser/Command.h
399     ${path_Imap}/Parser/Data.h
400     ${path_Imap}/Parser/LowLevelParser.h
401     ${path_Imap}/Parser/MailAddress.h
402     ${path_Imap}/Parser/Message.h
403     ${path_Imap}/Parser/Parser.h
404     ${path_Imap}/Parser/Response.h
405     ${path_Imap}/Parser/Rfc5322HeaderParser.h
406     ${path_Imap}/Parser/Sequence.h
407     ${path_Imap}/Parser/ThreadingNode.h
409     ${path_Imap}/Network/FileDownloadManager.h
410     ${path_Imap}/Network/ForbiddenReply.h
411     ${path_Imap}/Network/MsgPartNetAccessManager.h
412     ${path_Imap}/Network/MsgPartNetworkReply.h
414     ${path_Imap}/Model/Cache.h
415     ${path_Imap}/Model/CatenateData.h
416     ${path_Imap}/Model/CombinedCache.h
417     ${path_Imap}/Model/CopyMoveOperation.h
418     ${path_Imap}/Model/DelayedPopulation.h
419     ${path_Imap}/Model/DiskPartCache.h
420     ${path_Imap}/Model/FindInterestingPart.h
421     ${path_Imap}/Model/FlagsOperation.h
422     ${path_Imap}/Model/FullMessageCombiner.h
423     ${path_Imap}/Model/ItemRoles.h
424     ${path_Imap}/Model/MailboxMetadata.h
425     ${path_Imap}/Model/MailboxModel.h
426     ${path_Imap}/Model/MailboxTree.h
427     ${path_Imap}/Model/MemoryCache.h
428     ${path_Imap}/Model/Model.h
429     ${path_Imap}/Model/ModelTest/modeltest.h
430     ${path_Imap}/Model/ModelWatcher.h
431     ${path_Imap}/Model/MsgListModel.h
432     ${path_Imap}/Model/OneMessageModel.h
433     ${path_Imap}/Model/ParserState.h
434     ${path_Imap}/Model/PrettyMailboxModel.h
435     ${path_Imap}/Model/PrettyMsgListModel.h
436     ${path_Imap}/Model/QAIM_reset.h
437     ${path_Imap}/Model/SQLCache.h
438     ${path_Imap}/Model/SubscribeUnSubscribeOperation.h
439     ${path_Imap}/Model/SubtreeModel.h
440     ${path_Imap}/Model/TaskFactory.h
441     ${path_Imap}/Model/TaskPresentationModel.h
442     ${path_Imap}/Model/ThreadingMsgListModel.h
443     ${path_Imap}/Model/UidSubmitData.h
444     ${path_Imap}/Model/Utils.h
445     ${path_Imap}/Model/VisibleTasksModel.h
447     ${path_Imap}/Model/kdeui-itemviews/kbihash_p.h
448     # this file is left out intentionally; otherwise cmake's automoc won't work with it
449     #${path_Imap}/Model/kdeui-itemviews/kdescendantsproxymodel.h
451     ${path_Imap}/Tasks/AppendTask.h
452     ${path_Imap}/Tasks/CopyMoveMessagesTask.h
453     ${path_Imap}/Tasks/CreateMailboxTask.h
454     ${path_Imap}/Tasks/DeleteMailboxTask.h
455     ${path_Imap}/Tasks/EnableTask.h
456     ${path_Imap}/Tasks/ExpungeMailboxTask.h
457     ${path_Imap}/Tasks/ExpungeMessagesTask.h
458     ${path_Imap}/Tasks/Fake_ListChildMailboxesTask.h
459     ${path_Imap}/Tasks/Fake_OpenConnectionTask.h
460     ${path_Imap}/Tasks/FetchMsgMetadataTask.h
461     ${path_Imap}/Tasks/FetchMsgPartTask.h
462     ${path_Imap}/Tasks/GenUrlAuthTask.h
463     ${path_Imap}/Tasks/GetAnyConnectionTask.h
464     ${path_Imap}/Tasks/IdTask.h
465     ${path_Imap}/Tasks/IdleLauncher.h
466     ${path_Imap}/Tasks/ImapTask.h
467     ${path_Imap}/Tasks/KeepMailboxOpenTask.h
468     ${path_Imap}/Tasks/ListChildMailboxesTask.h
469     ${path_Imap}/Tasks/NoopTask.h
470     ${path_Imap}/Tasks/NumberOfMessagesTask.h
471     ${path_Imap}/Tasks/ObtainSynchronizedMailboxTask.h
472     ${path_Imap}/Tasks/OfflineConnectionTask.h
473     ${path_Imap}/Tasks/OpenConnectionTask.h
474     ${path_Imap}/Tasks/SortTask.h
475     ${path_Imap}/Tasks/SubscribeUnsubscribeTask.h
476     ${path_Imap}/Tasks/ThreadTask.h
477     ${path_Imap}/Tasks/UidSubmitTask.h
478     ${path_Imap}/Tasks/UnSelectTask.h
479     ${path_Imap}/Tasks/UpdateFlagsTask.h
480     ${path_Imap}/Tasks/UpdateFlagsOfAllMessagesTask.h
482 set(libImap_SOURCES
483     ${path_Imap}/ConnectionState.cpp
484     ${path_Imap}/Encoders.cpp
485     ${path_Imap}/Exceptions.cpp
486     ${path_Imap}/Parser/3rdparty/kcodecs.cpp
487     ${path_Imap}/Parser/3rdparty/rfccodecs.cpp
489     ${path_Imap}/Parser/Command.cpp
490     ${path_Imap}/Parser/Data.cpp
491     ${path_Imap}/Parser/LowLevelParser.cpp
492     ${path_Imap}/Parser/MailAddress.cpp
493     ${path_Imap}/Parser/Message.cpp
494     ${path_Imap}/Parser/Parser.cpp
495     ${path_Imap}/Parser/Response.cpp
496     ${path_Imap}/Parser/Sequence.cpp
497     ${path_Imap}/Parser/ThreadingNode.cpp
499     ${path_Imap}/Network/FileDownloadManager.cpp
500     ${path_Imap}/Network/ForbiddenReply.cpp
501     ${path_Imap}/Network/MsgPartNetAccessManager.cpp
502     ${path_Imap}/Network/MsgPartNetworkReply.cpp
504     ${path_Imap}/Model/Cache.cpp
505     ${path_Imap}/Model/CombinedCache.cpp
506     ${path_Imap}/Model/DelayedPopulation.cpp
507     ${path_Imap}/Model/DiskPartCache.cpp
508     ${path_Imap}/Model/FindInterestingPart.cpp
509     ${path_Imap}/Model/FlagsOperation.cpp
510     ${path_Imap}/Model/FullMessageCombiner.cpp
511     ${path_Imap}/Model/MailboxMetadata.cpp
512     ${path_Imap}/Model/MailboxModel.cpp
513     ${path_Imap}/Model/MailboxTree.cpp
514     ${path_Imap}/Model/MemoryCache.cpp
515     ${path_Imap}/Model/Model.cpp
516     ${path_Imap}/Model/ModelWatcher.cpp
517     ${path_Imap}/Model/MsgListModel.cpp
518     ${path_Imap}/Model/OneMessageModel.cpp
519     ${path_Imap}/Model/ParserState.cpp
520     ${path_Imap}/Model/PrettyMailboxModel.cpp
521     ${path_Imap}/Model/PrettyMsgListModel.cpp
522     ${path_Imap}/Model/SQLCache.cpp
523     ${path_Imap}/Model/SubtreeModel.cpp
524     ${path_Imap}/Model/TaskFactory.cpp
525     ${path_Imap}/Model/TaskPresentationModel.cpp
526     ${path_Imap}/Model/ThreadingMsgListModel.cpp
527     ${path_Imap}/Model/Utils.cpp
528     ${path_Imap}/Model/VisibleTasksModel.cpp
530     ${path_Imap}/Model/ModelTest/modeltest.cpp
531     ${path_Imap}/Model/kdeui-itemviews/kdescendantsproxymodel.cpp
533     ${path_Imap}/Tasks/AppendTask.cpp
534     ${path_Imap}/Tasks/CopyMoveMessagesTask.cpp
535     ${path_Imap}/Tasks/CreateMailboxTask.cpp
536     ${path_Imap}/Tasks/DeleteMailboxTask.cpp
537     ${path_Imap}/Tasks/EnableTask.cpp
538     ${path_Imap}/Tasks/ExpungeMailboxTask.cpp
539     ${path_Imap}/Tasks/ExpungeMessagesTask.cpp
540     ${path_Imap}/Tasks/Fake_ListChildMailboxesTask.cpp
541     ${path_Imap}/Tasks/Fake_OpenConnectionTask.cpp
542     ${path_Imap}/Tasks/FetchMsgMetadataTask.cpp
543     ${path_Imap}/Tasks/FetchMsgPartTask.cpp
544     ${path_Imap}/Tasks/GenUrlAuthTask.cpp
545     ${path_Imap}/Tasks/GetAnyConnectionTask.cpp
546     ${path_Imap}/Tasks/IdTask.cpp
547     ${path_Imap}/Tasks/IdleLauncher.cpp
548     ${path_Imap}/Tasks/ImapTask.cpp
549     ${path_Imap}/Tasks/KeepMailboxOpenTask.cpp
550     ${path_Imap}/Tasks/ListChildMailboxesTask.cpp
551     ${path_Imap}/Tasks/NoopTask.cpp
552     ${path_Imap}/Tasks/NumberOfMessagesTask.cpp
553     ${path_Imap}/Tasks/ObtainSynchronizedMailboxTask.cpp
554     ${path_Imap}/Tasks/OfflineConnectionTask.cpp
555     ${path_Imap}/Tasks/OpenConnectionTask.cpp
556     ${path_Imap}/Tasks/SortTask.cpp
557     ${path_Imap}/Tasks/SubscribeUnsubscribeTask.cpp
558     ${path_Imap}/Tasks/ThreadTask.cpp
559     ${path_Imap}/Tasks/UidSubmitTask.cpp
560     ${path_Imap}/Tasks/UnSelectTask.cpp
561     ${path_Imap}/Tasks/UpdateFlagsTask.cpp
562     ${path_Imap}/Tasks/UpdateFlagsOfAllMessagesTask.cpp
565 if(WITH_RAGEL AND RAGEL_FOUND)
566     message(STATUS "Using Ragel for the RFC 5322 parser")
567     ragel_parser(${path_Imap}/Parser/Rfc5322HeaderParser.cpp)
568     set(libImap_SOURCES ${libImap_SOURCES}
569         ${CMAKE_CURRENT_BINARY_DIR}/Rfc5322HeaderParser.generated.cpp)
570 else()
571     message(STATUS "Using pregenerated RFC 5322 parser")
572     set(libImap_SOURCES ${libImap_SOURCES}
573         ${path_Imap}/Parser/Rfc5322HeaderParser.generated.cpp)
574 endif()
576 set(path_AbookAddressbook ${CMAKE_CURRENT_SOURCE_DIR}/src/AbookAddressbook)
577 set(libAbookAddressbook_HEADERS
578     ${path_AbookAddressbook}/AbookAddressbook.h
579     ${path_AbookAddressbook}/be-contacts.h
581 set(libAbookAddressbook_SOURCES
582     ${path_AbookAddressbook}/AbookAddressbook.cpp
583     ${path_AbookAddressbook}/be-contacts.cpp
585 set(libAbookAddressbook_UI
586     ${path_AbookAddressbook}/be-contacts.ui
587     ${path_AbookAddressbook}/onecontact.ui
590 set(trojita_desktop_SOURCES
591     ${path_DesktopGui}/main.cpp
594 set(be_contacts_SOURCES
595     ${CMAKE_CURRENT_SOURCE_DIR}/src/be.contacts/main.cpp
598 set(libQmlModelGlue_SOURCES
599     ${CMAKE_CURRENT_SOURCE_DIR}/src/QmlSupport/ModelGlue/ImapAccess.cpp
601 set(libQmlModelGlue_HEADERS
602     ${CMAKE_CURRENT_SOURCE_DIR}/src/QmlSupport/ModelGlue/ImapAccess.h
605 set(libQNAMWebView_SOURCES
606     ${CMAKE_CURRENT_SOURCE_DIR}/src/QmlSupport/QNAMWebView/plugin.cpp
607     ${CMAKE_CURRENT_SOURCE_DIR}/src/QmlSupport/QNAMWebView/qdeclarativewebview.cpp
609 set(libQNAMWebView_HEADERS
610     ${CMAKE_CURRENT_SOURCE_DIR}/src/QmlSupport/QNAMWebView/plugin.h
611     ${CMAKE_CURRENT_SOURCE_DIR}/src/QmlSupport/QNAMWebView/qdeclarativewebview_p.h
614 set(trojitaHarmattan_SOURCES
615     ${CMAKE_CURRENT_SOURCE_DIR}/src/Harmattan/main.cpp
616     ${CMAKE_CURRENT_SOURCE_DIR}/src/Harmattan/qmlapplicationviewer/qmlapplicationviewer.cpp
619 if(Linguist_FOUND)
620     file(GLOB_RECURSE lang_PO "${CMAKE_CURRENT_SOURCE_DIR}/po/trojita_common_*.po")
621     if(WITH_QT5)
622         qt5_wrap_po(trojita_QM ${lang_PO})
623     else()
624         qt4_wrap_po(trojita_QM ${lang_PO})
625     endif()
626     set(language_summary "")
627     foreach(po ${lang_PO})
628         string(REGEX REPLACE "^(.*)/trojita_common_(.*).po" "\\2" lang ${po})
629         list(APPEND language_summary ${lang})
630     endforeach()
631     list(SORT language_summary)
632     list(LENGTH language_summary num_languages)
633     if(num_languages)
634         message(STATUS "Available languages: ${language_summary}")
635         if(BUILD_DESKTOP_GUI)
636            install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locale/ DESTINATION share/trojita/locale FILES_MATCHING PATTERN *.qm)
637         endif()
638     else()
639         message(STATUS "No .po files found, will not install any languages")
640     endif()
641 else()
642     message(STATUS "Qt Linguist (lupdate/lrelease/lconvert) not found, disabling localization support")
643 endif()
645 set(version_files ${CMAKE_CURRENT_BINARY_DIR}/trojita-version.h ${CMAKE_CURRENT_BINARY_DIR}/trojita-git-version.h)
646 if(WIN32 AND WITH_NSIS AND MAKENSIS)
647     set(version_files ${version_files} ${CMAKE_CURRENT_BINARY_DIR}/trojita-version.nsi)
648     set(NSIS TRUE)
649 endif()
651 add_custom_target(version DEPENDS version_fake_file)
652 add_custom_command(OUTPUT version_fake_file ${version_files}
653     COMMAND ${CMAKE_COMMAND} -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -DNSIS=${NSIS} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/TrojitaVersion.cmake)
654 set_source_files_properties(${version_files}
655     PROPERTIES GENERATED TRUE
656     HEADER_FILE_ONLY TRUE)
658 add_library(AppVersion ${libAppVersion_SOURCES})
659 add_dependencies(AppVersion version version_fake_file)
661 add_library(Common ${libCommon_SOURCES})
662 target_link_libraries(Common ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY})
664 add_library(Streams ${libStreams_SOURCES})
665 target_link_libraries(Streams ${QT_QTNETWORK_LIBRARY} ${QT_QTCORE_LIBRARY})
666 if(ZLIB_FOUND)
667     target_link_libraries(Streams ${ZLIB_LIBRARIES})
668 endif()
670 add_library(qwwsmtpclient ${libqwwsmtpclient_SOURCES})
671 target_link_libraries(qwwsmtpclient ${QT_QTNETWORK_LIBRARY} ${QT_QTCORE_LIBRARY})
673 add_library(MSA ${libMSA_SOURCES})
674 target_link_libraries(MSA Streams qwwsmtpclient ${QT_QTNETWORK_LIBRARY} ${QT_QTCORE_LIBRARY})
676 add_library(Composer ${libComposer_SOURCES})
677 target_link_libraries(Composer Common MSA Streams qwwsmtpclient ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY})
678 if(NOT WITH_QT5)
679     target_link_libraries(Composer MimetypesQt4)
680 endif()
682 add_library(Imap ${libImap_SOURCES})
683 target_link_libraries(Imap Common Streams ${QT_QTNETWORK_LIBRARY} ${QT_QTSQL_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY})
684 if(ZLIB_FOUND)
685     target_link_libraries(Imap ${ZLIB_LIBRARIES})
686 endif()
688 if(NOT WITH_QT5)
689     add_library(MimetypesQt4 ${libMimetypesQt4_SOURCES})
690     if(SUPPORTS_TARGET_INCLUDES)
691         set_property(TARGET MimetypesQt4 APPEND PROPERTY INCLUDE_DIRECTORIES
692             ${QT_MKSPECS_DIR}/default ${path_mimetypesqt4}/io/)
693     endif()
694 endif()
696 if(BUILD_DESKTOP_GUI)
697     if(WITH_QT5)
698         qt5_wrap_ui(libAbookAddressbook_UI_OUT ${libAbookAddressbook_UI})
699         qt5_wrap_ui(libDesktopGui_UI_OUT ${libDesktopGui_UI})
700         qt5_add_resources(libDesktopGui_RESOURCES_OUT ${libDesktopGui_RESOURCES})
701     else()
702         qt4_wrap_ui(libAbookAddressbook_UI_OUT ${libAbookAddressbook_UI})
703         qt4_wrap_ui(libDesktopGui_UI_OUT ${libDesktopGui_UI})
704         qt4_add_resources(libDesktopGui_RESOURCES_OUT ${libDesktopGui_RESOURCES})
705     endif()
707     add_library(AbookAddressbook ${libAbookAddressbook_SOURCES} ${libAbookAddressbook_UI_OUT})
708     target_link_libraries(AbookAddressbook ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY})
710     add_library(DesktopGui ${libDesktopGui_SOURCES} ${libDesktopGui_UI_OUT} ${libDesktopGui_RESOURCES_OUT})
711     # The following is needed for the LineEdit widget within the .ui files.
712     # The ${path_DesktopGui} is needed so that the generated ui_*.h file can find the headers of the custom widgets
713     if(SUPPORTS_TARGET_INCLUDES)
714         set_property(TARGET DesktopGui APPEND PROPERTY INCLUDE_DIRECTORIES ${path_DesktopGui})
715     endif()
716     target_link_libraries(DesktopGui Common Composer Imap MSA Streams qwwsmtpclient AbookAddressbook)
718     if(WIN32) # Check if we are on Windows
719         # build a real Win32 GUI application. Hide the console window
720         add_executable(trojita WIN32 ${trojita_desktop_SOURCES} ${trojita_QM} ${CMAKE_CURRENT_SOURCE_DIR}/src/trojita_win32.rc)
721         target_link_libraries(trojita ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES})
722     else()
723         add_executable(trojita ${trojita_desktop_SOURCES} ${trojita_QM})
724     endif()
726     target_link_libraries(trojita AppVersion Imap MSA Streams qwwsmtpclient Common Composer AbookAddressbook DesktopGui
727         ${QT_QTSQL_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
728     if(NOT WITH_QT5)
729         target_link_libraries(trojita MimetypesQt4 ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTCORE_LIBRARY})
730     endif()
731     if(ZLIB_FOUND)
732         target_link_libraries(trojita ${ZLIB_LIBRARIES})
733     endif()
735     add_executable(be.contacts ${be_contacts_SOURCES})
736     target_link_libraries(be.contacts AbookAddressbook ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY})
737 elseif(BUILD_HARMATTAN)
738     add_library(QmlModelGlue ${libQmlModelGlue_SOURCES})
739     add_library(trojitaqnamwebviewplugin SHARED ${libQNAMWebView_SOURCES})
740     add_executable(trojita-tp ${trojitaHarmattan_SOURCES})
741     if(SUPPORTS_TARGET_INCLUDES)
742         set_property(TARGET trojita-tp APPEND PROPERTY INCLUDE_DIRECTORIES
743             ${QT_MKSPECS_DIR}/default ${CMAKE_CURRENT_SOURCE_DIR}/src/Harmattan/qmlapplicationviewer)
744     endif()
745     target_link_libraries(trojita-tp QmlModelGlue AppVersion Imap MSA Streams qwwsmtpclient Common Composer MimetypesQt4
746         ${QT_QTSQL_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTWEBKIT_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY})
747 endif()
749 if(WITH_QT5)
750     qt5_use_modules(AppVersion Core)
751     qt5_use_modules(Common Core)
752     qt5_use_modules(Streams Network)
753     qt5_use_modules(qwwsmtpclient Network)
754     qt5_use_modules(MSA Network)
755     qt5_use_modules(Composer Gui Network)
756     qt5_use_modules(Imap Gui Network Sql)
757     qt5_use_modules(DesktopGui Network WebKitWidgets)
758     qt5_use_modules(AbookAddressbook Widgets)
759     qt5_use_modules(be.contacts Widgets)
760     qt5_use_modules(trojita Widgets)
761 endif()
763 if(BUILD_DESKTOP_GUI)
764     install(TARGETS trojita be.contacts RUNTIME DESTINATION bin)
765     install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Gui/trojita.desktop DESTINATION share/applications/)
766     install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/icons/trojita.png DESTINATION share/icons/hicolor/32x32/apps/)
767     install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/icons/trojita.svg DESTINATION share/icons/hicolor/scalable/apps/)
768 elseif(BUILD_HARMATTAN)
769     set(trojita_harmattan_path ${CMAKE_CURRENT_SOURCE_DIR}/src/Harmattan)
770     install(TARGETS trojita-tp RUNTIME DESTINATION opt/trojita-tp/bin)
771     install(TARGETS trojitaqnamwebviewplugin LIBRARY DESTINATION opt/trojita-tp/bin/net/flaska/QNAMWebView)
772     install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/QmlSupport/QNAMWebView/qmldir DESTINATION opt/trojita-tp/bin/net/flaska/QNAMWebView)
773     install(DIRECTORY ${trojita_harmattan_path}/qml DESTINATION opt/trojita-tp/)
774     install(FILES ${trojita_harmattan_path}/trojita-tp.desktop DESTINATION usr/share/applications/)
775     install(FILES ${trojita_harmattan_path}/trojita-tp80.png DESTINATION usr/share/icons/hicolor/80x80/apps/)
776 endif()
778 if(WIN32 AND WITH_NSIS AND MAKENSIS)
779     if(CMAKE_SIZEOF_VOID_P STREQUAL 4)
780         set(MAKENSIS_OUTPUT Trojita-installer.exe)
781     else()
782         set(MAKENSIS_FLAGS -DX86_64 ${MAKENSIS_FLAGS})
783         set(MAKENSIS_OUTPUT Trojita-installer-x86_64.exe)
784     endif()
786     if(NOT CMAKE_VERBOSE_MAKEFILE)
787         set(MAKENSIS_FLAGS -V2 -DQUIET ${MAKENSIS_FLAGS})
788     endif()
790     set(MAKENSIS_FLAGS ${MAKENSIS_FLAGS} -NOCD)
792     add_custom_command(OUTPUT ${MAKENSIS_OUTPUT}
793         COMMAND ${MAKENSIS}
794         ARGS ${MAKENSIS_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/packaging/trojita.nsi
795         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/packaging/trojita.nsi ${CMAKE_CURRENT_BINARY_DIR}/trojita.exe)
796     add_custom_target(installer ALL DEPENDS ${MAKENSIS_OUTPUT})
797 endif()
800 if(NOT WITHOUT_TESTS)
801     set(test_LibMailboxSync_SOURCES
802         tests/test_LibMailboxSync/ModelEvents.cpp
803         tests/test_LibMailboxSync/test_LibMailboxSync.cpp
804     )
805     add_library(test_LibMailboxSync ${test_LibMailboxSync_SOURCES})
806     if(WITH_QT5)
807         qt5_use_modules(test_LibMailboxSync Test Network)
808     endif()
809     if(SUPPORTS_TARGET_INCLUDES)
810         set_property(TARGET test_LibMailboxSync APPEND PROPERTY INCLUDE_DIRECTORIES
811             ${CMAKE_CURRENT_SOURCE_DIR}/tests
812             ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_LibMailboxSync)
813     endif()
814     target_link_libraries(test_LibMailboxSync Imap MSA Streams Common Composer)
816     macro(trojita_test fname)
817         set(test_${fname}_SOURCES tests/tests/test_${fname}/test_${fname}.cpp)
818         set(test_${fname}_HEADERS tests/tests/test_${fname}/test_${fname}.h)
819         add_executable(test_${fname} ${test_${fname}_SOURCES})
820         target_link_libraries(test_${fname} Imap MSA Streams Common Composer test_LibMailboxSync)
821         if(WITH_QT5)
822             qt5_use_modules(test_${fname} Network Sql Test Widgets)
823         else()
824             target_link_libraries(test_${fname} ${QT_QTSQL_LIBRARY} ${QT_QTTEST_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY})
825         endif()
826         if(ZLIB_FOUND)
827             target_link_libraries(test_${fname} ${ZLIB_LIBRARIES})
828         endif()
829         add_test(test_${fname} test_${fname})
830         if(SUPPORTS_TARGET_INCLUDES)
831             set_property(TARGET test_${fname} APPEND PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/tests)
832         endif()
833     endmacro()
835     enable_testing()
836     trojita_test(Composer_Submission)
837     trojita_test(Composer_responses)
838     trojita_test(Html_formatting)
839     if(WITH_QT5)
840         qt5_use_modules(test_Composer_responses WebKitWidgets)
841         qt5_use_modules(test_Html_formatting WebKitWidgets)
842     else()
843         target_link_libraries(test_Html_formatting ${QT_QTWEBKIT_LIBRARY})
844     endif()
845     trojita_test(Imap_DisappearingMailboxes)
846     trojita_test(Imap_Idle)
847     trojita_test(Imap_LowLevelParser)
848     trojita_test(Imap_Message)
849     trojita_test(Imap_Model)
850     trojita_test(Imap_Parser_parse)
851     trojita_test(Imap_Responses)
852     trojita_test(Imap_SelectedMailboxUpdates)
853     trojita_test(Imap_Tasks_CreateMailbox)
854     trojita_test(Imap_Tasks_DeleteMailbox)
855     trojita_test(Imap_Tasks_ListChildMailboxes)
856     trojita_test(Imap_Tasks_ObtainSynchronizedMailbox)
857     trojita_test(Imap_Tasks_OpenConnection)
858     trojita_test(Imap_Threading)
859     trojita_test(Rfc5322)
860     trojita_test(RingBuffer)
861     trojita_test(SenderIdentitiesModel)
862     trojita_test(SqlCache)
863     trojita_test(algorithms)
864     trojita_test(rfccodecs)
865 endif()
867 if(WIN32) # Check if we are on Windows
868     if(MSVC10) # Check if we are using the Visual Studio compiler 2010
869         # Because of linker errors (see http://stackoverflow.com/questions/5625884/conversion-of-stdwstring-to-qstring-throws-linker-error)
870         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-")
871     elseif(MINGW)
872     else()
873         message(WARNING "You are using a compiler which we have not tested yet (not MSVC10 or MINGW).")
874         message(WARNING "Please let us know how well it works.")
875     endif()
876 endif()
878 # FIXME: fix build warnings