CMakeLists.txt 10.3 KB
Newer Older
Alex Richardson's avatar
Alex Richardson committed
1
# cmake-options : -DCMAKE_DISABLE_FIND_PACKAGE_LibKonq=TRUE or FALSE; default is FALSE
2

Lukáš Tinkl's avatar
Lukáš Tinkl committed
3
4
add_definitions(-DTRANSLATION_DOMAIN=\"konsole\")

5
6
7
8
9
10
11
### Handle DragonFlyBSD here instead of using __DragonFly__
IF(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
  set(HAVE_OS_DRAGONFLYBSD 1)
else()
  set(HAVE_OS_DRAGONFLYBSD 0)
endif()

12
13
14
15
IF(NOT (${KF5_VERSION} VERSION_LESS "5.60.0"))
    set(USE_TERMINALINTERFACEV2 1)
endif()

16
include(CheckIncludeFiles)
17
include(ECMAddAppIcon)
18

19
20
configure_file(config-konsole.h.cmake
              ${CMAKE_CURRENT_BINARY_DIR}/config-konsole.h)
21

22
### Tests
Kurt Hindenburg's avatar
Kurt Hindenburg committed
23
24
25
26
27
if(BUILD_TESTING)
  find_package(Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED)
  add_subdirectory(autotests)
  add_subdirectory(tests)
endif()
28

29
### Security concerns about sendText and runCommand dbus methods being public
30
option(REMOVE_SENDTEXT_RUNCOMMAND_DBUS_METHODS "Konsole: remove sendText and runCommand dbus methods" OFF)
31

32
33
### Development tools
option(KONSOLE_BUILD_UNI2CHARACTERWIDTH "Konsole: build uni2characterwidth executable" OFF)
34

35
### Konsole source files shared between embedded terminal and main application
36
37
38
39
# qdbuscpp2xml -m  Session.h -o org.kde.konsole.Session.xml
# qdbuscpp2xml -M -s ViewManager.h -o org.kde.konsole.Konsole.xml

# Generate dbus .xml files; do not store .xml in source folder
Kurt Hindenburg's avatar
Kurt Hindenburg committed
40
qt5_generate_dbus_interface(ViewManager.h org.kde.konsole.Window.xml OPTIONS -m)
41

Kurt Hindenburg's avatar
Kurt Hindenburg committed
42
qt5_add_dbus_adaptor(windowadaptors_SRCS
43
44
45
46
                    ${CMAKE_CURRENT_BINARY_DIR}/org.kde.konsole.Window.xml
                    ViewManager.h
                    Konsole::ViewManager)

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

set(konsole_LIBS
    KF5::XmlGui
    Qt5::PrintSupport
    Qt5::Xml
    KF5::Notifications
    KF5::WindowSystem
    KF5::TextWidgets
    KF5::GuiAddons
    KF5::IconThemes
    KF5::Bookmarks
    KF5::I18n
    KF5::Pty
    KF5::KIOWidgets
    KF5::DBusAddons
    KF5::GlobalAccel
    KF5::NewStuff
)

if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
    #kinfo_getfile() is in libutil
    list(APPEND konsole_LIBS util)
endif()

71
# TODO: Move this to an internal folder if it grows too much.
72
73
# This konsoleprivate_core is the "core" library that depends in nothing from konsole itself
# so we can start to detangle the codebase.
74
75
76
77
78
set(konsoleprivate_core_SRCS
    ShellCommand.cpp
    WindowSystemInfo.cpp
)

79
80
81
82
83
84
85
ecm_qt_declare_logging_category(
    konsoleprivate_core_SRCS
    HEADER konsoledebug.h
    IDENTIFIER KonsoleDebug
    CATEGORY_NAME org.kde.konsole
)

86
87
88
add_library(konsoleprivate_core STATIC ${konsoleprivate_core_SRCS})
target_link_libraries(konsoleprivate_core ${konsole_LIBS})

89
90
91
92
93
94
95
96
97
98
99
100
set(konsolehelpers_SRCS
    LabelsAligner.cpp
)
add_library(konsolehelpers
    STATIC
    ${konsolehelpers_SRCS}
)
target_link_libraries(konsolehelpers
    Qt5::Core
    Qt5::Widgets
)

101
add_subdirectory(colorscheme)
102
add_subdirectory(keyboardtranslator)
103
add_subdirectory(profile)
104
add_subdirectory(session)
Gustavo Carneiro's avatar
Gustavo Carneiro committed
105
add_subdirectory(characters)
106

107
set(konsoleprivate_SRCS ${windowadaptors_SRCS}
108
                        BookmarkHandler.cpp
109
                        BookmarkMenu.cpp
110
                        CheckableSessionModel.cpp
111
112
                        CompositeWidgetFocusWatcher.cpp
                        CopyInputDialog.cpp
113
                        Emulation.cpp
114
                        EscapeSequenceUrlExtractor.cpp
115
116
117
118
119
120
121
                        ExtendedCharTable.cpp
                        FontDialog.cpp
                        HTMLDecoder.cpp
                        HistorySizeDialog.cpp
                        KeyBindingEditor.cpp
                        LabelsAligner.cpp
                        NullProcessInfo.cpp
122
                        NullProcessInfo.cpp
123
124
                        PlainTextDecoder.cpp
                        PrintOptions.cpp
125
                        PrintOptions.cpp
126
                        ProcessInfo.cpp
127
128
                        ProcessInfo.cpp
                        Pty.cpp
129
130
131
132
133
134
135
136
137
138
139
140
141
                        Pty.cpp
                        RenameTabDialog.cpp
                        SSHProcessInfo.cpp
                        SaveHistoryTask.cpp
                        Screen.cpp
                        ScreenWindow.cpp
                        ScrollState.cpp
                        SearchHistoryTask.cpp
                        ShouldApplyProperty.cpp
                        UnixProcessInfo.cpp
                        ViewManager.cpp
                        ViewProperties.cpp
                        Vt102Emulation.cpp
142
                        WindowSystemInfo.cpp
143
                        ZModemDialog.cpp
144
145
                        filterHotSpots/EscapeSequenceUrlFilter.cpp
                        filterHotSpots/EscapeSequenceUrlFilterHotSpot.cpp
146
147
148
                        filterHotSpots/FileFilter.cpp
                        filterHotSpots/FileFilterHotspot.cpp
                        filterHotSpots/Filter.cpp
149
                        filterHotSpots/FilterChain.cpp
150
151
152
153
154
155
                        filterHotSpots/HotSpot.cpp
                        filterHotSpots/RegExpFilter.cpp
                        filterHotSpots/RegExpFilterHotspot.cpp
                        filterHotSpots/TerminalImageFilterChain.cpp
                        filterHotSpots/UrlFilter.cpp
                        filterHotSpots/UrlFilterHotspot.cpp
156
157
158
159
                        history/HistoryFile.cpp
                        history/HistoryScroll.cpp
                        history/HistoryScrollFile.cpp
                        history/HistoryScrollNone.cpp
160
161
162
                        history/HistoryType.cpp
                        history/HistoryTypeFile.cpp
                        history/HistoryTypeNone.cpp
163
164
165
166
167
                        history/compact/CompactHistoryBlock.cpp
                        history/compact/CompactHistoryBlockList.cpp
                        history/compact/CompactHistoryLine.cpp
                        history/compact/CompactHistoryScroll.cpp
                        history/compact/CompactHistoryType.cpp
168
                        widgets/DetachableTabBar.cpp
169
                        widgets/DetachableTabBar.cpp
170
171
                        widgets/EditProfileDialog.cpp
                        widgets/HistorySizeWidget.cpp
172
                        widgets/HistorySizeWidget.cpp
173
                        widgets/IncrementalSearchBar.cpp
174
175
                        widgets/IncrementalSearchBar.cpp
                        widgets/RenameTabWidget.cpp
176
                        widgets/RenameTabWidget.cpp
177
                        widgets/TabTitleFormatButton.cpp
178
                        
179
                        terminalDisplay/TerminalDisplay.cpp
180
                        terminalDisplay/TerminalPainter.cpp
181
                        terminalDisplay/TerminalScrollBar.cpp
182
                        terminalDisplay/AutoScrollHandler.cpp
183

184
185
186
187
                        widgets/TerminalDisplayAccessible.cpp
                        widgets/TerminalHeaderBar.cpp
                        widgets/ViewContainer.cpp
                        widgets/ViewSplitter.cpp
188
189
                        widgets/KonsolePrintManager.cpp
                        ${CMAKE_CURRENT_BINARY_DIR}/org.kde.konsole.Window.xml)
190
191
192

kconfig_add_kcfg_files(konsoleprivate_SRCS settings/KonsoleSettings.kcfgc)

193
### Konsole Application
194

195
196
197
ki18n_wrap_ui(konsoleprivate_SRCS
    CopyInputDialog.ui
    HistorySizeDialog.ui
198
    KeyBindingEditor.ui
199
    PrintOptions.ui       # Temporary to build session static library
200
    RenameTabDialog.ui
201
202
203
204
    settings/GeneralSettings.ui
    settings/PartInfo.ui
    settings/ProfileSettings.ui
    settings/TabBarSettings.ui
205
    settings/TemporaryFilesSettings.ui
206
    settings/ThumbnailsSettings.ui
207
208
209
210
211
212
213
214
215
    widgets/EditProfileAdvancedPage.ui
    widgets/EditProfileAppearancePage.ui
    widgets/EditProfileGeneralPage.ui
    widgets/EditProfileKeyboardPage.ui
    widgets/EditProfileMousePage.ui
    widgets/EditProfileScrollingPage.ui
    widgets/EditProfileTabsPage.ui
    widgets/HistorySizeWidget.ui
    widgets/RenameTabWidget.ui
216
)
217

218
219
220
# add the resource files for the ui files
qt5_add_resources( konsoleprivate_SRCS ../desktop/konsole.qrc)

221
add_library(konsoleprivate ${konsoleprivate_SRCS})
Laurent Montel's avatar
Laurent Montel committed
222
generate_export_header(konsoleprivate BASE_NAME konsoleprivate)
223
224
225
226

target_link_libraries(konsoleprivate
    PUBLIC
    konsoleprivate_core
227
    konsolecolorscheme
228
    keyboardtranslator
229
    konsolehelpers
230
    konsolesession
231
    konsoleprofile
Gustavo Carneiro's avatar
Gustavo Carneiro committed
232
    konsolecharacters
233
234
    ${konsole_LIBS}
)
235

236
237
238
239
240
set_target_properties(konsoleprivate PROPERTIES
    VERSION ${KONSOLEPRIVATE_VERSION_STRING}
    SOVERSION ${KONSOLEPRIVATE_SOVERSION}
)

241
install(TARGETS konsoleprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
242

243
244
245
246
set(konsole_KDEINIT_SRCS
   Application.cpp
   MainWindow.cpp
   main.cpp
247
   settings/ConfigurationDialog.cpp
248
   settings/ConfigDialogButtonGroupManager.cpp
249
   settings/TemporaryFilesSettings.cpp
250
   settings/GeneralSettings.cpp
251
   settings/ProfileSettings.cpp
252
253
   settings/TabBarSettings.cpp
   settings/ThumbnailsSettings.cpp
Tomaz  Canabrava's avatar
Tomaz Canabrava committed
254
   delegates/ProfileShortcutDelegate.cpp
255
)
256
257


258
259
# Sets the icon on Windows and OSX
ecm_add_app_icon(kdeinit_konsole ICONS ${ICONS_SRCS})
260

Kurt Hindenburg's avatar
Kurt Hindenburg committed
261
kf5_add_kdeinit_executable(konsole ${konsole_KDEINIT_SRCS})
262
263
264
265
266
267
target_link_libraries(kdeinit_konsole
  konsoleprofile
  konsoleprivate
  KF5::XmlGui
  KF5::WindowSystem
  KF5::Bookmarks
Aurélien Gâteau's avatar
Aurélien Gâteau committed
268
  KF5::I18n
Stephen Kelly's avatar
Stephen Kelly committed
269
  KF5::KIOWidgets
Aurélien Gâteau's avatar
Aurélien Gâteau committed
270
  KF5::NotifyConfig
271
  KF5::Crash
Stephen Kelly's avatar
Stephen Kelly committed
272
)
273

274
275
276
277
278
279
if(APPLE)
    set_target_properties(konsole PROPERTIES
        MACOSX_BUNDLE_GUI_IDENTIFIER "org.kde.konsole"
        MACOSX_BUNDLE_BUNDLE_NAME "Konsole"
        MACOSX_BUNDLE_DISPLAY_NAME "Konsole"
        MACOSX_BUNDLE_INFO_STRING "Konsole, the KDE terminal emulator"
280
281
282
        MACOSX_BUNDLE_LONG_VERSION_STRING "Konsole ${RELEASE_SERVICE_VERSION}"
        MACOSX_BUNDLE_SHORT_VERSION_STRING "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}"
        MACOSX_BUNDLE_BUNDLE_VERSION "${RELEASE_SERVICE_VERSION}"
Kurt Hindenburg's avatar
Kurt Hindenburg committed
283
        MACOSX_BUNDLE_COPYRIGHT "1997-2020 The Konsole Developers")
284
285
endif()

286
install(TARGETS kdeinit_konsole konsole
287
       ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
288
289

### Embedded Konsole KPart
290

291
set(konsolepart_PART_SRCS Part.cpp
292
    settings/PartInfo.cpp
Tomaz  Canabrava's avatar
Tomaz Canabrava committed
293
294
295
296
    settings/ProfileSettings.cpp
    delegates/ProfileShortcutDelegate.cpp
)

297
add_library(konsolepart MODULE ${konsolepart_PART_SRCS})
298
generate_export_header(konsolepart BASE_NAME konsole)
299
kcoreaddons_desktop_to_json(konsolepart ../desktop/konsolepart.desktop)
300
set_target_properties(konsolepart PROPERTIES DEFINE_SYMBOL KONSOLE_PART)
301
302
303
304
305
306
target_link_libraries(konsolepart
    KF5::Parts
    KF5::XmlGui
    konsoleprofile
    konsoleprivate
)
307
install(TARGETS konsolepart  DESTINATION ${KDE_INSTALL_PLUGINDIR})
308