forked from WebPlatformForEmbedded/WPEBackend-rdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
151 lines (124 loc) · 4.89 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
cmake_minimum_required(VERSION 2.8)
project(WPEBackend-rdk)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -fno-exceptions -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -fno-exceptions -fno-strict-aliasing -fno-rtti")
# Converted
option(USE_BACKEND_BCM_NEXUS "Whether to enable support for the BCM_NEXUS WPE backend" OFF)
option(USE_BACKEND_BCM_NEXUS_WAYLAND "Whether to enable support for the BCM_NEXUS Wayland WPE backend" OFF)
option(USE_BACKEND_BCM_RPI "Whether to enable support for the BCM_RPi WPE backend" OFF)
option(USE_BACKEND_INTEL_CE "Whether to enable support for the Intel CE WPE backend" OFF)
option(USE_BACKEND_WAYLAND_EGL "Whether to enable support for the wayland-egl WPE backend" OFF)
option(USE_BACKEND_WESTEROS "Whether to enable support for the Westeros WPE backend" OFF)
option(USE_BACKEND_REALTEK "Whether to enable support for Realtek's Wayland EGL WPE backend" OFF)
option(USE_PLATFORM_BROADCOM "Whether the playback is based on Broadcom plugins" OFF)
option(USE_BACKEND_WESTEROS_MESA "Whether to enable support for the gbm based offscreen target for westeros Mesa only" OFF)
option(USE_INPUT_LIBINPUT "Whether to enable support for the libinput input backend" ON)
option(USE_INPUT_UDEV "Whether to enable support for the libinput input udev lib" ON)
option(USE_INPUT_WAYLAND "Whether to enable support for the wayland input backend" OFF)
set(USE_KEY_INPUT_HANDLING_LINUX_INPUT OFF CACHE BOOL "Whether to use <linux/input.h> event codes for keyboard event handling")
find_package(WPE REQUIRED)
find_package(GLIB 2.38.0 REQUIRED COMPONENTS gio gio-unix)
if (USE_VIRTUAL_KEYBOARD)
find_package(LibVirtualKeyboard REQUIRED)
include_directories(${LIBVIRTUAL_KEYBOARD_INCLUDE_DIRS})
add_definitions(-DKEY_INPUT_HANDLING_VIRTUAL=1)
endif()
if (USE_KEY_INPUT_HANDLING_LINUX_INPUT)
add_definitions(-DKEY_INPUT_HANDLING_LINUX_INPUT=1)
else ()
find_package(Libxkbcommon 0.4.0 REQUIRED)
add_definitions(-DKEY_INPUT_HANDLING_XKB=1)
endif ()
if (USE_BACKEND_WESTEROS_MESA)
add_definitions(-DWPE_BACKEND_MESA=1)
endif ()
set(WPE_PLATFORM_INCLUDE_DIRECTORIES
"${CMAKE_SOURCE_DIR}/src/external"
"${CMAKE_SOURCE_DIR}/src/input"
"${CMAKE_SOURCE_DIR}/src/util"
${GIO_UNIX_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${WPE_INCLUDE_DIRS}
)
set(WPE_PLATFORM_LIBRARIES
${GLIB_GIO_LIBRARIES}
${GLIB_GOBJECT_LIBRARIES}
${GLIB_LIBRARIES}
${WPE_LIBRARIES}
)
if (NOT USE_KEY_INPUT_HANDLING_LINUX_INPUT)
list(APPEND WPE_PLATFORM_INCLUDE_DIRECTORIES
${LIBXKBCOMMON_INCLUDE_DIRS}
)
list(APPEND WPE_PLATFORM_LIBRARIES
${LIBXKBCOMMON_LIBRARIES}
)
endif ()
if (USE_VIRTUAL_KEYBOARD)
list(APPEND WPE_PLATFORM_LIBRARIES
${LIBVIRTUAL_KEYBOARD_LIBRARIES}
)
endif ()
set(WPE_PLATFORM_SOURCES
src/loader-impl.cpp
src/input/LinuxInput/KeyboardEventHandlerLinuxInput.cpp
src/input/LinuxInput/input-linuxinput.cpp
src/input/XKB/KeyboardEventHandlerXKB.cpp
src/input/XKB/input-libxkbcommon.cpp
src/util/ipc.cpp
)
if (USE_INPUT_LIBINPUT)
find_package(Libinput REQUIRED)
list(APPEND WPE_PLATFORM_INCLUDE_DIRECTORIES
${LIBINPUT_INCLUDE_DIRS}
)
list(APPEND WPE_PLATFORM_LIBRARIES
${LIBINPUT_LIBRARIES}
)
if (USE_INPUT_UDEV)
find_package(Libudev REQUIRED)
list(APPEND WPE_PLATFORM_INCLUDE_DIRECTORIES
${LIBUDEV_INCLUDE_DIRS}
)
list(APPEND WPE_PLATFORM_LIBRARIES
${LIBUDEV_LIBRARIES}
)
add_definitions(-DKEY_INPUT_UDEV=1)
endif ()
list(APPEND WPE_PLATFORM_SOURCES
src/input/Libinput/KeyboardEventRepeating.cpp
src/input/Libinput/LibinputServer.cpp
)
endif()
if (USE_BACKEND_BCM_NEXUS)
include(src/bcm-nexus/CMakeLists.txt)
endif ()
if (USE_BACKEND_BCM_NEXUS_WAYLAND)
include(src/bcm-nexus-wayland/CMakeLists.txt)
endif ()
if (USE_BACKEND_BCM_RPI)
include(src/bcm-rpi/CMakeLists.txt)
endif ()
if (USE_BACKEND_INTEL_CE)
include(src/intelce/CMakeLists.txt)
endif ()
if (USE_BACKEND_REALTEK)
include(src/realtek-wl-egl/CMakeLists.txt)
endif ()
if (USE_BACKEND_WAYLAND_EGL)
include(src/wayland-egl/CMakeLists.txt)
endif ()
if (USE_BACKEND_WESTEROS)
include(src/westeros/CMakeLists.txt)
endif ()
add_library(WPEBackend-rdk SHARED ${WPE_PLATFORM_SOURCES})
target_include_directories(WPEBackend-rdk PRIVATE ${WPE_PLATFORM_INCLUDE_DIRECTORIES})
target_link_libraries(WPEBackend-rdk ${WPE_PLATFORM_LIBRARIES})
install(TARGETS WPEBackend-rdk DESTINATION "${CMAKE_INSTALL_PREFIX}/lib")
# Create a libWPEBackend-default.so symlink to libWPEBackend-rdk.so and install it.
add_custom_command(TARGET WPEBackend-rdk
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink libWPEBackend-rdk.so ${CMAKE_BINARY_DIR}/libWPEBackend-default.so
)
install(FILES ${CMAKE_BINARY_DIR}/libWPEBackend-default.so DESTINATION "${CMAKE_INSTALL_PREFIX}/lib")