File: CMakeLists.txt

package info (click to toggle)
kate 4:18.08.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 30,500 kB
  • sloc: xml: 87,988; cpp: 38,094; ansic: 1,805; sh: 95; makefile: 23
file content (154 lines) | stat: -rw-r--r-- 4,584 bytes parent folder | download
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
#
# The Kate Application
#
project(kate)

# Load the frameworks we need
find_package(KF5 REQUIRED COMPONENTS DBusAddons GuiAddons)

# includes
include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/session
  ${CMAKE_CURRENT_SOURCE_DIR}/qtsingleapplication
)

# collect the needed source files
set (KATE_LIBRARY_SRCS
   kateappadaptor.cpp
   kateapp.cpp
   kateconfigdialog.cpp
   kateconfigplugindialogpage.cpp
   katedocmanager.cpp
   katemainwindow.cpp
   katepluginmanager.cpp
   kateviewmanager.cpp
   kateviewspace.cpp
   katesavemodifieddialog.cpp
   katemwmodonhddialog.cpp
   katecolorschemechooser.cpp

   katetabbutton.cpp
   katetabbar.cpp

   # session
   session/katesessionchooser.cpp
   session/katesessionsaction.cpp
   session/katesessionmanager.cpp
   session/katesessionmanagedialog.cpp
   session/katesessionopendialog.cpp
   session/katesession.cpp

   katemdi.cpp
   katerunninginstanceinfo.cpp
   katequickopen.cpp
   katewaiter.h
)

ki18n_wrap_ui(KATE_LIBRARY_SRCS
    ui/sessionconfigwidget.ui
)

qt5_add_resources( KATE_LIBRARY_SRCS data/kate.qrc )

add_library(kdeinit_kate STATIC ${KATE_LIBRARY_SRCS})
target_link_libraries(kdeinit_kate
PUBLIC
    KF5::TextEditor
    KF5::I18n
    KF5::IconThemes
    KF5::WindowSystem
    KF5::GuiAddons
    KF5::DBusAddons
    KF5::Crash)

if(KF5Activities_FOUND)
    target_link_libraries(kdeinit_kate
    PUBLIC
    KF5::Activities)
endif()

generate_export_header(kdeinit_kate
  EXPORT_FILE_NAME kateprivate_export.h
  EXPORT_MACRO_NAME KATE_TESTS_EXPORT
)

# collect icons
set(KATE_ICONS_PNG
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/16-apps-kate.png
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/22-apps-kate.png
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/32-apps-kate.png
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/48-apps-kate.png
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/64-apps-kate.png
    ${CMAKE_CURRENT_SOURCE_DIR}/icons/128-apps-kate.png
)

set(KATE_ICONS_SVG
${CMAKE_CURRENT_SOURCE_DIR}/icons/sc-apps-kate.svgz
)

# application only sources
set (KATE_APP_SRCS
    main.cpp
)

# use single application instead of dbus on mac + windows
if (APPLE OR WIN32)
    set(singleapp_SRCS
        qtsingleapplication/qtlocalpeer.cpp
        qtsingleapplication/qtsingleapplication.cpp
        qtsingleapplication/qtlockedfile.cpp
    )

    if(WIN32)
        set(singleapp_SRCS ${singleapp_SRCS} qtsingleapplication/qtlockedfile_win.cpp)
    else()
        set(singleapp_SRCS ${singleapp_SRCS} qtsingleapplication/qtlockedfile_unix.cpp)
    endif()

    add_definitions("-DUSE_QT_SINGLE_APP")

    set(KATE_APP_SRCS ${KATE_APP_SRCS} ${singleapp_SRCS})
endif()

# add icons to application sources, to have them bundled
ecm_add_app_icon(KATE_APP_SRCS ICONS ${KATE_ICONS_PNG})

# create executable
add_executable(kate ${KATE_APP_SRCS})
target_link_libraries(kate kdeinit_kate)

# own plist magic for mac os
if(APPLE)
    # own plist template
    set_target_properties (kate PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/data/MacOSXBundleInfo.plist.in)

    # the MacOSX bundle display name property (CFBundleDisplayName) is not currently supported by cmake,
    # so has to be set for all targets in this cmake file
    set(MACOSX_BUNDLE_DISPLAY_NAME Kate)
    set_target_properties(kate PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.kde.Kate")
    set_target_properties(kate PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Kate")
    set_target_properties(kate PROPERTIES MACOSX_BUNDLE_DISPLAY_NAME "Kate")
    set_target_properties(kate PROPERTIES MACOSX_BUNDLE_INFO_STRING "Kate - Advanced Text Editor")
    set_target_properties(kate PROPERTIES MACOSX_BUNDLE_LONG_VERSION_STRING "Kate ${KDE_APPLICATIONS_VERSION}")
    set_target_properties(kate PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}")
    set_target_properties(kate PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION "${KDE_APPLICATIONS_VERSION}")
    set_target_properties(kate PROPERTIES MACOSX_BUNDLE_COPYRIGHT "2000-2016 The Kate Authors")
endif()

# install executable
install(TARGETS kate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})

# desktop file
install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/data/org.kde.kate.desktop  DESTINATION  ${XDG_APPS_INSTALL_DIR})

# appdata
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.kde.kate.appdata.xml DESTINATION  ${CMAKE_INSTALL_METAINFODIR})

# install icons
ecm_install_icons(ICONS ${KATE_ICONS_PNG} ${KATE_ICONS_SVG} DESTINATION ${ICON_INSTALL_DIR} THEME hicolor)

# automatic unit tests
if (BUILD_TESTING)
    add_subdirectory(autotests)
endif()