forked from OtterBrowser/otter-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
612 lines (554 loc) · 23.9 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
cmake_minimum_required(VERSION 3.7.0)
project(otter-browser)
set(MAJOR_VERSION "1")
set(MINOR_VERSION "0")
set(PATCH_VERSION "81")
set(WEEKLY_VERSION "" CACHE STRING "")
add_definitions(-DOTTER_VERSION_MAIN="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}" -DOTTER_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
if ("${WEEKLY_VERSION}" STREQUAL "")
add_definitions(-DOTTER_VERSION_CONTEXT="-dev" -DOTTER_VERSION_WEEKLY=" ")
else ()
add_definitions(-DOTTER_VERSION_CONTEXT=" weekly ${WEEKLY_VERSION}" -DOTTER_VERSION_WEEKLY="${WEEKLY_VERSION}")
endif ()
if (EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
include(InstallRequiredSystemLibraries)
set(CPACK_SET_DESTDIR "on")
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
set(CPACK_GENERATOR "DEB;RPM")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Web browser controlled by the user, not vice-versa")
set(CPACK_PACKAGE_VENDOR "Vendor")
set(CPACK_PACKAGE_CONTACT "Michal Dutkiewicz <[email protected]>")
set(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
set(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
set(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
set(CPACK_PACKAGE_NAME "otter-browser")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libhunspell-1.5-0 (>= 1.5.1), libqt5multimedia5 (>=5.6.0), libqt5qml5 (>=5.6.0), libqt5svg5 (>=5.6.0), libqt5webkit5 (>=5.212.0~alpha2)")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "gstreamer1.0-plugins-base, gstreamer1.0-plugins-good")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_SECTION "web")
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
set(CPACK_COMPONENTS_ALL Libraries ApplicationData)
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
${CMAKE_INSTALL_MANDIR}/man1
${CMAKE_INSTALL_PREFIX}/share/applications
${CMAKE_INSTALL_PREFIX}/share/icons
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/16x16
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/32x32
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/64x64
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/128x128
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/16x16/apps
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/32x32/apps
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/64x64/apps
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/128x128/apps
${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps
)
include(CPack)
endif ()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD 11)
include(FeatureSummary)
include(GNUInstallDirs)
option(ENABLE_QTWEBENGINE "Enable QtWebEngine backend (requires Qt 5.12)" ON)
option(ENABLE_QTWEBKIT "Enable QtWebKit backend (requires QtWebKit 5.212)" ON)
option(ENABLE_CRASHREPORTS "Enable built-in crash reporting (only for official builds)" OFF)
option(ENABLE_DBUS "Enable D-Bus based integration for notifications (only freedesktop.org compatible platforms)" ON)
option(ENABLE_SPELLCHECK "Enable Hunspell based spell checking" ON)
find_package(Qt5 5.6.0 REQUIRED COMPONENTS Core Gui Multimedia Network PrintSupport Qml Svg Widgets)
find_package(Qt5WebEngineWidgets 5.12.0 QUIET)
find_package(Qt5WebKitWidgets 5.212.0 QUIET)
find_package(Hunspell 1.5.0 QUIET)
set_package_properties(Qt5WebEngineCore PROPERTIES URL "https://www.qt.io/" DESCRIPTION "QtWebEngine based backend (core)" TYPE OPTIONAL)
set_package_properties(Qt5WebEngineWidgets PROPERTIES URL "https://www.qt.io/" DESCRIPTION "QtWebEngine based backend (widgets)" TYPE OPTIONAL)
set_package_properties(Qt5WebKit PROPERTIES URL "https://qtwebkit.github.io/" DESCRIPTION "QtWebKit based backend (core)" TYPE OPTIONAL)
set_package_properties(Qt5WebKitWidgets PROPERTIES URL "https://qtwebkit.github.io/" DESCRIPTION "QtWebKit based backend (widgets)" TYPE OPTIONAL)
set_package_properties(Hunspell PROPERTIES URL "https://hunspell.github.io/" DESCRIPTION "Generic spell checking support" TYPE OPTIONAL)
set(otter_src
src/main.cpp
src/core/ActionExecutor.cpp
src/core/ActionsManager.cpp
src/core/AdblockContentFiltersProfile.cpp
src/core/AddonsManager.cpp
src/core/AddressCompletionModel.cpp
src/core/Application.cpp
src/core/BookmarksManager.cpp
src/core/BookmarksModel.cpp
src/core/ContentFiltersManager.cpp
src/core/Console.cpp
src/core/CookieJar.cpp
src/core/FeedParser.cpp
src/core/FeedsManager.cpp
src/core/FeedsModel.cpp
src/core/GesturesManager.cpp
src/core/HandlersManager.cpp
src/core/HistoryManager.cpp
src/core/HistoryModel.cpp
src/core/Importer.cpp
src/core/IniSettings.cpp
src/core/InputInterpreter.cpp
src/core/ItemModel.cpp
src/core/Job.cpp
src/core/JsonSettings.cpp
src/core/ListingNetworkReply.cpp
src/core/LocalListingNetworkReply.cpp
src/core/LongTermTimer.cpp
src/core/Migrator.cpp
src/core/NetworkAutomaticProxy.cpp
src/core/NetworkCache.cpp
src/core/NetworkManager.cpp
src/core/NetworkManagerFactory.cpp
src/core/NetworkProxyFactory.cpp
src/core/NotesManager.cpp
src/core/NotificationsManager.cpp
src/core/PasswordsManager.cpp
src/core/PasswordsStorageBackend.cpp
src/core/PlatformIntegration.cpp
src/core/SearchEnginesManager.cpp
src/core/SearchSuggester.cpp
src/core/SessionModel.cpp
src/core/SessionsManager.cpp
src/core/SettingsManager.cpp
src/core/SpellCheckManager.cpp
src/core/TasksManager.cpp
src/core/ThemesManager.cpp
src/core/ToolBarsManager.cpp
src/core/TransfersManager.cpp
src/core/UpdateChecker.cpp
src/core/Updater.cpp
src/core/UserScript.cpp
src/core/Utils.cpp
src/core/WebBackend.cpp
src/ui/AcceptCookieDialog.cpp
src/ui/Action.cpp
src/ui/ActionComboBoxWidget.cpp
src/ui/Animation.cpp
src/ui/ApplicationComboBoxWidget.cpp
src/ui/AuthenticationDialog.cpp
src/ui/BookmarkPropertiesDialog.cpp
src/ui/BookmarksComboBoxWidget.cpp
src/ui/BookmarksImporterWidget.cpp
src/ui/CertificateDialog.cpp
src/ui/ClearHistoryDialog.cpp
src/ui/ColorWidget.cpp
src/ui/ComboBoxWidget.cpp
src/ui/ContentBlockingProfileDialog.cpp
src/ui/ContentFiltersViewWidget.cpp
src/ui/ContentsDialog.cpp
src/ui/ContentsWidget.cpp
src/ui/CookiePropertiesDialog.cpp
src/ui/Dialog.cpp
src/ui/FeedPropertiesDialog.cpp
src/ui/FeedsComboBoxWidget.cpp
src/ui/FilePathWidget.cpp
src/ui/IconWidget.cpp
src/ui/ImagePropertiesDialog.cpp
src/ui/ImportDialog.cpp
src/ui/ItemDelegate.cpp
src/ui/ItemViewWidget.cpp
src/ui/LineEditWidget.cpp
src/ui/LocaleDialog.cpp
src/ui/MainWindow.cpp
src/ui/MasterPasswordDialog.cpp
src/ui/Menu.cpp
src/ui/MenuBarWidget.cpp
src/ui/NotificationDialog.cpp
src/ui/OpenAddressDialog.cpp
src/ui/OpenBookmarkDialog.cpp
src/ui/OptionWidget.cpp
src/ui/PassiveNotificationWidget.cpp
src/ui/PreferencesDialog.cpp
src/ui/PreviewWidget.cpp
src/ui/ProgressBarWidget.cpp
src/ui/ProxyModel.cpp
src/ui/ReloadTimeDialog.cpp
src/ui/ReportDialog.cpp
src/ui/ResizerWidget.cpp
src/ui/SaveSessionDialog.cpp
src/ui/SearchEnginePropertiesDialog.cpp
src/ui/SessionsManagerDialog.cpp
src/ui/SidebarWidget.cpp
src/ui/SourceEditWidget.cpp
src/ui/SourceViewerWebWidget.cpp
src/ui/SplitterWidget.cpp
src/ui/StartupDialog.cpp
src/ui/StatusBarWidget.cpp
src/ui/Style.cpp
src/ui/SyntaxHighlighter.cpp
src/ui/TabBarWidget.cpp
src/ui/TabSwitcherWidget.cpp
src/ui/TextBrowserWidget.cpp
src/ui/TextEditWidget.cpp
src/ui/TextLabelWidget.cpp
src/ui/ToolBarDialog.cpp
src/ui/ToolBarDropZoneWidget.cpp
src/ui/ToolBarWidget.cpp
src/ui/ToolButtonWidget.cpp
src/ui/TransferDialog.cpp
src/ui/TrayIcon.cpp
src/ui/UpdateCheckerDialog.cpp
src/ui/WebsiteInformationDialog.cpp
src/ui/WebsitePreferencesDialog.cpp
src/ui/WebWidget.cpp
src/ui/WidgetFactory.cpp
src/ui/Window.cpp
src/ui/WorkspaceWidget.cpp
src/ui/preferences/AcceptLanguageDialog.cpp
src/ui/preferences/CookiesExceptionsDialog.cpp
src/ui/preferences/JavaScriptPreferencesDialog.cpp
src/ui/preferences/KeyboardProfileDialog.cpp
src/ui/preferences/MouseProfileDialog.cpp
src/ui/preferences/PreferencesAdvancedPageWidget.cpp
src/ui/preferences/PreferencesContentPageWidget.cpp
src/ui/preferences/PreferencesGeneralPageWidget.cpp
src/ui/preferences/PreferencesPrivacyPageWidget.cpp
src/ui/preferences/PreferencesSearchPageWidget.cpp
src/ui/preferences/ProxyPropertiesDialog.cpp
src/ui/preferences/UserAgentPropertiesDialog.cpp
src/modules/backends/passwords/file/FilePasswordsStorageBackend.cpp
src/modules/importers/html/HtmlBookmarksImporter.cpp
src/modules/importers/opera/OperaBookmarksImporter.cpp
src/modules/importers/opera/OperaNotesImporter.cpp
src/modules/importers/opera/OperaSearchEnginesImporter.cpp
src/modules/importers/opera/OperaSessionImporter.cpp
src/modules/importers/opml/OpmlImporter.cpp
src/modules/importers/opml/OpmlImporterWidget.cpp
src/modules/widgets/action/ActionWidget.cpp
src/modules/widgets/address/AddressWidget.cpp
src/modules/widgets/bookmark/BookmarkWidget.cpp
src/modules/widgets/configurationOption/ConfigurationOptionWidget.cpp
src/modules/widgets/contentBlockingInformation/ContentBlockingInformationWidget.cpp
src/modules/widgets/errorConsole/ErrorConsoleWidget.cpp
src/modules/widgets/menuButton/MenuButtonWidget.cpp
src/modules/widgets/panelChooser/PanelChooserWidget.cpp
src/modules/widgets/privateWindowIndicator/PrivateWindowIndicatorWidget.cpp
src/modules/widgets/progressInformation/ProgressInformationWidget.cpp
src/modules/widgets/search/SearchWidget.cpp
src/modules/widgets/statusMessage/StatusMessageWidget.cpp
src/modules/widgets/transfers/TransfersWidget.cpp
src/modules/widgets/zoom/ZoomWidget.cpp
src/modules/windows/actions/ActionsContentsWidget.cpp
src/modules/windows/addons/AddonsContentsWidget.cpp
src/modules/windows/bookmarks/BookmarksContentsWidget.cpp
src/modules/windows/cache/CacheContentsWidget.cpp
src/modules/windows/configuration/ConfigurationContentsWidget.cpp
src/modules/windows/contentFilters/ContentFiltersContentsWidget.cpp
src/modules/windows/cookies/CookiesContentsWidget.cpp
src/modules/windows/history/HistoryContentsWidget.cpp
src/modules/windows/feeds/FeedsContentsWidget.cpp
src/modules/windows/links/LinksContentsWidget.cpp
src/modules/windows/notes/NotesContentsWidget.cpp
src/modules/windows/pageInformation/PageInformationContentsWidget.cpp
src/modules/windows/passwords/PasswordsContentsWidget.cpp
src/modules/windows/preferences/PreferencesContentsWidget.cpp
src/modules/windows/tabHistory/TabHistoryContentsWidget.cpp
src/modules/windows/transfers/TransfersContentsWidget.cpp
src/modules/windows/web/PasswordBarWidget.cpp
src/modules/windows/web/PermissionBarWidget.cpp
src/modules/windows/web/PopupsBarWidget.cpp
src/modules/windows/web/ProgressToolBarWidget.cpp
src/modules/windows/web/SearchBarWidget.cpp
src/modules/windows/web/SelectPasswordDialog.cpp
src/modules/windows/web/StartPageModel.cpp
src/modules/windows/web/StartPagePreferencesDialog.cpp
src/modules/windows/web/StartPageWidget.cpp
src/modules/windows/web/WebContentsWidget.cpp
src/modules/windows/windows/WindowsContentsWidget.cpp
3rdparty/columnresizer/ColumnResizer.cpp
3rdparty/mousegestures/MouseGestures.cpp
)
qt5_add_resources(otter_res
resources/resources.qrc
)
qt5_wrap_ui(otter_ui
src/ui/AcceptCookieDialog.ui
src/ui/AuthenticationDialog.ui
src/ui/BookmarkPropertiesDialog.ui
src/ui/BookmarksImporterWidget.ui
src/ui/CertificateDialog.ui
src/ui/ClearHistoryDialog.ui
src/ui/ContentBlockingProfileDialog.ui
src/ui/CookiePropertiesDialog.ui
src/ui/FeedPropertiesDialog.ui
src/ui/ImagePropertiesDialog.ui
src/ui/ImportDialog.ui
src/ui/LocaleDialog.ui
src/ui/MainWindow.ui
src/ui/MasterPasswordDialog.ui
src/ui/OpenAddressDialog.ui
src/ui/OpenBookmarkDialog.ui
src/ui/PreferencesDialog.ui
src/ui/ReloadTimeDialog.ui
src/ui/ReportDialog.ui
src/ui/SaveSessionDialog.ui
src/ui/SearchEnginePropertiesDialog.ui
src/ui/SessionsManagerDialog.ui
src/ui/SidebarWidget.ui
src/ui/StartupDialog.ui
src/ui/ToolBarDialog.ui
src/ui/TransferDialog.ui
src/ui/UpdateCheckerDialog.ui
src/ui/WebsiteInformationDialog.ui
src/ui/WebsitePreferencesDialog.ui
src/ui/preferences/AcceptLanguageDialog.ui
src/ui/preferences/CookiesExceptionsDialog.ui
src/ui/preferences/JavaScriptPreferencesDialog.ui
src/ui/preferences/KeyboardProfileDialog.ui
src/ui/preferences/MouseProfileDialog.ui
src/ui/preferences/PreferencesAdvancedPageWidget.ui
src/ui/preferences/PreferencesContentPageWidget.ui
src/ui/preferences/PreferencesGeneralPageWidget.ui
src/ui/preferences/PreferencesPrivacyPageWidget.ui
src/ui/preferences/PreferencesSearchPageWidget.ui
src/ui/preferences/ProxyPropertiesDialog.ui
src/ui/preferences/UserAgentPropertiesDialog.ui
src/modules/importers/opml/OpmlImporterWidget.ui
src/modules/widgets/errorConsole/ErrorConsoleWidget.ui
src/modules/windows/actions/ActionsContentsWidget.ui
src/modules/windows/addons/AddonsContentsWidget.ui
src/modules/windows/bookmarks/BookmarksContentsWidget.ui
src/modules/windows/cache/CacheContentsWidget.ui
src/modules/windows/configuration/ConfigurationContentsWidget.ui
src/modules/windows/contentFilters/ContentFiltersContentsWidget.ui
src/modules/windows/cookies/CookiesContentsWidget.ui
src/modules/windows/feeds/FeedsContentsWidget.ui
src/modules/windows/history/HistoryContentsWidget.ui
src/modules/windows/links/LinksContentsWidget.ui
src/modules/windows/notes/NotesContentsWidget.ui
src/modules/windows/pageInformation/PageInformationContentsWidget.ui
src/modules/windows/passwords/PasswordsContentsWidget.ui
src/modules/windows/preferences/PreferencesContentsWidget.ui
src/modules/windows/tabHistory/TabHistoryContentsWidget.ui
src/modules/windows/transfers/TransfersContentsWidget.ui
src/modules/windows/web/PasswordBarWidget.ui
src/modules/windows/web/PermissionBarWidget.ui
src/modules/windows/web/PopupsBarWidget.ui
src/modules/windows/web/SearchBarWidget.ui
src/modules/windows/web/SelectPasswordDialog.ui
src/modules/windows/web/StartPagePreferencesDialog.ui
src/modules/windows/windows/WindowsContentsWidget.ui
)
foreach(_current_dir ${Qt5Widgets_PRIVATE_INCLUDE_DIRS})
if (EXISTS "${_current_dir}/private/qpixmapfilter_p.h")
add_definitions(-DOTTER_ENABLE_STARTPAGEBLUR)
include_directories(${Qt5Widgets_PRIVATE_INCLUDE_DIRS})
break()
endif()
endforeach()
if (Qt5WebEngineWidgets_FOUND AND ENABLE_QTWEBENGINE)
add_definitions(-DOTTER_ENABLE_QTWEBENGINE)
list(APPEND OTTER_BACKENDS_WEB "QtWebEngine (experimental)")
set(otter_src
${otter_src}
src/modules/backends/web/qtwebengine/QtWebEnginePage.cpp
src/modules/backends/web/qtwebengine/QtWebEngineUrlRequestInterceptor.cpp
src/modules/backends/web/qtwebengine/QtWebEngineTransfer.cpp
src/modules/backends/web/qtwebengine/QtWebEngineWebBackend.cpp
src/modules/backends/web/qtwebengine/QtWebEngineWebWidget.cpp
)
qt5_add_resources(otter_res
src/modules/backends/web/qtwebengine/QtWebEngineResources.qrc
)
endif ()
if (Qt5WebKitWidgets_FOUND AND ENABLE_QTWEBKIT)
add_definitions(-DOTTER_ENABLE_QTWEBKIT -DQT_STATICPLUGIN)
list(APPEND OTTER_BACKENDS_WEB "QtWebKit")
set(otter_src
${otter_src}
src/modules/backends/web/qtwebkit/qwebkitplatformplugin.h
src/modules/backends/web/qtwebkit/QtWebKitCookieJar.cpp
src/modules/backends/web/qtwebkit/QtWebKitFtpListingNetworkReply.cpp
src/modules/backends/web/qtwebkit/QtWebKitHistoryInterface.cpp
src/modules/backends/web/qtwebkit/QtWebKitNetworkManager.cpp
src/modules/backends/web/qtwebkit/QtWebKitNotificationPresenter.cpp
src/modules/backends/web/qtwebkit/QtWebKitPage.cpp
src/modules/backends/web/qtwebkit/QtWebKitPlugin.cpp
src/modules/backends/web/qtwebkit/QtWebKitPluginFactory.cpp
src/modules/backends/web/qtwebkit/QtWebKitPluginWidget.cpp
src/modules/backends/web/qtwebkit/QtWebKitWebBackend.cpp
src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp
src/modules/backends/web/qtwebkit/3rdparty/qtftp/qftp.cpp
src/modules/backends/web/qtwebkit/3rdparty/qtftp/qurlinfo.cpp
)
if (HUNSPELL_FOUND AND ENABLE_SPELLCHECK)
set(otter_src
${otter_src}
src/modules/backends/web/qtwebkit/QtWebKitSpellChecker.cpp
)
endif ()
qt5_add_resources(otter_res
src/modules/backends/web/qtwebkit/QtWebKitResources.qrc
)
endif ()
if (ENABLE_CRASHREPORTS)
add_definitions(-DOTTER_ENABLE_CRASHREPORTS)
include_directories(${CMAKE_SOURCE_DIR}/3rdparty/breakpad/src/)
if (WIN32)
set(otter_src
${otter_src}
3rdparty/breakpad/src/common/windows/guid_string.cc
3rdparty/breakpad/src/client/windows/crash_generation/crash_generation_client.cc
3rdparty/breakpad/src/client/windows/handler/exception_handler.cc
)
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(otter_src
${otter_src}
3rdparty/breakpad/src/client/minidump_file_writer.cc
3rdparty/breakpad/src/client/linux/crash_generation/crash_generation_client.cc
3rdparty/breakpad/src/client/linux/dump_writer_common/thread_info.cc
3rdparty/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
3rdparty/breakpad/src/client/linux/handler/exception_handler.cc
3rdparty/breakpad/src/client/linux/handler/minidump_descriptor.cc
3rdparty/breakpad/src/client/linux/log/log.cc
3rdparty/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
3rdparty/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
3rdparty/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
3rdparty/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
3rdparty/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
3rdparty/breakpad/src/common/convert_UTF.c
3rdparty/breakpad/src/common/md5.cc
3rdparty/breakpad/src/common/string_conversion.cc
3rdparty/breakpad/src/common/linux/elf_core_dump.cc
3rdparty/breakpad/src/common/linux/elfutils.cc
3rdparty/breakpad/src/common/linux/file_id.cc
3rdparty/breakpad/src/common/linux/guid_creator.cc
3rdparty/breakpad/src/common/linux/linux_libc_support.cc
3rdparty/breakpad/src/common/linux/memory_mapped_file.cc
3rdparty/breakpad/src/common/linux/safe_readlink.cc
)
endif ()
endif ()
if (HUNSPELL_FOUND AND ENABLE_SPELLCHECK)
add_definitions(-DOTTER_ENABLE_SPELLCHECK)
include_directories(${HUNSPELL_INCLUDE_DIR})
set(otter_src
${otter_src}
3rdparty/sonnet/src/core/client.cpp
3rdparty/sonnet/src/core/loader.cpp
3rdparty/sonnet/src/core/speller.cpp
3rdparty/sonnet/src/core/spellerplugin.cpp
3rdparty/sonnet/src/core/settings.cpp
3rdparty/sonnet/src/core/textbreaks.cpp
3rdparty/sonnet/src/core/tokenizer.cpp
3rdparty/sonnet/src/ui/highlighter.cpp
3rdparty/sonnet/src/plugins/hunspell/hunspellclient.cpp
3rdparty/sonnet/src/plugins/hunspell/hunspelldebug.cpp
3rdparty/sonnet/src/plugins/hunspell/hunspelldict.cpp
)
endif ()
if (WIN32)
add_definitions(-DUNICODE -D_UNICODE)
find_package(Qt5WinExtras 5.6.0 QUIET)
if (MSVC)
set(CMAKE_PREFIX_PATH $ENV{QTDIR})
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MP")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MP /GL /Zi")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG /DEBUG /OPT:REF")
if (CMAKE_CL_64)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:\"mainCRTStartup\"")
else ()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,5.01 /ENTRY:\"mainCRTStartup\"")
endif ()
endif ()
set(otter_src
${otter_src}
otter-browser.rc
src/modules/platforms/windows/WindowsPlatformIntegration.cpp
src/modules/platforms/windows/WindowsPlatformStyle.cpp
)
elseif (APPLE)
find_package(Qt5MacExtras 5.6.0 QUIET)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.10)
set(MACOSX_BUNDLE_BUNDLE_NAME "Otter Browser")
set(MACOSX_BUNDLE_BUNDLE_VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION})
set(MACOSX_BUNDLE_LONG_VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION})
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION})
set(MACOSX_BUNDLE_ICON_FILE otter-browser.icns)
set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.otter-browser.otter-browser")
set(MACOSX_BUNDLE_COPYRIGHT "Copyright (C) 2013-2020 Otter Browser Team. All rights reserved.")
set(otter_src
${otter_src}
src/modules/platforms/mac/MacPlatformIntegration.mm
src/modules/platforms/mac/MacPlatformStyle.cpp
resources/icons/otter-browser.icns
)
set_source_files_properties(resources/icons/otter-browser.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
elseif (UNIX)
find_package(Qt5DBus 5.6.0 QUIET)
if (Qt5DBus_FOUND AND ENABLE_DBUS)
add_definitions(-DOTTER_ENABLE_DBUS)
endif ()
set(otter_src
${otter_src}
src/modules/platforms/freedesktoporg/FreeDesktopOrgPlatformIntegration.cpp
src/modules/platforms/freedesktoporg/FreeDesktopOrgPlatformStyle.cpp
3rdparty/libmimeapps/ConfigReader.cpp
3rdparty/libmimeapps/DesktopEntry.cpp
3rdparty/libmimeapps/Index.cpp
3rdparty/libmimeapps/Tools.cpp
)
endif ()
add_executable(otter-browser WIN32 MACOSX_BUNDLE
${otter_ui}
${otter_res}
${otter_src}
)
if (Qt5WebEngineWidgets_FOUND AND ENABLE_QTWEBENGINE)
target_link_libraries(otter-browser Qt5::WebEngineCore Qt5::WebEngineWidgets)
endif ()
if (Qt5WebKitWidgets_FOUND AND ENABLE_QTWEBKIT)
target_link_libraries(otter-browser Qt5::WebKit Qt5::WebKitWidgets)
endif ()
if (HUNSPELL_FOUND AND ENABLE_SPELLCHECK)
target_link_libraries(otter-browser ${HUNSPELL_LIBRARIES})
endif ()
if (WIN32)
target_link_libraries(otter-browser Qt5::WinExtras ole32 shell32 advapi32 user32)
elseif (APPLE)
find_library(FRAMEWORK_Cocoa Cocoa)
find_library(FRAMEWORK_Foundation Foundation)
set_target_properties(otter-browser PROPERTIES OUTPUT_NAME "Otter Browser")
target_link_libraries(otter-browser Qt5::MacExtras ${FRAMEWORK_Cocoa} ${FRAMEWORK_Foundation})
elseif (UNIX)
if (Qt5DBus_FOUND AND ENABLE_DBUS)
target_link_libraries(otter-browser Qt5::DBus)
endif ()
if (ENABLE_CRASHREPORTS)
target_link_libraries(otter-browser -lpthread)
endif ()
endif ()
target_link_libraries(otter-browser Qt5::Core Qt5::Gui Qt5::Multimedia Qt5::Network Qt5::PrintSupport Qt5::Qml Qt5::Svg Qt5::Widgets)
set(XDG_APPS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications CACHE FILEPATH "Install path for .desktop files")
file(GLOB _qm_files resources/translations/*.qm)
foreach(_current_QM_FILE ${_qm_files})
install(FILES ${_current_QM_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/otter-browser/locale/)
if (APPLE)
file(COPY ${_current_QM_FILE} DESTINATION "Otter Browser.app/Contents/Resources/locale/")
endif()
endforeach()
install(FILES resources/icons/otter-browser-16.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/16x16/apps/ RENAME otter-browser.png)
install(FILES resources/icons/otter-browser-32.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/32x32/apps/ RENAME otter-browser.png)
install(FILES resources/icons/otter-browser-48.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps/ RENAME otter-browser.png)
install(FILES resources/icons/otter-browser-64.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/64x64/apps/ RENAME otter-browser.png)
install(FILES resources/icons/otter-browser-128.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/128x128/apps/ RENAME otter-browser.png)
install(FILES resources/icons/otter-browser-256.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps/ RENAME otter-browser.png)
install(FILES otter-browser.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES man/otter-browser.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/)
install(TARGETS otter-browser DESTINATION bin/)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
list(LENGTH OTTER_BACKENDS_WEB OTTER_BACKENDS_WEB_LENGTH)
if (${OTTER_BACKENDS_WEB_LENGTH} EQUAL 0)
message(SEND_ERROR "No web backends available!")
else ()
set(OTTER_BACKENDS_WEB_SUMMARY "The following web backends will be built:\n\n")
foreach(_backend ${OTTER_BACKENDS_WEB})
set(OTTER_BACKENDS_WEB_SUMMARY "${OTTER_BACKENDS_WEB_SUMMARY} * ${_backend}\n")
endforeach(_backend)
message(STATUS ${OTTER_BACKENDS_WEB_SUMMARY})
endif ()