File: CMakeLists.txt

package info (click to toggle)
webkit2gtk 2.50.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 445,712 kB
  • sloc: cpp: 3,798,329; javascript: 197,914; ansic: 161,339; python: 49,141; asm: 21,987; ruby: 18,540; perl: 16,723; xml: 4,623; yacc: 2,360; sh: 2,246; java: 2,019; lex: 1,327; pascal: 366; makefile: 300
file content (277 lines) | stat: -rw-r--r-- 10,519 bytes parent folder | download | duplicates (2)
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
set_property(DIRECTORY . PROPERTY FOLDER "WPEPlatform")

set(WPE_PLATFORM_MODULE_DIR ${LIB_INSTALL_DIR}/wpe-platform-${WPE_API_VERSION}/modules)
add_definitions(-DWPE_PLATFORM_MODULE_DIR="${WPE_PLATFORM_MODULE_DIR}")

file(MAKE_DIRECTORY ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe)

configure_file(wpe-platform.pc.in ${CMAKE_BINARY_DIR}/wpe-platform-${WPE_API_VERSION}.pc @ONLY)
configure_file(wpe-platform-uninstalled.pc.in ${CMAKE_BINARY_DIR}/wpe-platform-${WPE_API_VERSION}-uninstalled.pc @ONLY)
configure_file(wpe/WPEConfig.h.in ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEConfig.h)
configure_file(wpe/WPEVersion.h.in ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEVersion.h)

set(WPEPlatform_SOURCES
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEBuffer.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferAndroid.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferDMABuf.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferDMABufFormats.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferSHM.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEClipboard.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEColor.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPECursorTheme.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEDRMDevice.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEDisplay.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEEGLError.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEEvent.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEExtensions.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEGamepad.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEGamepadManager.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEInputMethodContext.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEInputMethodContextNone.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEKeyUnicode.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEKeymap.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEKeymapXKB.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEGestureController.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEGestureControllerImpl.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEGestureDetector.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPERectangle.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEScreen.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEScreenSyncObserver.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPESettings.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEToplevel.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEVersion.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEView.cpp
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEViewAccessible.cpp
    ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEEnumTypes.cpp
)

set(WPEPlatform_INSTALLED_HEADERS
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEBuffer.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferAndroid.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferDMABuf.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferDMABufFormats.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEBufferSHM.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEClipboard.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEColor.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEDRMDevice.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEDefines.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEDisplay.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEEGLError.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEEvent.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEGamepad.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEGamepadManager.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEInputMethodContext.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEKeyUnicode.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEKeymap.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEKeymapXKB.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEKeysyms.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEGestureController.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPERectangle.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEScreen.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEScreenSyncObserver.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPESettings.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEToplevel.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEView.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/WPEViewAccessible.h
    ${WEBKIT_DIR}/WPEPlatform/wpe/wpe-platform.h
    ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEConfig.h
    ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEEnumTypes.h
    ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEVersion.h
)

set(WPEPlatform_ENUM_GENERATION_HEADERS ${WPEPlatform_INSTALLED_HEADERS})
list(REMOVE_ITEM WPEPlatform_ENUM_GENERATION_HEADERS ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEEnumTypes.h)
add_custom_command(
    OUTPUT ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEEnumTypes.h
    DEPENDS ${WPEPlatform_ENUM_GENERATION_HEADERS}
    COMMAND glib-mkenums --template ${WEBKIT_DIR}/WPEPlatform/wpe/WPEEnumTypes.h.in ${WPEPlatform_ENUM_GENERATION_HEADERS} | sed s/w_pe/wpe/ | sed s/WPE_TYPE_PE/WPE_TYPE/ | sed s/WPE_TYPEEGL/WPE_TYPE_EGL/ | sed s/wpeegl/wpe_egl/ > ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEEnumTypes.h
    VERBATIM
)
add_custom_command(
    OUTPUT ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEEnumTypes.cpp
    DEPENDS ${WPEPlatform_ENUM_GENERATION_HEADERS}
    COMMAND glib-mkenums --template ${WEBKIT_DIR}/WPEPlatform/wpe/WPEEnumTypes.cpp.in ${WPEPlatform_ENUM_GENERATION_HEADERS} | sed s/w_pe/wpe/ | sed s/WPE_TYPE_PE/WPE_TYPE/ | sed s/WPE_TYPEEGL/WPE_TYPE_GL/ | sed s/wpeegl/wpe_egl/ > ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEEnumTypes.cpp
    VERBATIM
)
add_custom_target(WPEPlatformGeneratedEnumTypesHeader
    DEPENDS ${WPEPlatform_DERIVED_SOURCES_DIR}/wpe/WPEEnumTypes.h
)

set(WPEPlatform_PRIVATE_INCLUDE_DIRECTORIES
    "${CMAKE_BINARY_DIR}"
    "${WPEPlatform_DERIVED_SOURCES_DIR}"
    "${WPEPlatform_DERIVED_SOURCES_DIR}/wpe"
    "${WEBKIT_DIR}/WPEPlatform"
    "${WEBKIT_DIR}/WPEPlatform/wpe"
    "${WTF_FRAMEWORK_HEADERS_DIR}"
)

set(WPEPlatform_SYSTEM_INCLUDE_DIRECTORIES
    ${GLIB_INCLUDE_DIRS}
)

set(WPEPlatform_LIBRARIES
    Epoxy::Epoxy
    WTF
    ${GLIB_GIO_LIBRARIES}
    ${GLIB_GOBJECT_LIBRARIES}
    ${GLIB_LIBRARIES}
    ${LIBXKBCOMMON_LIBRARIES}
)

if (USE_GBM)
    list(APPEND WPEPlatform_LIBRARIES GBM::GBM)
endif ()

if (USE_LIBDRM)
    list(APPEND WPEPlatform_LIBRARIES LibDRM::LibDRM)

    list(APPEND WPEPlatform_SOURCES
        ${WEBKIT_DIR}/WPEPlatform/wpe/WPEScreenSyncObserverDRM.cpp
    )
endif ()

if (ANDROID)
    list(APPEND WPEPlatform_LIBRARIES Android::Android)
endif ()

if (USE_ATK)
    list(APPEND WPEPlatform_SYSTEM_INCLUDE_DIRECTORIES
        ${ATK_INCLUDE_DIRS}
    )

    list(APPEND WPEPlatform_PRIVATE_INCLUDE_DIRECTORIES
        "${WEBKIT_DIR}/WPEPlatform/wpe/atk"
    )

    list(APPEND WPEPlatform_LIBRARIES
        ATK::Bridge
        ${ATK_LIBRARIES}
    )

    list(APPEND WPEPlatform_SOURCES
        ${WEBKIT_DIR}/WPEPlatform/wpe/atk/WPEAccessibilityAtk.cpp
        ${WEBKIT_DIR}/WPEPlatform/wpe/atk/WPEApplicationAccessibleAtk.cpp
        ${WEBKIT_DIR}/WPEPlatform/wpe/atk/WPEToplevelAccessibleAtk.cpp
        ${WEBKIT_DIR}/WPEPlatform/wpe/atk/WPEViewAccessibleAtk.cpp
    )
endif ()

if (USE_MANETTE)
    list(APPEND WPEPlatform_LIBRARIES
        Manette::Manette
    )

    list(APPEND WPEPlatform_SOURCES
        ${WEBKIT_DIR}/WPEPlatform/wpe/WPEGamepadManagerManette.cpp
        ${WEBKIT_DIR}/WPEPlatform/wpe/WPEGamepadManette.cpp
    )
endif ()

if (NOT USE_SYSTEM_MALLOC)
   list(APPEND WPEPlatform_LIBRARIES bmalloc)
endif ()

if (ENABLE_WPE_PLATFORM_DRM)
    add_subdirectory(${WEBKIT_DIR}/WPEPlatform/wpe/drm)
    list(APPEND WPEPlatform_LIBRARIES WPEPlatformDRM)
endif ()

if (ENABLE_WPE_PLATFORM_HEADLESS)
    add_subdirectory(${WEBKIT_DIR}/WPEPlatform/wpe/headless)
    list(APPEND WPEPlatform_LIBRARIES WPEPlatformHeadless)
endif ()

if (ENABLE_WPE_PLATFORM_WAYLAND)
    add_subdirectory(${WEBKIT_DIR}/WPEPlatform/wpe/wayland)
    list(APPEND WPEPlatform_LIBRARIES WPEPlatformWayland)
endif ()

add_library(WPEPlatform OBJECT ${WPEPlatform_SOURCES})
target_include_directories(WPEPlatform PRIVATE ${WPEPlatform_PRIVATE_INCLUDE_DIRECTORIES})
target_include_directories(WPEPlatform SYSTEM PRIVATE ${WPEPlatform_SYSTEM_INCLUDE_DIRECTORIES})
target_link_libraries(WPEPlatform ${WPEPlatform_LIBRARIES})

GI_INTROSPECT(WPEPlatform ${WPE_API_VERSION} wpe/wpe-platform.h
    TARGET WebKit
    PACKAGE wpe-platform
    IDENTIFIER_PREFIX WPE
    SYMBOL_PREFIX wpe
    DEPENDENCIES Gio-2.0
    OPTIONS
        -I${WEBKIT_DIR}/WPEPlatform
        -I${WPEPlatform_DERIVED_SOURCES_DIR}
    SOURCES
        ${WPEPlatform_INSTALLED_HEADERS}
        ${WPEPlatform_SOURCES}
    NO_IMPLICIT_SOURCES
)

GI_DOCGEN(WPEPlatform docs/wpeplatform.toml.in)

if (ENABLE_WPE_PLATFORM_DRM)
    get_target_property(WPEPlatformDRM_SOURCES_FOR_INTROSPECTION WPEPlatformDRM SOURCES_FOR_INTROSPECTION)
    GI_INTROSPECT(WPEPlatformDRM ${WPE_API_VERSION} wpe/drm/wpe-drm.h
        TARGET WebKit
        PACKAGE wpe-platform-drm
        IDENTIFIER_PREFIX WPE
        SYMBOL_PREFIX wpe
        DEPENDENCIES WPEPlatform
        OPTIONS
            -I${WEBKIT_DIR}/WPEPlatform
            -I${WPEPlatform_DERIVED_SOURCES_DIR}
        SOURCES
            ${WPEPlatformDRM_SOURCES_FOR_INTROSPECTION}
        NO_IMPLICIT_SOURCES
    )

    GI_DOCGEN(WPEPlatformDRM docs/wpeplatform-drm.toml.in)
endif ()

if (ENABLE_WPE_PLATFORM_HEADLESS)
    get_target_property(WPEPlatformHeadless_SOURCES_FOR_INTROSPECTION WPEPlatformHeadless SOURCES_FOR_INTROSPECTION)
    GI_INTROSPECT(WPEPlatformHeadless ${WPE_API_VERSION} wpe/headless/wpe-headless.h
        TARGET WebKit
        PACKAGE wpe-platform-headless
        IDENTIFIER_PREFIX WPE
        SYMBOL_PREFIX wpe
        DEPENDENCIES WPEPlatform
        OPTIONS
            -I${WEBKIT_DIR}/WPEPlatform
            -I${WPEPlatform_DERIVED_SOURCES_DIR}
        SOURCES
            ${WPEPlatformHeadless_SOURCES_FOR_INTROSPECTION}
        NO_IMPLICIT_SOURCES
    )

    GI_DOCGEN(WPEPlatformHeadless docs/wpeplatform-headless.toml.in)
endif ()

if (ENABLE_WPE_PLATFORM_WAYLAND)
    get_target_property(WPEPlatformWayland_SOURCES_FOR_INTROSPECTION WPEPlatformWayland SOURCES_FOR_INTROSPECTION)
    GI_INTROSPECT(WPEPlatformWayland ${WPE_API_VERSION} wpe/wayland/wpe-wayland.h
        TARGET WebKit
        PACKAGE wpe-platform-wayland
        IDENTIFIER_PREFIX WPE
        SYMBOL_PREFIX wpe
        DEPENDENCIES WPEPlatform
        OPTIONS
            -I${WEBKIT_DIR}/WPEPlatform
            -I${WPEPlatform_DERIVED_SOURCES_DIR}
        SOURCES
            ${WPEPlatformWayland_SOURCES_FOR_INTROSPECTION}
        NO_IMPLICIT_SOURCES
    )

    GI_DOCGEN(WPEPlatformWayland docs/wpeplatform-wayland.toml.in)
endif ()

install(FILES "${CMAKE_BINARY_DIR}/wpe-platform-${WPE_API_VERSION}.pc"
        DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
        COMPONENT "Development"
)

install(FILES ${WPEPlatform_INSTALLED_HEADERS}
        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/wpe-webkit-${WPE_API_VERSION}/wpe-platform/wpe"
        COMPONENT "Development"
)