summaryrefslogtreecommitdiffstats
path: root/project/cmake/scripts/linux/Install.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'project/cmake/scripts/linux/Install.cmake')
-rw-r--r--project/cmake/scripts/linux/Install.cmake355
1 files changed, 355 insertions, 0 deletions
diff --git a/project/cmake/scripts/linux/Install.cmake b/project/cmake/scripts/linux/Install.cmake
new file mode 100644
index 0000000..5458707
--- /dev/null
+++ b/project/cmake/scripts/linux/Install.cmake
@@ -0,0 +1,355 @@
1if(X_FOUND)
2 set(USE_X11 1)
3else()
4 set(USE_X11 0)
5endif()
6if(OPENGL_FOUND)
7 set(USE_OPENGL 1)
8else()
9 set(USE_OPENGL 0)
10endif()
11if(OPENGLES_FOUND)
12 set(USE_OPENGLES 1)
13else()
14 set(USE_OPENGLES 0)
15endif()
16
17# CMake config
18set(APP_PREFIX ${prefix})
19set(APP_LIB_DIR ${libdir}/${APP_NAME_LC})
20set(APP_DATA_DIR ${datarootdir}/${APP_NAME_LC})
21set(APP_INCLUDE_DIR ${includedir}/${APP_NAME_LC})
22set(CXX11_SWITCH "-std=c++11")
23
24# Set XBMC_STANDALONE_SH_PULSE so we can insert PulseAudio block into kodi-standalone
25if(EXISTS ${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse)
26 if(ENABLE_PULSEAUDIO AND PULSEAUDIO_FOUND)
27 file(READ "${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse" pulse_content)
28 set(XBMC_STANDALONE_SH_PULSE ${pulse_content})
29 endif()
30endif()
31
32# Configure startup scripts
33configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi.sh.in
34 ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} @ONLY)
35configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.in
36 ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone @ONLY)
37
38# Configure cmake files
39configure_file(${PROJECT_SOURCE_DIR}/KodiConfig.cmake.in
40 ${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake @ONLY)
41
42# Configure xsession entry
43configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in
44 ${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop @ONLY)
45
46# Install app
47install(TARGETS ${APP_NAME_LC}
48 DESTINATION ${libdir}/${APP_NAME_LC}
49 COMPONENT kodi-bin)
50if(ENABLE_X11 AND XRANDR_FOUND)
51 install(TARGETS ${APP_NAME_LC}-xrandr
52 DESTINATION ${libdir}/${APP_NAME_LC}
53 COMPONENT kodi-bin)
54endif()
55
56# Install scripts
57install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}
58 ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone
59 DESTINATION ${bindir}
60 COMPONENT kodi-bin)
61
62# Install libraries
63foreach(library ${LIBRARY_FILES})
64 get_filename_component(dir ${library} DIRECTORY)
65 string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${dir})
66 install(PROGRAMS ${library}
67 DESTINATION ${libdir}/${APP_NAME_LC}/${dir}
68 COMPONENT kodi-bin)
69endforeach()
70
71# Install add-ons, fonts, icons, keyboard maps, keymaps, etc
72# (addons, media, system, userdata folders in share/kodi/)
73foreach(file ${install_data})
74 get_filename_component(dir ${file} DIRECTORY)
75 install(FILES ${CMAKE_BINARY_DIR}/${file}
76 DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir}
77 COMPONENT kodi)
78endforeach()
79
80# Install xsession entry
81install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop
82 DESTINATION ${datarootdir}/xsessions
83 COMPONENT kodi)
84
85# Install desktop entry
86install(FILES ${CORE_SOURCE_DIR}/tools/Linux/kodi.desktop
87 DESTINATION ${datarootdir}/applications
88 COMPONENT kodi)
89
90# Install icons
91install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png
92 RENAME ${APP_NAME_LC}.png
93 DESTINATION ${datarootdir}/icons/hicolor/16x16/apps
94 COMPONENT kodi)
95install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png
96 RENAME ${APP_NAME_LC}.png
97 DESTINATION ${datarootdir}/icons/hicolor/22x22/apps
98 COMPONENT kodi)
99install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png
100 RENAME ${APP_NAME_LC}.png
101 DESTINATION ${datarootdir}/icons/hicolor/24x24/apps
102 COMPONENT kodi)
103install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png
104 RENAME ${APP_NAME_LC}.png
105 DESTINATION ${datarootdir}/icons/hicolor/32x32/apps
106 COMPONENT kodi)
107install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png
108 RENAME ${APP_NAME_LC}.png
109 DESTINATION ${datarootdir}/icons/hicolor/48x48/apps
110 COMPONENT kodi)
111install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png
112 RENAME ${APP_NAME_LC}.png
113 DESTINATION ${datarootdir}/icons/hicolor/64x64/apps
114 COMPONENT kodi)
115install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png
116 RENAME ${APP_NAME_LC}.png
117 DESTINATION ${datarootdir}/icons/hicolor/128x128/apps
118 COMPONENT kodi)
119install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png
120 RENAME ${APP_NAME_LC}.png
121 DESTINATION ${datarootdir}/icons/hicolor/256x256/apps
122 COMPONENT kodi)
123install(CODE "execute_process(COMMAND gtk-update-icon-cache -f -q -t
124 $ENV{DESTDIR}${datarootdir}/icons/hicolor ERROR_QUIET)"
125 COMPONENT kodi)
126
127# Install docs
128install(FILES ${CORE_SOURCE_DIR}/copying.txt
129 ${CORE_SOURCE_DIR}/LICENSE.GPL
130 ${CORE_SOURCE_DIR}/version.txt
131 ${CORE_SOURCE_DIR}/docs/README.linux
132 DESTINATION ${datarootdir}/doc/${APP_NAME_LC}
133 COMPONENT kodi)
134
135install(FILES ${CORE_SOURCE_DIR}/privacy-policy.txt
136 DESTINATION ${datarootdir}/${APP_NAME_LC}
137 COMPONENT kodi)
138
139# Install kodi-tools-texturepacker
140install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/texturepacker/TexturePacker
141 DESTINATION ${bindir}
142 COMPONENT kodi-tools-texturepacker)
143
144# Install kodi-addon-dev headers
145install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h
146 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_utils.hpp
147 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h
148 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h
149 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h
150 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h
151 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h
152 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
153 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h
154 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
155 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h
156 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h
157 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h
158 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h
159 ${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h
160 ${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h
161 DESTINATION ${includedir}/${APP_NAME_LC}
162 COMPONENT kodi-addon-dev)
163
164# Install kodi-addon-dev add-on bindings
165install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake
166 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddonHelpers.cmake
167 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddOptions.cmake
168 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/ArchSetup.cmake
169 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckCommits.cmake
170 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake
171 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/GenerateVersionedFiles.cmake
172 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/GeneratorSetup.cmake
173 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake
174 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake
175 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/PrepareEnv.cmake
176 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/ProjectMacros.cmake
177 ${CORE_SOURCE_DIR}/project/cmake/scripts/linux/PathSetup.cmake
178 DESTINATION ${datarootdir}/${APP_NAME_LC}/cmake
179 COMPONENT kodi-addon-dev)
180
181# Install kodi-audio-dev
182install(FILES ${CORE_SOURCE_DIR}/xbmc/cores/AudioEngine/Utils/AEChannelData.h
183 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h
184 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h
185 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h
186 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h
187 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h
188 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h
189 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h
190 DESTINATION ${includedir}/${APP_NAME_LC}
191 COMPONENT kodi-audio-dev)
192
193if(ENABLE_EVENTCLIENTS)
194 # Install kodi-eventclients-common BT python files
195 install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/__init__.py
196 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/bt.py
197 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/hid.py
198 DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/bt
199 COMPONENT kodi-eventclients-common)
200
201 # Install kodi-eventclients-common PS3 python files
202 install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/__init__.py
203 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/keymaps.py
204 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixaxis.py
205 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixpair.py
206 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixwatch.py
207 DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/ps3
208 COMPONENT kodi-eventclients-common)
209
210 # Install kodi-eventclients-common python files
211 file(WRITE ${CMAKE_BINARY_DIR}/packages/deb/defs.py ICON_PATH="usr/share/pixmaps/${APP_NAME_LC}/")
212 install(PROGRAMS ${CMAKE_BINARY_DIR}/packages/deb/defs.py
213 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/__init__.py
214 "${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py"
215 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/xbmcclient.py
216 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/zeroconf.py
217 DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}
218 COMPONENT kodi-eventclients-common)
219
220 # Install kodi-eventclients-common icons
221 install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/icons/bluetooth.png
222 ${CORE_SOURCE_DIR}/tools/EventClients/icons/phone.png
223 ${CORE_SOURCE_DIR}/tools/EventClients/icons/mail.png
224 ${CORE_SOURCE_DIR}/tools/EventClients/icons/mouse.png
225 DESTINATION ${datarootdir}/pixmaps/${APP_NAME_LC}
226 COMPONENT kodi-eventclients-common)
227
228 # Install kodi-eventclients-dev headers
229 install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/lib/c++/xbmcclient.h
230 DESTINATION ${includedir}/${APP_NAME_LC}
231 COMPONENT kodi-eventclients-dev)
232
233 # Install kodi-eventclients-dev C# examples
234 install(FILES "${CORE_SOURCE_DIR}/tools/EventClients/examples/c#/XBMCDemoClient1.cs"
235 DESTINATION "${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C#"
236 COMPONENT kodi-eventclients-dev)
237
238 # Install kodi-eventclients-dev C++ examples
239 install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_notification.cpp
240 ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_log.cpp
241 ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button1.cpp
242 ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_mouse.cpp
243 ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button2.cpp
244 DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C++
245 COMPONENT kodi-eventclients-dev)
246
247 # Install kodi-eventclients-dev java examples
248 install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/java/XBMCDemoClient1.java
249 DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/java
250 COMPONENT kodi-eventclients-dev)
251
252 # Install kodi-eventclients-dev python examples
253 install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_mouse.py
254 ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button1.py
255 ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_notification.py
256 ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_action.py
257 ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button2.py
258 ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_simple.py
259 DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/python
260 COMPONENT kodi-eventclients-dev)
261
262 # Install kodi-eventclients-ps3
263 install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py"
264 RENAME ${APP_NAME_LC}-ps3remote
265 DESTINATION ${bindir}
266 COMPONENT kodi-eventclients-ps3)
267
268 # Install kodi-eventclients-wiiremote
269 install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/WiiRemote/${APP_NAME_LC}-wiiremote
270 DESTINATION ${bindir}
271 COMPONENT kodi-eventclients-wiiremote)
272
273 # Install kodi-eventclients-xbmc-send
274 install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/Kodi Send/kodi-send.py"
275 RENAME ${APP_NAME_LC}-send
276 DESTINATION ${bindir}
277 COMPONENT kodi-eventclients-xbmc-send)
278endif()
279
280# Install kodi-inputstream-dev
281install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h
282 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h
283 DESTINATION ${includedir}/${APP_NAME_LC}
284 COMPONENT kodi-inputstream-dev)
285
286# Install kodi-pvr-dev
287install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h
288 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h
289 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h
290 DESTINATION ${includedir}/${APP_NAME_LC}
291 COMPONENT kodi-pvr-dev)
292
293# Install kodi-screensaver-dev
294install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h
295 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h
296 DESTINATION ${includedir}/${APP_NAME_LC}
297 COMPONENT kodi-screensaver-dev)
298
299# Install kodi-visualization-dev
300install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h
301 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h
302 DESTINATION ${includedir}/${APP_NAME_LC}
303 COMPONENT kodi-visualization-dev)
304
305# Install kodi-peripheral-dev
306install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h
307 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h
308 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h
309 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp
310 DESTINATION ${includedir}/${APP_NAME_LC}
311 COMPONENT kodi-peripheral-dev)
312
313# Install XBT skin files
314foreach(texture ${XBT_FILES})
315 string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture})
316 get_filename_component(dir ${dir} DIRECTORY)
317 install(FILES ${texture}
318 DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir}
319 COMPONENT kodi)
320endforeach()
321
322# Install extra stuff if it exists
323if(EXISTS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs)
324 install(CODE "file(STRINGS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs dirs)
325 foreach(dir \${dirs})
326 file(GLOB_RECURSE FILES RELATIVE ${CMAKE_BINARY_DIR} \${dir}/*)
327 foreach(file \${FILES})
328 get_filename_component(dir \${file} DIRECTORY)
329 file(INSTALL \${file} DESTINATION ${datarootdir}/${APP_NAME_LC}/\${dir})
330 endforeach()
331 endforeach()")
332endif()
333
334if(NOT "$ENV{DESTDIR}" STREQUAL "")
335 set(DESTDIR ${CMAKE_BINARY_DIR}/$ENV{DESTDIR})
336endif()
337foreach(subdir ${build_dirs})
338 if(NOT subdir MATCHES kodi-platform)
339 string(REPLACE " " ";" subdir ${subdir})
340 list(GET subdir 0 id)
341 install(CODE "execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} -C ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${id}/src/${id}-build install DESTDIR=${DESTDIR})")
342 endif()
343endforeach()
344
345# generate packages? yes please, if everything checks out
346if(CPACK_GENERATOR)
347 if(CPACK_GENERATOR STREQUAL DEB AND CORE_SYSTEM_NAME STREQUAL linux)
348 if(CMAKE_BUILD_TYPE STREQUAL Debug)
349 message(STATUS "DEB Generator: Build type is set to 'Debug'. Packaged binaries will be unstripped.")
350 endif()
351 include(${PROJECT_SOURCE_DIR}/cpack/CPackConfigDEB.cmake)
352 else()
353 message(FATAL_ERROR "DEB Generator: Can't configure CPack to generate Debian packages on non-linux systems.")
354 endif()
355endif()