blob: 339d598a3ccdcbbac112eed1ae179d6e2d77ecf8 (
plain)
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
|
if(X_FOUND)
set(USE_X11 1)
else()
set(USE_X11 0)
endif()
if(OPENGL_FOUND)
set(USE_OPENGL 1)
else()
set(USE_OPENGL 0)
endif()
if(OPENGLES_FOUND)
set(USE_OPENGLES 1)
else()
set(USE_OPENGLES 0)
endif()
# CMake config
set(APP_PREFIX ${prefix})
set(APP_LIB_DIR ${libdir}/${APP_NAME_LC})
set(APP_DATA_DIR ${datarootdir}/${APP_NAME_LC})
set(APP_INCLUDE_DIR ${includedir}/${APP_NAME_LC})
set(CXX11_SWITCH "-std=c++11")
# Set XBMC_STANDALONE_SH_PULSE so we can insert PulseAudio block into kodi-standalone
if(EXISTS ${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse)
if(ENABLE_PULSEAUDIO AND PULSEAUDIO_FOUND)
file(READ "${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse" pulse_content)
set(XBMC_STANDALONE_SH_PULSE ${pulse_content})
endif()
endif()
# Configure startup scripts
configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi.sh.in
${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} @ONLY)
configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.in
${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone @ONLY)
# Configure cmake files
configure_file(${PROJECT_SOURCE_DIR}/KodiConfig.cmake.in
${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake @ONLY)
# Configure xsession entry
configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in
${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop @ONLY)
# Install app
install(TARGETS ${APP_NAME_LC}
DESTINATION ${libdir}/${APP_NAME_LC}
COMPONENT kodi-bin)
if(ENABLE_X11 AND XRANDR_FOUND)
install(TARGETS ${APP_NAME_LC}-xrandr
DESTINATION ${libdir}/${APP_NAME_LC}
COMPONENT kodi-bin)
endif()
# Install scripts
install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}
${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone
DESTINATION ${bindir}
COMPONENT kodi)
# Install libraries
foreach(library ${LIBRARY_FILES})
get_filename_component(dir ${library} PATH)
string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${dir})
install(PROGRAMS ${library}
DESTINATION ${libdir}/${APP_NAME_LC}/${dir}
COMPONENT kodi-bin)
endforeach()
# Install add-ons, fonts, icons, keyboard maps, keymaps, etc
# (addons, media, system, userdata folders in share/kodi/)
foreach(file ${install_data})
get_filename_component(dir ${file} PATH)
install(FILES ${CMAKE_BINARY_DIR}/${file}
DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir}
COMPONENT kodi)
endforeach()
# Install xsession entry
install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop
DESTINATION ${datarootdir}/xsessions
COMPONENT kodi)
# Install desktop entry
install(FILES ${CORE_SOURCE_DIR}/tools/Linux/kodi.desktop
DESTINATION ${datarootdir}/applications
COMPONENT kodi)
# Install icons
install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png
RENAME ${APP_NAME_LC}.png
DESTINATION ${datarootdir}/icons/hicolor/16x16/apps
COMPONENT kodi)
install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png
RENAME ${APP_NAME_LC}.png
DESTINATION ${datarootdir}/icons/hicolor/22x22/apps
COMPONENT kodi)
install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png
RENAME ${APP_NAME_LC}.png
DESTINATION ${datarootdir}/icons/hicolor/24x24/apps
COMPONENT kodi)
install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png
RENAME ${APP_NAME_LC}.png
DESTINATION ${datarootdir}/icons/hicolor/32x32/apps
COMPONENT kodi)
install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png
RENAME ${APP_NAME_LC}.png
DESTINATION ${datarootdir}/icons/hicolor/48x48/apps
COMPONENT kodi)
install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png
RENAME ${APP_NAME_LC}.png
DESTINATION ${datarootdir}/icons/hicolor/64x64/apps
COMPONENT kodi)
install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png
RENAME ${APP_NAME_LC}.png
DESTINATION ${datarootdir}/icons/hicolor/128x128/apps
COMPONENT kodi)
install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png
RENAME ${APP_NAME_LC}.png
DESTINATION ${datarootdir}/icons/hicolor/256x256/apps
COMPONENT kodi)
install(CODE "execute_process(COMMAND gtk-update-icon-cache -f -q -t
$ENV{DESTDIR}${datarootdir}/icons/hicolor ERROR_QUIET)"
COMPONENT kodi)
# Install docs
install(FILES ${CORE_SOURCE_DIR}/copying.txt
${CORE_SOURCE_DIR}/LICENSE.GPL
${CORE_SOURCE_DIR}/version.txt
${CORE_SOURCE_DIR}/docs/README.linux
DESTINATION ${datarootdir}/doc/${APP_NAME_LC}
COMPONENT kodi)
# Install kodi-tools-texturepacker
install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/texturepacker/TexturePacker
DESTINATION ${bindir}
COMPONENT kodi-tools-texturepacker)
# Install kodi-addon-dev headers
install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h
${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h
${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h
DESTINATION ${includedir}/${APP_NAME_LC}
COMPONENT kodi-addon-dev)
# Install kodi-addon-dev add-on bindings
install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddonHelpers.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddOptions.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/common/ArchSetup.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckCommits.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/common/GenerateVersionedFiles.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/common/GeneratorSetup.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/common/PrepareEnv.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/common/ProjectMacros.cmake
${CORE_SOURCE_DIR}/project/cmake/scripts/linux/PathSetup.cmake
DESTINATION ${libdir}/${APP_NAME_LC}
COMPONENT kodi-addon-dev)
# Install kodi-audio-dev
install(FILES ${CORE_SOURCE_DIR}/xbmc/cores/AudioEngine/Utils/AEChannelData.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h
DESTINATION ${includedir}/${APP_NAME_LC}
COMPONENT kodi-audio-dev)
if(ENABLE_EVENTCLIENTS)
# Install kodi-eventclients-common BT python files
install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/__init__.py
${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/bt.py
${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/hid.py
DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/bt
COMPONENT kodi-eventclients-common)
# Install kodi-eventclients-common PS3 python files
install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/__init__.py
${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/keymaps.py
${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixaxis.py
${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixpair.py
${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixwatch.py
DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/ps3
COMPONENT kodi-eventclients-common)
# Install kodi-eventclients-common python files
file(WRITE ${CMAKE_BINARY_DIR}/packages/deb/defs.py ICON_PATH="usr/share/pixmaps/${APP_NAME_LC}/")
install(PROGRAMS ${CMAKE_BINARY_DIR}/packages/deb/defs.py
${CORE_SOURCE_DIR}/tools/EventClients/lib/python/__init__.py
"${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py"
${CORE_SOURCE_DIR}/tools/EventClients/lib/python/xbmcclient.py
${CORE_SOURCE_DIR}/tools/EventClients/lib/python/zeroconf.py
DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}
COMPONENT kodi-eventclients-common)
# Install kodi-eventclients-common icons
install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/icons/bluetooth.png
${CORE_SOURCE_DIR}/tools/EventClients/icons/phone.png
${CORE_SOURCE_DIR}/tools/EventClients/icons/mail.png
${CORE_SOURCE_DIR}/tools/EventClients/icons/mouse.png
DESTINATION ${datarootdir}/pixmaps/${APP_NAME_LC}
COMPONENT kodi-eventclients-common)
# Install kodi-eventclients-dev headers
install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/lib/c++/xbmcclient.h
DESTINATION ${includedir}/${APP_NAME_LC}
COMPONENT kodi-eventclients-dev)
# Install kodi-eventclients-dev C# examples
install(FILES "${CORE_SOURCE_DIR}/tools/EventClients/examples/c#/XBMCDemoClient1.cs"
DESTINATION "${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C#"
COMPONENT kodi-eventclients-dev)
# Install kodi-eventclients-dev C++ examples
install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_notification.cpp
${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_log.cpp
${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button1.cpp
${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_mouse.cpp
${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button2.cpp
DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C++
COMPONENT kodi-eventclients-dev)
# Install kodi-eventclients-dev java examples
install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/java/XBMCDemoClient1.java
DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/java
COMPONENT kodi-eventclients-dev)
# Install kodi-eventclients-dev python examples
install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_mouse.py
${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button1.py
${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_notification.py
${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_action.py
${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button2.py
${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_simple.py
DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/python
COMPONENT kodi-eventclients-dev)
# Install kodi-eventclients-ps3
install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py"
RENAME ${APP_NAME_LC}-ps3remote
DESTINATION ${bindir}
COMPONENT kodi-eventclients-ps3)
# Install kodi-eventclients-wiiremote
install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/WiiRemote/${APP_NAME_LC}-wiiremote
DESTINATION ${bindir}
COMPONENT kodi-eventclients-wiiremote)
# Install kodi-eventclients-xbmc-send
install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/Kodi Send/kodi-send.py"
RENAME ${APP_NAME_LC}-send
DESTINATION ${bindir}
COMPONENT kodi-eventclients-xbmc-send)
endif()
# Install kodi-inputstream-dev
install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h
DESTINATION ${includedir}/${APP_NAME_LC}
COMPONENT kodi-inputstream-dev)
# Install kodi-pvr-dev
install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h
DESTINATION ${includedir}/${APP_NAME_LC}
COMPONENT kodi-pvr-dev)
# Install kodi-screensaver-dev
install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h
DESTINATION ${includedir}/${APP_NAME_LC}
COMPONENT kodi-screensaver-dev)
# Install kodi-visualization-dev
install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h
${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h
DESTINATION ${includedir}/${APP_NAME_LC}
COMPONENT kodi-visualization-dev)
# Install XBT skin files
foreach(texture ${XBT_FILES})
string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture})
get_filename_component(dir ${dir} PATH)
install(FILES ${texture}
DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir}
COMPONENT kodi)
endforeach()
# Install extra stuff if it exists
if(EXISTS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs)
install(CODE "file(STRINGS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs dirs)
foreach(dir \${dirs})
file(GLOB_RECURSE FILES RELATIVE ${CMAKE_BINARY_DIR} \${dir}/*)
foreach(file \${FILES})
get_filename_component(dir \${file} PATH)
file(INSTALL \${file} DESTINATION ${datarootdir}/${APP_NAME_LC}/\${dir})
endforeach()
endforeach()")
endif()
if(NOT "$ENV{DESTDIR}" STREQUAL "")
set(DESTDIR ${CMAKE_BINARY_DIR}/$ENV{DESTDIR})
endif()
foreach(subdir ${build_dirs})
if(NOT subdir MATCHES kodi-platform)
string(REPLACE " " ";" subdir ${subdir})
list(GET subdir 0 id)
install(CODE "execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} -C ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${id}/src/${id}-build install DESTDIR=${DESTDIR})")
endif()
endforeach()
# generate packages? yes please, if everything checks out
if(CPACK_GENERATOR)
if(CPACK_GENERATOR STREQUAL DEB AND CORE_SYSTEM_NAME STREQUAL linux)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
message(STATUS "DEB Generator: Build type is set to 'Debug'. Packaged binaries will be unstripped.")
endif()
include(${PROJECT_SOURCE_DIR}/cpack/CPackConfigDEB.cmake)
else()
message(FATAL_ERROR "DEB Generator: Can't configure CPack to generate Debian packages on non-linux systems.")
endif()
endif()
|