summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/README.md18
-rw-r--r--cmake/addons/CMakeLists.txt8
-rw-r--r--cmake/addons/depends/windowsstore/CMakeLists.txt52
-rw-r--r--cmake/addons/depends/windowsstore/Install.cmake24
-rw-r--r--cmake/addons/depends/windowsstore/README19
-rw-r--r--cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt1
-rw-r--r--cmake/addons/depends/windowsstore/prebuilt/README21
-rw-r--r--cmake/installdata/windows/addons.txt2
-rw-r--r--cmake/installdata/windows/dlls.txt1
-rw-r--r--cmake/installdata/windowsstore/addons.txt3
-rw-r--r--cmake/installdata/windowsstore/dlls.txt2
-rw-r--r--cmake/installdata/windowsstore/irss.txt2
-rw-r--r--cmake/installdata/windowsstore/python.txt1
-rw-r--r--cmake/modules/FindAlsa.cmake2
-rw-r--r--cmake/modules/FindAvahi.cmake6
-rw-r--r--cmake/modules/FindBluray.cmake5
-rw-r--r--cmake/modules/FindCurl.cmake2
-rw-r--r--cmake/modules/FindD3DX11Effects.cmake27
-rw-r--r--cmake/modules/FindDBus.cmake4
-rw-r--r--cmake/modules/FindEGL.cmake8
-rw-r--r--cmake/modules/FindFFMPEG.cmake18
-rw-r--r--cmake/modules/FindFmt.cmake46
-rw-r--r--cmake/modules/FindIMX.cmake38
-rw-r--r--cmake/modules/FindIconv.cmake44
-rw-r--r--cmake/modules/FindJsonSchemaBuilder.cmake2
-rw-r--r--cmake/modules/FindLibDvd.cmake357
-rw-r--r--cmake/modules/FindMDNS.cmake8
-rw-r--r--cmake/modules/FindMicroHttpd.cmake2
-rw-r--r--cmake/modules/FindMySqlClient.cmake4
-rw-r--r--cmake/modules/FindNFS.cmake4
-rw-r--r--cmake/modules/FindOpenGLES.cmake26
-rw-r--r--cmake/modules/FindOpenGLES3.cmake24
-rw-r--r--cmake/modules/FindOpenGl.cmake2
-rw-r--r--cmake/modules/FindPlist.cmake4
-rw-r--r--cmake/modules/FindPulseAudio.cmake14
-rw-r--r--cmake/modules/FindRapidJSON.cmake6
-rw-r--r--cmake/modules/FindSSE.cmake45
-rw-r--r--cmake/modules/FindSSH.cmake4
-rw-r--r--cmake/modules/FindShairplay.cmake4
-rw-r--r--cmake/modules/FindSmbClient.cmake4
-rw-r--r--cmake/modules/FindSndio.cmake4
-rw-r--r--cmake/modules/FindTexturePacker.cmake2
-rw-r--r--cmake/platform/android/android.cmake2
-rw-r--r--cmake/platform/freebsd/wayland.cmake17
-rw-r--r--cmake/platform/freebsd/x11.cmake2
-rw-r--r--cmake/platform/linux/gbm.cmake2
-rw-r--r--cmake/platform/linux/imx.cmake1
-rw-r--r--cmake/platform/linux/x11.cmake4
-rw-r--r--cmake/platform/windowsstore/defines.txt1
-rw-r--r--cmake/platform/windowsstore/windowsstore.cmake1
-rw-r--r--cmake/scripts/android/ArchSetup.cmake16
-rw-r--r--cmake/scripts/android/Install.cmake26
-rw-r--r--cmake/scripts/common/AddonHelpers.cmake19
-rw-r--r--cmake/scripts/common/ArchSetup.cmake3
-rw-r--r--cmake/scripts/common/GenerateVersionedFiles.cmake10
-rw-r--r--cmake/scripts/common/HandleDepends.cmake13
-rw-r--r--cmake/scripts/common/Macros.cmake54
-rw-r--r--cmake/scripts/common/Platform.cmake9
-rw-r--r--cmake/scripts/common/PrepareEnv.cmake14
-rw-r--r--cmake/scripts/freebsd/ArchSetup.cmake5
-rw-r--r--cmake/scripts/freebsd/ExtraTargets.cmake29
-rw-r--r--cmake/scripts/ios/ArchSetup.cmake5
-rw-r--r--cmake/scripts/ios/Install.cmake2
-rw-r--r--cmake/scripts/linux/ArchSetup.cmake37
-rw-r--r--cmake/scripts/linux/Install.cmake13
-rwxr-xr-xcmake/scripts/linux/clang-check-test.sh.in2
-rw-r--r--cmake/scripts/osx/ArchSetup.cmake5
-rw-r--r--cmake/scripts/windows/ArchSetup.cmake25
-rw-r--r--cmake/scripts/windowsstore/ArchSetup.cmake121
-rw-r--r--cmake/scripts/windowsstore/CFlagOverrides.cmake12
-rw-r--r--cmake/scripts/windowsstore/CXXFlagOverrides.cmake12
-rw-r--r--cmake/scripts/windowsstore/Install.cmake0
-rw-r--r--cmake/scripts/windowsstore/Macros.cmake181
-rw-r--r--cmake/scripts/windowsstore/PathSetup.cmake34
-rw-r--r--cmake/scripts/windowsstore/tools/patch.cmake37
-rw-r--r--cmake/treedata/android/subdirs.txt3
-rw-r--r--cmake/treedata/common/music.txt1
-rw-r--r--cmake/treedata/common/retroplayer.txt4
-rw-r--r--cmake/treedata/common/subdirs.txt14
-rw-r--r--cmake/treedata/common/video.txt1
-rw-r--r--cmake/treedata/freebsd/subdirs.txt5
-rw-r--r--cmake/treedata/ios/subdirs.txt3
-rw-r--r--cmake/treedata/linux/subdirs.txt5
-rw-r--r--cmake/treedata/optional/common/X.txt1
-rw-r--r--cmake/treedata/optional/common/aml.txt1
-rw-r--r--cmake/treedata/optional/common/gbm.txt3
-rw-r--r--cmake/treedata/optional/common/imx.txt1
-rw-r--r--cmake/treedata/optional/common/python.txt2
-rw-r--r--cmake/treedata/optional/common/wayland.txt1
-rw-r--r--cmake/treedata/osx/subdirs.txt3
-rw-r--r--cmake/treedata/windows/subdirs.txt2
-rw-r--r--cmake/treedata/windowsstore/externals.txt1
-rw-r--r--cmake/treedata/windowsstore/subdirs.txt16
-rw-r--r--version.txt8
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h1
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/CMakeLists.txt24
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/Filesystem.h90
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/General.h44
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/CMakeLists.txt15
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h50
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h10
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h3
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h4
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/CMakeLists.txt8
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/CMakeLists.txt16
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/CMakeLists.txt14
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h7
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h35
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt5
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h24
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h11
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h48
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h21
-rw-r--r--xbmc/filesystem/.IFileTypes.h.swpbin12288 -> 0 bytes
-rw-r--r--xbmc/filesystem/IFileTypes.h23
-rw-r--r--xbmc/input/ActionIDs.h13
116 files changed, 1631 insertions, 494 deletions
diff --git a/cmake/README.md b/cmake/README.md
index 81c0517..0848f2d 100644
--- a/cmake/README.md
+++ b/cmake/README.md
@@ -119,12 +119,30 @@ cmake -G "Visual Studio 14" <KODI_SRC>
119cmake --build . --config "Debug" # or: Build solution with Visual Studio 119cmake --build . --config "Debug" # or: Build solution with Visual Studio
120Debug\kodi.exe 120Debug\kodi.exe
121``` 121```
122
123Building on a x64 cpu can be improved, if you're on a cmake version > 3.8:
124```
125cmake -G "Visual Studio 14" -T host=x64 <KODI_SRC>
126cmake --build . --config "Debug" # or: Build solution with Visual Studio
127Debug\kodi.exe
128```
129This will choose the x64 toolset, as windows uses the x32 toolset by default.
130
122#### Build for x64 131#### Build for x64
123``` 132```
124cmake -G "Visual Studio 14 Win64" <KODI_SRC> 133cmake -G "Visual Studio 14 Win64" <KODI_SRC>
125cmake --build . --config "Debug" # or: Build solution with Visual Studio 134cmake --build . --config "Debug" # or: Build solution with Visual Studio
126Debug\kodi.exe 135Debug\kodi.exe
127``` 136```
137
138Building on a x64 cpu can be improved, if you're on a cmake version > 3.8:
139```
140cmake -G "Visual Studio 14 Win64" -T host=x64 <KODI_SRC>
141cmake --build . --config "Debug" # or: Build solution with Visual Studio
142Debug\kodi.exe
143```
144This will choose the x64 toolset, as windows uses the x32 toolset by default.
145
128You can always check ``cmake --help` to see which generators are available and how to call those. 146You can always check ``cmake --help` to see which generators are available and how to call those.
129 147
130#### Windows installer generation 148#### Windows installer generation
diff --git a/cmake/addons/CMakeLists.txt b/cmake/addons/CMakeLists.txt
index a6ea149..fd1d448 100644
--- a/cmake/addons/CMakeLists.txt
+++ b/cmake/addons/CMakeLists.txt
@@ -75,6 +75,11 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX)
75endif() 75endif()
76list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}) 76list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
77 77
78if (CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
79 set(BUILD_ARGS_ext -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
80 -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION})
81endif()
82
78set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} 83set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
79 -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> 84 -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
80 -DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig 85 -DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig
@@ -86,7 +91,8 @@ set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
86 -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} 91 -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME}
87 -DBUILD_SHARED_LIBS=1 92 -DBUILD_SHARED_LIBS=1
88 -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 93 -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
89 -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}) 94 -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
95 ${BUILD_ARGS_ext})
90 96
91if(MSVC) 97if(MSVC)
92 # move cmake specific targets to a CMakePredefinedTargets folder in Visual Studio 98 # move cmake specific targets to a CMakePredefinedTargets folder in Visual Studio
diff --git a/cmake/addons/depends/windowsstore/CMakeLists.txt b/cmake/addons/depends/windowsstore/CMakeLists.txt
new file mode 100644
index 0000000..c8739c0
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/CMakeLists.txt
@@ -0,0 +1,52 @@
1cmake_minimum_required(VERSION 3.1)
2project(kodi-addons-depends-windows)
3
4list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
5
6if(NOT CMAKE_BUILD_TYPE)
7 set(CMAKE_BUILD_TYPE Release)
8endif()
9
10include(ExternalProject)
11
12if(NOT ADDON_DEPENDS_PATH)
13 message(FATAL_ERROR "ADDON_DEPENDS_PATH (${ADDON_DEPENDS_PATH}) is not a valid target directory.")
14else()
15 file(TO_CMAKE_PATH "${ADDON_DEPENDS_PATH}" ADDON_DEPENDS_PATH)
16endif()
17get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE)
18list(APPEND CMAKE_PREFIX_PATH ${ADDON_DEPENDS_PATH})
19
20if(NOT DEPENDS_TO_BUILD)
21 set(DEPENDS_TO_BUILD "all")
22endif()
23
24function(add_internal id url inputfile)
25 externalproject_add(${id}
26 URL ${url}
27 PREFIX build/${id}
28 CONFIGURE_COMMAND ""
29 BUILD_COMMAND ""
30 INSTALL_COMMAND ${CMAKE_COMMAND}
31 -DINPUTDIR=${PROJECT_BINARY_DIR}/build/${id}/src/${id}
32 -DINPUTFILE=${inputfile}
33 -DDESTDIR=${ADDON_DEPENDS_PATH}
34 -P ${PROJECT_SOURCE_DIR}/Install.cmake
35 )
36endfunction()
37
38file(GLOB_RECURSE download_input_files prebuilt/*.txt)
39foreach(file ${download_input_files})
40 if(NOT file MATCHES install.txt)
41 file(STRINGS ${file} def)
42 get_filename_component(dir ${file} DIRECTORY)
43 string(REPLACE " " ";" def ${def})
44 list(GET def 0 id)
45
46 list(FIND DEPENDS_TO_BUILD ${id} idx)
47 if(idx GREATER -1 OR DEPENDS_TO_BUILD STREQUAL "all")
48 list(GET def 1 url)
49 add_internal(${id} ${url} ${dir}/install.txt)
50 endif()
51 endif()
52endforeach()
diff --git a/cmake/addons/depends/windowsstore/Install.cmake b/cmake/addons/depends/windowsstore/Install.cmake
new file mode 100644
index 0000000..9a3adbb
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/Install.cmake
@@ -0,0 +1,24 @@
1if(EXISTS "${INPUTFILE}")
2 # if there's an input file we use it to determine which files to copy where
3 file(STRINGS ${INPUTFILE} FILES)
4 string(REPLACE "\n" ";" FILES "${FILES}")
5 foreach(file ${FILES})
6 string(REPLACE " " ";" file "${file}")
7 list(GET file 0 dir)
8 list(GET file 1 dest)
9 list(LENGTH file deflength)
10 if(deflength GREATER 2)
11 list(GET file 2 copy)
12 endif()
13 file(GLOB files ${INPUTDIR}/${dir})
14 foreach(instfile ${files})
15 file(COPY ${instfile} DESTINATION ${DESTDIR}/${dest})
16 if(copy)
17 file(COPY ${instfile} DESTINATION ${DESTDIR}/${copy})
18 endif()
19 endforeach()
20 endforeach()
21else()
22 # otherwise we assume that the content of the extracted archive is already well-formed and can just be copied
23 file(COPY ${INPUTDIR}/${dir} DESTINATION ${DESTDIR})
24endif() \ No newline at end of file
diff --git a/cmake/addons/depends/windowsstore/README b/cmake/addons/depends/windowsstore/README
new file mode 100644
index 0000000..67dc594
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/README
@@ -0,0 +1,19 @@
1KODI WIN32 ADDON DEPENDENCIES
2=============================
3This directory contains the cmake-based buildsystem for dependencies (currently
4only prebuilt) used by one or multiple addons. The buildsystem looks into the
5"prebuilt" sub-directory, downloads all the specified dependencies, extracts
6them and places them into the "depends" sub-directory.
7
8To trigger the cmake-based buildsystem the following command must be executed
9with <path> being the path to this directory (absolute or relative, allowing for
10in-source and out-of-source builds).
11
12 cmake <path> [-G <generator>]
13
14cmake supports multiple generators, see
15http://www.cmake.org/cmake/help/v2.8.8/cmake.html#section_Generators for a list.
16For win32 builds one of the "Visual Studio XX" or the "NMake Makefiles"
17generators is preferred. For the "NMake Makefiles" generator to work the above
18command must be called from an environment prepared for VC++ builds (see
19http://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx).
diff --git a/cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt b/cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt
new file mode 100644
index 0000000..db6f782
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt
@@ -0,0 +1 @@
p8-platform https://github.com/afedchin/platform.git win10
diff --git a/cmake/addons/depends/windowsstore/prebuilt/README b/cmake/addons/depends/windowsstore/prebuilt/README
new file mode 100644
index 0000000..a0c70d6
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/prebuilt/README
@@ -0,0 +1,21 @@
1KODI WIN32 PREBUILT ADDON DEPENDENCIES
2======================================
3This directory contains a file or sub-directory for every prebuilt dependency
4used by one of the addons being built. There are two different modes supported.
5Both include a file named <library-id>.txt which must follow the defined format
6 <library-id> <download-url>
7
8If the archive, which the <download-url> points at, contains
9 * only the necessary files and in the proper directory structure (i.e. an
10 "include" and a "lib" directory) then the file must be put into this
11 directory and nothing else is needed.
12 * unnecessary files and/or does not follow the defined directory structure
13 (i.e. an "include" and a "lib" directory) then the file must be put into a
14 sub-directory named <library-id>. Furthermore an additional file called
15 "install.txt" must be placed in that sub-directory. install.txt contains a
16 line for every path/directory/file with a destination where it must be copied
17 to. It must follow the defined format
18 <source> <destination> [<copy-destination>]
19 where <source> must be an existing file, directory or a path containing
20 wildcards, <destination> and the optional <copy-destination> must be existing
21 directories.
diff --git a/cmake/installdata/windows/addons.txt b/cmake/installdata/windows/addons.txt
index 92bf9b3..a3bdd44 100644
--- a/cmake/installdata/windows/addons.txt
+++ b/cmake/installdata/windows/addons.txt
@@ -1 +1,3 @@
1addons/repository.pvr-win32.xbmc.org/* 1addons/repository.pvr-win32.xbmc.org/*
2project/BuildDependencies/${ARCH}/addons/script.module.pil KEEP_DIR_STRUCTURE addons
3project/BuildDependencies/${ARCH}/addons/script.module.pycryptodome KEEP_DIR_STRUCTURE addons
diff --git a/cmake/installdata/windows/dlls.txt b/cmake/installdata/windows/dlls.txt
index 25c6500..c17bd76 100644
--- a/cmake/installdata/windows/dlls.txt
+++ b/cmake/installdata/windows/dlls.txt
@@ -1,4 +1,3 @@
1system/*.dll .
2project/BuildDependencies/${ARCH}/bin/libbluray*.jar . 1project/BuildDependencies/${ARCH}/bin/libbluray*.jar .
3project/BuildDependencies/${ARCH}/bin/*.dll . 2project/BuildDependencies/${ARCH}/bin/*.dll .
4project/BuildDependencies/mingwlibs/${ARCH}/bin/*.dll . 3project/BuildDependencies/mingwlibs/${ARCH}/bin/*.dll .
diff --git a/cmake/installdata/windowsstore/addons.txt b/cmake/installdata/windowsstore/addons.txt
new file mode 100644
index 0000000..4b8678b
--- /dev/null
+++ b/cmake/installdata/windowsstore/addons.txt
@@ -0,0 +1,3 @@
1addons/repository.pvr-win32.xbmc.org/*
2project/BuildDependencies/win10-${ARCH}/addons/*
3system/addon-manifest-uwp.xml \ No newline at end of file
diff --git a/cmake/installdata/windowsstore/dlls.txt b/cmake/installdata/windowsstore/dlls.txt
new file mode 100644
index 0000000..a927b3d
--- /dev/null
+++ b/cmake/installdata/windowsstore/dlls.txt
@@ -0,0 +1,2 @@
1project/BuildDependencies/win10-${ARCH}/bin/*.dll dlls
2project/BuildDependencies/mingwlibs/win10-${ARCH}/bin/*.dll dlls
diff --git a/cmake/installdata/windowsstore/irss.txt b/cmake/installdata/windowsstore/irss.txt
new file mode 100644
index 0000000..6fd8d48
--- /dev/null
+++ b/cmake/installdata/windowsstore/irss.txt
@@ -0,0 +1,2 @@
1system/IRSSmap.xml
2system/X10-Lola-IRSSmap.xml
diff --git a/cmake/installdata/windowsstore/python.txt b/cmake/installdata/windowsstore/python.txt
new file mode 100644
index 0000000..db57ebc
--- /dev/null
+++ b/cmake/installdata/windowsstore/python.txt
@@ -0,0 +1 @@
project/BuildDependencies/win10-${ARCH}/bin/Python KEEP_DIR_STRUCTURE system \ No newline at end of file
diff --git a/cmake/modules/FindAlsa.cmake b/cmake/modules/FindAlsa.cmake
index c99f509..bed4faa 100644
--- a/cmake/modules/FindAlsa.cmake
+++ b/cmake/modules/FindAlsa.cmake
@@ -33,7 +33,7 @@ find_package_handle_standard_args(Alsa
33if(ALSA_FOUND) 33if(ALSA_FOUND)
34 set(ALSA_INCLUDE_DIRS "") # Don't want these added as 'timer.h' is a dangerous file 34 set(ALSA_INCLUDE_DIRS "") # Don't want these added as 'timer.h' is a dangerous file
35 set(ALSA_LIBRARIES ${ALSA_LIBRARY}) 35 set(ALSA_LIBRARIES ${ALSA_LIBRARY})
36 set(ALSA_DEFINITIONS -DHAVE_ALSA=1 -DUSE_ALSA=1) 36 set(ALSA_DEFINITIONS -DHAS_ALSA=1)
37 37
38 if(NOT TARGET ALSA::ALSA) 38 if(NOT TARGET ALSA::ALSA)
39 add_library(ALSA::ALSA UNKNOWN IMPORTED) 39 add_library(ALSA::ALSA UNKNOWN IMPORTED)
diff --git a/cmake/modules/FindAvahi.cmake b/cmake/modules/FindAvahi.cmake
index 77c3e4d..068b292 100644
--- a/cmake/modules/FindAvahi.cmake
+++ b/cmake/modules/FindAvahi.cmake
@@ -40,21 +40,21 @@ if(AVAHI_FOUND)
40 ${AVAHI_COMMON_INCLUDE_DIR}) 40 ${AVAHI_COMMON_INCLUDE_DIR})
41 set(AVAHI_LIBRARIES ${AVAHI_CLIENT_LIBRARY} 41 set(AVAHI_LIBRARIES ${AVAHI_CLIENT_LIBRARY}
42 ${AVAHI_COMMON_LIBRARY}) 42 ${AVAHI_COMMON_LIBRARY})
43 set(AVAHI_DEFINITIONS -DHAVE_LIBAVAHI_CLIENT=1 -DHAVE_LIBAVAHI_COMMON=1) 43 set(AVAHI_DEFINITIONS -DHAS_AVAHI=1 -DHAS_ZEROCONF=1)
44 44
45 if(NOT TARGET Avahi::Avahi) 45 if(NOT TARGET Avahi::Avahi)
46 add_library(Avahi::Avahi UNKNOWN IMPORTED) 46 add_library(Avahi::Avahi UNKNOWN IMPORTED)
47 set_target_properties(Avahi::Avahi PROPERTIES 47 set_target_properties(Avahi::Avahi PROPERTIES
48 IMPORTED_LOCATION "${AVAHI_CLIENT_LIBRARY}" 48 IMPORTED_LOCATION "${AVAHI_CLIENT_LIBRARY}"
49 INTERFACE_INCLUDE_DIRECTORIES "${AVAHI_CLIENT_INCLUDE_DIR}" 49 INTERFACE_INCLUDE_DIRECTORIES "${AVAHI_CLIENT_INCLUDE_DIR}"
50 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBAVAHI_CLIENT=1) 50 INTERFACE_COMPILE_DEFINITIONS HAS_AVAHI=1)
51 endif() 51 endif()
52 if(NOT TARGET Avahi::AvahiCommon) 52 if(NOT TARGET Avahi::AvahiCommon)
53 add_library(Avahi::AvahiCommon UNKNOWN IMPORTED) 53 add_library(Avahi::AvahiCommon UNKNOWN IMPORTED)
54 set_target_properties(Avahi::AvahiCommon PROPERTIES 54 set_target_properties(Avahi::AvahiCommon PROPERTIES
55 IMPORTED_LOCATION "${AVAHI_COMMON_LIBRARY}" 55 IMPORTED_LOCATION "${AVAHI_COMMON_LIBRARY}"
56 INTERFACE_INCLUDE_DIRECTORIES "${AVAHI_COMMON_INCLUDE_DIR}" 56 INTERFACE_INCLUDE_DIRECTORIES "${AVAHI_COMMON_INCLUDE_DIR}"
57 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBAVAHI_COMMON=1 57 INTERFACE_COMPILE_DEFINITIONS HAS_AVAHI=1
58 INTERFACE_LINK_LIBRARIES Avahi::Avahi) 58 INTERFACE_LINK_LIBRARIES Avahi::Avahi)
59 endif() 59 endif()
60endif() 60endif()
diff --git a/cmake/modules/FindBluray.cmake b/cmake/modules/FindBluray.cmake
index 010fdf1..3c29f54 100644
--- a/cmake/modules/FindBluray.cmake
+++ b/cmake/modules/FindBluray.cmake
@@ -50,6 +50,11 @@ if(BLURAY_FOUND)
50 set(BLURAY_INCLUDE_DIRS ${BLURAY_INCLUDE_DIR}) 50 set(BLURAY_INCLUDE_DIRS ${BLURAY_INCLUDE_DIR})
51 set(BLURAY_DEFINITIONS -DHAVE_LIBBLURAY=1) 51 set(BLURAY_DEFINITIONS -DHAVE_LIBBLURAY=1)
52 52
53 # todo: improve syntax
54 if (NOT CORE_PLATFORM_NAME_LC STREQUAL windowsstore)
55 list(APPEND BLURAY_DEFINITIONS -DHAVE_LIBBLURAY_BDJ=1)
56 endif()
57
53 if(NOT TARGET Bluray::Bluray) 58 if(NOT TARGET Bluray::Bluray)
54 add_library(Bluray::Bluray UNKNOWN IMPORTED) 59 add_library(Bluray::Bluray UNKNOWN IMPORTED)
55 if(BLURAY_LIBRARY) 60 if(BLURAY_LIBRARY)
diff --git a/cmake/modules/FindCurl.cmake b/cmake/modules/FindCurl.cmake
index ed4d81f..d0759a6 100644
--- a/cmake/modules/FindCurl.cmake
+++ b/cmake/modules/FindCurl.cmake
@@ -20,7 +20,7 @@ endif()
20 20
21find_path(CURL_INCLUDE_DIR NAMES curl/curl.h 21find_path(CURL_INCLUDE_DIR NAMES curl/curl.h
22 PATHS ${PC_CURL_INCLUDEDIR}) 22 PATHS ${PC_CURL_INCLUDEDIR})
23find_library(CURL_LIBRARY NAMES curl libcurl 23find_library(CURL_LIBRARY NAMES curl libcurl libcurl_imp
24 PATHS ${PC_CURL_LIBDIR}) 24 PATHS ${PC_CURL_LIBDIR})
25 25
26set(CURL_VERSION ${PC_CURL_VERSION}) 26set(CURL_VERSION ${PC_CURL_VERSION})
diff --git a/cmake/modules/FindD3DX11Effects.cmake b/cmake/modules/FindD3DX11Effects.cmake
index 3fdf7d7..9b1eb15 100644
--- a/cmake/modules/FindD3DX11Effects.cmake
+++ b/cmake/modules/FindD3DX11Effects.cmake
@@ -4,23 +4,26 @@
4# D3DCOMPILER_DLL - Path to the Direct3D Compiler 4# D3DCOMPILER_DLL - Path to the Direct3D Compiler
5# FXC - Path to the DirectX Effects Compiler (FXC) 5# FXC - Path to the DirectX Effects Compiler (FXC)
6 6
7find_file(D3DCOMPILER_DLL 7if(NOT CORE_SYSTEM_NAME STREQUAL windowsstore)
8 NAMES d3dcompiler_47.dll d3dcompiler_46.dll 8 find_file(D3DCOMPILER_DLL
9 PATHS 9 NAMES d3dcompiler_47.dll d3dcompiler_46.dll
10 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/Redist/D3D/${SDK_TARGET_ARCH}" 10 PATHS
11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]/Redist/D3D/${SDK_TARGET_ARCH}" 11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/Redist/D3D/${SDK_TARGET_ARCH}"
12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/Redist/D3D/${SDK_TARGET_ARCH}" 12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]/Redist/D3D/${SDK_TARGET_ARCH}"
13 "$ENV{WindowsSdkDir}Redist/d3d/${SDK_TARGET_ARCH}" 13 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/Redist/D3D/${SDK_TARGET_ARCH}"
14 NO_DEFAULT_PATH) 14 "$ENV{WindowsSdkDir}Redist/d3d/${SDK_TARGET_ARCH}"
15if(NOT D3DCOMPILER_DLL) 15 NO_DEFAULT_PATH)
16 message(WARNING "Could NOT find Direct3D Compiler") 16 if(NOT D3DCOMPILER_DLL)
17 message(WARNING "Could NOT find Direct3D Compiler")
18 endif()
19 mark_as_advanced(D3DCOMPILER_DLL)
20 copy_file_to_buildtree(${D3DCOMPILER_DLL} DIRECTORY .)
17endif() 21endif()
18mark_as_advanced(D3DCOMPILER_DLL)
19copy_file_to_buildtree(${D3DCOMPILER_DLL} DIRECTORY .)
20 22
21find_program(FXC fxc 23find_program(FXC fxc
22 PATHS 24 PATHS
23 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/bin/x86" 25 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/bin/x86"
26 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/bin/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;ProductVersion].0/x86"
24 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]/bin/x86" 27 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]/bin/x86"
25 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/bin/x86" 28 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/bin/x86"
26 "$ENV{WindowsSdkDir}bin/x86") 29 "$ENV{WindowsSdkDir}bin/x86")
diff --git a/cmake/modules/FindDBus.cmake b/cmake/modules/FindDBus.cmake
index 2d64af4..9ea4f8f 100644
--- a/cmake/modules/FindDBus.cmake
+++ b/cmake/modules/FindDBus.cmake
@@ -38,14 +38,14 @@ find_package_handle_standard_args(DBus
38if(DBUS_FOUND) 38if(DBUS_FOUND)
39 set(DBUS_LIBRARIES ${DBUS_LIBRARY}) 39 set(DBUS_LIBRARIES ${DBUS_LIBRARY})
40 set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR}) 40 set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
41 set(DBUS_DEFINITIONS -DHAVE_DBUS=1) 41 set(DBUS_DEFINITIONS -DHAS_DBUS=1)
42 42
43 if(NOT TARGET DBus::DBus) 43 if(NOT TARGET DBus::DBus)
44 add_library(DBus::DBus UNKNOWN IMPORTED) 44 add_library(DBus::DBus UNKNOWN IMPORTED)
45 set_target_properties(DBus::DBus PROPERTIES 45 set_target_properties(DBus::DBus PROPERTIES
46 IMPORTED_LOCATION "${DBUS_LIBRARY}" 46 IMPORTED_LOCATION "${DBUS_LIBRARY}"
47 INTERFACE_INCLUDE_DIRECTORIES "${DBUS_INCLUDE_DIR}" 47 INTERFACE_INCLUDE_DIRECTORIES "${DBUS_INCLUDE_DIR}"
48 INTERFACE_COMPILE_DEFINITIONS HAVE_DBUS=1) 48 INTERFACE_COMPILE_DEFINITIONS HAS_DBUS=1)
49 endif() 49 endif()
50endif() 50endif()
51 51
diff --git a/cmake/modules/FindEGL.cmake b/cmake/modules/FindEGL.cmake
index 93fa530..331ac39 100644
--- a/cmake/modules/FindEGL.cmake
+++ b/cmake/modules/FindEGL.cmake
@@ -14,14 +14,18 @@
14# 14#
15# EGL::EGL - The EGL library 15# EGL::EGL - The EGL library
16 16
17if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
18 set(_brcmprefix brcm)
19endif()
20
17if(PKG_CONFIG_FOUND) 21if(PKG_CONFIG_FOUND)
18 pkg_check_modules(PC_EGL egl QUIET) 22 pkg_check_modules(PC_EGL ${_brcmprefix}egl QUIET)
19endif() 23endif()
20 24
21find_path(EGL_INCLUDE_DIR EGL/egl.h 25find_path(EGL_INCLUDE_DIR EGL/egl.h
22 PATHS ${PC_EGL_INCLUDEDIR}) 26 PATHS ${PC_EGL_INCLUDEDIR})
23 27
24find_library(EGL_LIBRARY NAMES EGL egl 28find_library(EGL_LIBRARY NAMES ${_brcmprefix}EGL egl
25 PATHS ${PC_EGL_LIBDIR}) 29 PATHS ${PC_EGL_LIBDIR})
26 30
27set(EGL_VERSION ${PC_EGL_VERSION}) 31set(EGL_VERSION ${PC_EGL_VERSION})
diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake
index 02c8d28..689cf28 100644
--- a/cmake/modules/FindFFMPEG.cmake
+++ b/cmake/modules/FindFFMPEG.cmake
@@ -33,14 +33,14 @@
33# 33#
34 34
35# required ffmpeg library versions 35# required ffmpeg library versions
36set(REQUIRED_FFMPEG_VERSION 3.3) 36set(REQUIRED_FFMPEG_VERSION 3.4)
37set(_avcodec_ver ">=57.89.100") 37set(_avcodec_ver ">=57.107.100")
38set(_avfilter_ver ">=6.82.100") 38set(_avfilter_ver ">=6.107.100")
39set(_avformat_ver ">=57.71.100") 39set(_avformat_ver ">=57.83.100")
40set(_avutil_ver ">=55.58.100") 40set(_avutil_ver ">=55.78.100")
41set(_swscale_ver ">=4.6.100") 41set(_swscale_ver ">=4.8.100")
42set(_swresample_ver ">=2.7.100") 42set(_swresample_ver ">=2.9.100")
43set(_postproc_ver ">=54.5.100") 43set(_postproc_ver ">=54.7.100")
44 44
45 45
46# Allows building with external ffmpeg not found in system paths, 46# Allows building with external ffmpeg not found in system paths,
@@ -266,7 +266,7 @@ if(NOT FFMPEG_FOUND)
266 266
267 file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper 267 file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper
268"#!/bin/bash 268"#!/bin/bash
269if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}.so* || $@ == *${APP_NAME_LC}-test* ]] 269if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}${APP_BINARY_SUFFIX}* || $@ == *${APP_NAME_LC}.so* || $@ == *${APP_NAME_LC}-test* ]]
270then 270then
271 avformat=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavcodec` 271 avformat=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavcodec`
272 avcodec=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavformat` 272 avcodec=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavformat`
diff --git a/cmake/modules/FindFmt.cmake b/cmake/modules/FindFmt.cmake
index 5473ed5..5e47509 100644
--- a/cmake/modules/FindFmt.cmake
+++ b/cmake/modules/FindFmt.cmake
@@ -12,6 +12,50 @@
12# 12#
13# Fmt::Fmt - The Fmt library 13# Fmt::Fmt - The Fmt library
14 14
15if(ENABLE_INTERNAL_FMT)
16 include(ExternalProject)
17 file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/libfmt/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$")
18 string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" FMT_VERSION "${VER}")
19
20 # allow user to override the download URL with a local tarball
21 # needed for offline build envs
22 if(FMT_URL)
23 get_filename_component(FMT_URL "${FMT_URL}" ABSOLUTE)
24 else()
25 set(FMT_URL http://mirrors.kodi.tv/build-deps/sources/fmt-${FMT_VERSION}.tar.gz)
26 endif()
27 if(VERBOSE)
28 message(STATUS "FMT_URL: ${FMT_URL}")
29 endif()
30
31 if(APPLE)
32 set(EXTRA_ARGS "-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}")
33 endif()
34
35 set(FMT_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libfmt.a)
36 set(FMT_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include)
37 externalproject_add(fmt
38 URL ${FMT_URL}
39 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
40 PREFIX ${CORE_BUILD_DIR}/fmt
41 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
42 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
43 -DFMT_DOC=OFF
44 -DFMT_TEST=OFF
45 "${EXTRA_ARGS}"
46 BUILD_BYPRODUCTS ${FMT_LIBRARY})
47 set_target_properties(fmt PROPERTIES FOLDER "External Projects")
48
49 include(FindPackageHandleStandardArgs)
50 find_package_handle_standard_args(Fmt
51 REQUIRED_VARS FMT_LIBRARY FMT_INCLUDE_DIR
52 VERSION_VAR FMT_VERSION)
53
54 set(FMT_LIBRARIES ${FMT_LIBRARY})
55 set(FMT_INCLUDE_DIRS ${FMT_INCLUDE_DIR})
56
57else()
58
15if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) 59if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore)
16 # TODO: fix windows fmt package to include fmt-config.cmake and fmt-config-version.cmake 60 # TODO: fix windows fmt package to include fmt-config.cmake and fmt-config-version.cmake
17 set(FMT_VERSION 3.0.1) 61 set(FMT_VERSION 3.0.1)
@@ -55,3 +99,5 @@ if(FMT_FOUND)
55endif() 99endif()
56 100
57mark_as_advanced(FMT_INCLUDE_DIR FMT_LIBRARY) 101mark_as_advanced(FMT_INCLUDE_DIR FMT_LIBRARY)
102
103endif()
diff --git a/cmake/modules/FindIMX.cmake b/cmake/modules/FindIMX.cmake
deleted file mode 100644
index 3689579..0000000
--- a/cmake/modules/FindIMX.cmake
+++ /dev/null
@@ -1,38 +0,0 @@
1#.rst:
2# FindIMX
3# -------
4# Finds the IMX codec
5#
6# This will will define the following variables::
7#
8# IMX_FOUND - system has IMX
9# IMX_INCLUDE_DIRS - the IMX include directory
10# IMX_DEFINITIONS - the IMX definitions
11# IMX_LIBRARIES - the IMX libraries
12
13if(PKG_CONFIG_FOUND)
14 pkg_check_modules(IMX fslvpuwrap QUIET)
15endif()
16
17find_path(IMX_INCLUDE_DIR NAMES vpu_wrapper.h
18 PATH_SUFFIXES imx-mm/vpu
19 PATHS ${PC_IMX_INCLUDEDIR})
20
21find_library(FSLVPUWRAP_LIBRARY NAMES fslvpuwrap
22 PATHS ${PC_IMX_LIBDIR})
23find_library(VPU_LIBRARY NAMES vpu
24 PATHS ${PC_IMX_LIBDIR})
25find_library(G2D_LIBRARY NAMES g2d
26 PATHS ${PC_IMX_LIBDIR})
27
28include(FindPackageHandleStandardArgs)
29find_package_handle_standard_args(IMX
30 REQUIRED_VARS IMX_INCLUDE_DIR FSLVPUWRAP_LIBRARY VPU_LIBRARY G2D_LIBRARY)
31
32if(IMX_FOUND)
33 set(IMX_INCLUDE_DIRS ${IMX_INCLUDE_DIR})
34 set(IMX_LIBRARIES ${FSLVPUWRAP_LIBRARY} ${VPU_LIBRARY} ${G2D_LIBRARY})
35 set(IMX_DEFINITIONS -DHAS_IMXVPU=1 -DLINUX -DEGL_API_FB)
36endif()
37
38mark_as_advanced(IMX_INCLUDE_DIR FSLVPUWRAP_LIBRARY VPU_LIBRARY G2D_LIBRARY)
diff --git a/cmake/modules/FindIconv.cmake b/cmake/modules/FindIconv.cmake
new file mode 100644
index 0000000..8ee01fb
--- /dev/null
+++ b/cmake/modules/FindIconv.cmake
@@ -0,0 +1,44 @@
1#.rst:
2# FindICONV
3# --------
4# Finds the ICONV library
5#
6# This will will define the following variables::
7#
8# ICONV_FOUND - system has ICONV
9# ICONV_INCLUDE_DIRS - the ICONV include directory
10# ICONV_LIBRARIES - the ICONV libraries
11#
12# and the following imported targets::
13#
14# ICONV::ICONV - The ICONV library
15
16find_path(ICONV_INCLUDE_DIR NAMES iconv.h)
17
18find_library(ICONV_LIBRARY NAMES iconv libiconv c)
19
20set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
21check_function_exists(iconv HAVE_ICONV_FUNCTION)
22if(NOT HAVE_ICONV_FUNCTION)
23 check_function_exists(libiconv HAVE_LIBICONV_FUNCTION2)
24 set(HAVE_ICONV_FUNCTION ${HAVE_LIBICONV_FUNCTION2})
25 unset(HAVE_LIBICONV_FUNCTION2)
26endif()
27
28include(FindPackageHandleStandardArgs)
29find_package_handle_standard_args(Iconv
30 REQUIRED_VARS ICONV_LIBRARY ICONV_INCLUDE_DIR HAVE_ICONV_FUNCTION)
31
32if(ICONV_FOUND)
33 set(ICONV_LIBRARIES ${ICONV_LIBRARY})
34 set(ICONV_INCLUDE_DIRS ${ICONV_INCLUDE_DIR})
35
36 if(NOT TARGET ICONV::ICONV)
37 add_library(ICONV::ICONV UNKNOWN IMPORTED)
38 set_target_properties(ICONV::ICONV PROPERTIES
39 IMPORTED_LOCATION "${ICONV_LIBRARY}"
40 INTERFACE_INCLUDE_DIRECTORIES "${ICONV_INCLUDE_DIR}")
41 endif()
42endif()
43
44mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIBRARY HAVE_ICONV_FUNCTION)
diff --git a/cmake/modules/FindJsonSchemaBuilder.cmake b/cmake/modules/FindJsonSchemaBuilder.cmake
index 9a31dd5..14aa2f5 100644
--- a/cmake/modules/FindJsonSchemaBuilder.cmake
+++ b/cmake/modules/FindJsonSchemaBuilder.cmake
@@ -12,7 +12,7 @@ if(NOT TARGET JsonSchemaBuilder::JsonSchemaBuilder)
12 add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL) 12 add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL)
13 if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) 13 if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore)
14 set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES 14 set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES
15 IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/project/BuildDependencies/bin/json-rpc/JsonSchemaBuilder") 15 IMPORTED_LOCATION "${DEPENDENCIES_DIR}/bin/json-rpc/JsonSchemaBuilder")
16 else() 16 else()
17 set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES 17 set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES
18 IMPORTED_LOCATION "${NATIVEPREFIX}/bin/JsonSchemaBuilder") 18 IMPORTED_LOCATION "${NATIVEPREFIX}/bin/JsonSchemaBuilder")
diff --git a/cmake/modules/FindLibDvd.cmake b/cmake/modules/FindLibDvd.cmake
index 86af89c..5c72826 100644
--- a/cmake/modules/FindLibDvd.cmake
+++ b/cmake/modules/FindLibDvd.cmake
@@ -1,133 +1,146 @@
1if(NOT WIN32) 1if(KODI_DEPENDSBUILD)
2 if(KODI_DEPENDSBUILD) 2 set(_dvdlibs dvdread dvdnav)
3 set(_dvdlibs dvdread dvdnav) 3 set(_handlevars LIBDVD_INCLUDE_DIRS DVDREAD_LIBRARY DVDNAV_LIBRARY)
4 set(_handlevars LIBDVD_INCLUDE_DIRS DVDREAD_LIBRARY DVDNAV_LIBRARY) 4 if(ENABLE_DVDCSS)
5 if(ENABLE_DVDCSS) 5 list(APPEND _dvdlibs libdvdcss)
6 list(APPEND _dvdlibs libdvdcss) 6 list(APPEND _handlevars DVDCSS_LIBRARY)
7 list(APPEND _handlevars DVDCSS_LIBRARY) 7 endif()
8 endif()
9 8
10 if(PKG_CONFIG_FOUND) 9 if(PKG_CONFIG_FOUND)
11 pkg_check_modules(PC_DVD ${_dvdlibs} QUIET) 10 pkg_check_modules(PC_DVD ${_dvdlibs} QUIET)
12 endif() 11 endif()
13 12
14 find_path(LIBDVD_INCLUDE_DIRS dvdnav/dvdnav.h PATHS ${PC_DVD_INCLUDE_DIRS}) 13 find_path(LIBDVD_INCLUDE_DIRS dvdnav/dvdnav.h PATHS ${PC_DVD_INCLUDE_DIRS})
15 find_library(DVDREAD_LIBRARY NAMES dvdread libdvdread PATHS ${PC_DVD_dvdread_LIBDIR}) 14 find_library(DVDREAD_LIBRARY NAMES dvdread libdvdread PATHS ${PC_DVD_dvdread_LIBDIR})
16 find_library(DVDNAV_LIBRARY NAMES dvdnav libdvdnav PATHS ${PC_DVD_dvdnav_LIBDIR}) 15 find_library(DVDNAV_LIBRARY NAMES dvdnav libdvdnav PATHS ${PC_DVD_dvdnav_LIBDIR})
16 if(ENABLE_DVDCSS)
17 find_library(DVDCSS_LIBRARY NAMES dvdcss libdvdcss PATHS ${PC_DVD_libdvdcss_LIBDIR})
18 endif()
19
20 include(FindPackageHandleStandardArgs)
21 find_package_handle_standard_args(LibDvd REQUIRED_VARS ${_handlevars})
22 if(LIBDVD_FOUND)
23 add_library(dvdnav UNKNOWN IMPORTED)
24 set_target_properties(dvdnav PROPERTIES
25 FOLDER "External Projects"
26 IMPORTED_LOCATION "${DVDNAV_LIBRARY}")
27
28 add_library(dvdread UNKNOWN IMPORTED)
29 set_target_properties(dvdread PROPERTIES
30 FOLDER "External Projects"
31 IMPORTED_LOCATION "${DVDREAD_LIBRARY}")
32 add_library(dvdcss UNKNOWN IMPORTED)
33 set_target_properties(dvdcss PROPERTIES
34 FOLDER "External Projects"
35 IMPORTED_LOCATION "${DVDCSS_LIBRARY}")
36
37 set(_linklibs ${DVDREAD_LIBRARY})
17 if(ENABLE_DVDCSS) 38 if(ENABLE_DVDCSS)
18 find_library(DVDCSS_LIBRARY NAMES dvdcss libdvdcss PATHS ${PC_DVD_libdvdcss_LIBDIR}) 39 list(APPEND _linklibs ${DVDCSS_LIBRARY})
19 endif() 40 endif()
20 41 core_link_library(${DVDNAV_LIBRARY} system/players/VideoPlayer/libdvdnav dvdnav archives "${_linklibs}")
21 include(FindPackageHandleStandardArgs) 42 set(LIBDVD_LIBRARIES ${DVDNAV_LIBRARY})
22 find_package_handle_standard_args(LibDvd REQUIRED_VARS ${_handlevars}) 43 mark_as_advanced(LIBDVD_INCLUDE_DIRS LIBDVD_LIBRARIES)
23 if(LIBDVD_FOUND) 44 endif()
24 add_library(dvdnav UNKNOWN IMPORTED) 45else()
25 set_target_properties(dvdnav PROPERTIES 46 set(dvdlibs libdvdread libdvdnav)
26 FOLDER "External Projects" 47 if(ENABLE_DVDCSS)
27 IMPORTED_LOCATION "${DVDNAV_LIBRARY}") 48 list(APPEND dvdlibs libdvdcss)
28 49 endif()
29 add_library(dvdread UNKNOWN IMPORTED) 50 set(DEPENDS_TARGETS_DIR ${CMAKE_SOURCE_DIR}/tools/depends/target)
30 set_target_properties(dvdread PROPERTIES 51 foreach(dvdlib ${dvdlibs})
31 FOLDER "External Projects" 52 file(GLOB VERSION_FILE ${DEPENDS_TARGETS_DIR}/${dvdlib}/DVD*-VERSION)
32 IMPORTED_LOCATION "${DVDREAD_LIBRARY}") 53 file(STRINGS ${VERSION_FILE} VER)
33 add_library(dvdcss UNKNOWN IMPORTED) 54 string(REGEX MATCH "VERSION=[^ ]*$.*" ${dvdlib}_VER "${VER}")
34 set_target_properties(dvdcss PROPERTIES 55 list(GET ${dvdlib}_VER 0 ${dvdlib}_VER)
35 FOLDER "External Projects" 56 string(SUBSTRING "${${dvdlib}_VER}" 8 -1 ${dvdlib}_VER)
36 IMPORTED_LOCATION "${DVDCSS_LIBRARY}") 57 string(REGEX MATCH "BASE_URL=([^ ]*)" ${dvdlib}_BASE_URL "${VER}")
37 58 list(GET ${dvdlib}_BASE_URL 0 ${dvdlib}_BASE_URL)
38 set(_linklibs ${DVDREAD_LIBRARY}) 59 string(SUBSTRING "${${dvdlib}_BASE_URL}" 9 -1 ${dvdlib}_BASE_URL)
39 if(ENABLE_DVDCSS) 60 string(TOUPPER ${dvdlib} DVDLIB)
40 list(APPEND _linklibs ${DVDCSS_LIBRARY}) 61
41 endif() 62 # allow user to override the download URL with a local tarball
42 core_link_library(${DVDNAV_LIBRARY} system/players/VideoPlayer/libdvdnav dvdnav archives "${_linklibs}") 63 # needed for offline build envs
43 set(LIBDVD_LIBRARIES ${DVDNAV_LIBRARY}) 64 # allow upper and lowercase var name
44 mark_as_advanced(LIBDVD_INCLUDE_DIRS LIBDVD_LIBRARIES) 65 if(${dvdlib}_URL)
66 set(${DVDLIB}_URL ${${dvdlib}_URL})
45 endif() 67 endif()
46 else() 68 if(${DVDLIB}_URL)
47 set(dvdlibs libdvdread libdvdnav) 69 get_filename_component(${DVDLIB}_URL "${${DVDLIB}_URL}" ABSOLUTE)
48 if(ENABLE_DVDCSS) 70 else()
49 list(APPEND dvdlibs libdvdcss) 71 set(${DVDLIB}_URL ${${dvdlib}_BASE_URL}/archive/${${dvdlib}_VER}.tar.gz)
50 endif() 72 endif()
51 foreach(dvdlib ${dvdlibs}) 73 if(VERBOSE)
52 file(GLOB VERSION_FILE ${CMAKE_SOURCE_DIR}/tools/depends/target/${dvdlib}/DVD*-VERSION) 74 message(STATUS "${DVDLIB}_URL: ${${DVDLIB}_URL}")
53 file(STRINGS ${VERSION_FILE} VER)
54 string(REGEX MATCH "VERSION=[^ ]*$.*" ${dvdlib}_VER "${VER}")
55 list(GET ${dvdlib}_VER 0 ${dvdlib}_VER)
56 string(SUBSTRING "${${dvdlib}_VER}" 8 -1 ${dvdlib}_VER)
57 string(REGEX MATCH "BASE_URL=([^ ]*)" ${dvdlib}_BASE_URL "${VER}")
58 list(GET ${dvdlib}_BASE_URL 0 ${dvdlib}_BASE_URL)
59 string(SUBSTRING "${${dvdlib}_BASE_URL}" 9 -1 ${dvdlib}_BASE_URL)
60 string(TOUPPER ${dvdlib} DVDLIB)
61
62 # allow user to override the download URL with a local tarball
63 # needed for offline build envs
64 # allow upper and lowercase var name
65 if(${dvdlib}_URL)
66 set(${DVDLIB}_URL ${${dvdlib}_URL})
67 endif()
68 if(${DVDLIB}_URL)
69 get_filename_component(${DVDLIB}_URL "${${DVDLIB}_URL}" ABSOLUTE)
70 else()
71 set(${DVDLIB}_URL ${${dvdlib}_BASE_URL}/archive/${${dvdlib}_VER}.tar.gz)
72 endif()
73 if(VERBOSE)
74 message(STATUS "${DVDLIB}_URL: ${${DVDLIB}_URL}")
75 endif()
76 endforeach()
77
78 set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include")
79 if(CMAKE_CROSSCOMPILING)
80 set(EXTRA_FLAGS "CC=${CMAKE_C_COMPILER}")
81 endif() 75 endif()
76 endforeach()
82 77
83 if(APPLE) 78 set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include")
84 set(CMAKE_LD_FLAGS "-framework IOKit -framework CoreFoundation") 79 if(CMAKE_CROSSCOMPILING)
85 endif() 80 set(EXTRA_FLAGS "CC=${CMAKE_C_COMPILER}")
81 endif()
82
83 if(APPLE)
84 set(CMAKE_LD_FLAGS "-framework IOKit -framework CoreFoundation")
85 endif()
86 86
87 set(HOST_ARCH ${ARCH}) 87 set(HOST_ARCH ${ARCH})
88 if(CORE_SYSTEM_NAME STREQUAL android) 88 if(CORE_SYSTEM_NAME STREQUAL android)
89 if(ARCH STREQUAL arm) 89 if(ARCH STREQUAL arm)
90 set(HOST_ARCH arm-linux-androideabi) 90 set(HOST_ARCH arm-linux-androideabi)
91 elseif(ARCH STREQUAL aarch64) 91 elseif(ARCH STREQUAL aarch64)
92 set(HOST_ARCH aarch64-linux-android) 92 set(HOST_ARCH aarch64-linux-android)
93 elseif(ARCH STREQUAL i486-linux) 93 elseif(ARCH STREQUAL i486-linux)
94 set(HOST_ARCH i686-linux-android) 94 set(HOST_ARCH i686-linux-android)
95 endif()
96 endif() 95 endif()
96 elseif(CORE_SYSTEM_NAME STREQUAL windowsstore)
97 set(LIBDVD_ADDITIONAL_ARGS "-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}" "-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}")
98 endif()
97 99
98 if(ENABLE_DVDCSS) 100 if(ENABLE_DVDCSS)
101 if(NOT CORE_SYSTEM_NAME MATCHES windows)
99 set(DVDCSS_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a) 102 set(DVDCSS_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a)
100 ExternalProject_Add(dvdcss URL ${LIBDVDCSS_URL} 103 ExternalProject_Add(dvdcss URL ${LIBDVDCSS_URL}
101 DOWNLOAD_NAME libdvdcss-${libdvdcss_VER}.tar.gz 104 DOWNLOAD_NAME libdvdcss-${libdvdcss_VER}.tar.gz
102 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download 105 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
103 PREFIX ${CORE_BUILD_DIR}/libdvd 106 PREFIX ${CORE_BUILD_DIR}/libdvd
104 CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure 107 CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure
105 --target=${HOST_ARCH} 108 --target=${HOST_ARCH}
106 --host=${HOST_ARCH} 109 --host=${HOST_ARCH}
107 --disable-doc 110 --disable-doc
108 --enable-static 111 --enable-static
109 --disable-shared 112 --disable-shared
110 --with-pic 113 --with-pic
111 --prefix=<INSTALL_DIR> 114 --prefix=<INSTALL_DIR>
112 --libdir=<INSTALL_DIR>/lib 115 --libdir=<INSTALL_DIR>/lib
113 "${EXTRA_FLAGS}" 116 "${EXTRA_FLAGS}"
114 "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" 117 "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}"
115 "LDFLAGS=${CMAKE_LD_FLAGS}" 118 "LDFLAGS=${CMAKE_LD_FLAGS}"
116 BUILD_BYPRODUCTS ${DVDCSS_LIBRARY}) 119 BUILD_BYPRODUCTS ${DVDCSS_LIBRARY})
117 ExternalProject_Add_Step(dvdcss autoreconf 120 ExternalProject_Add_Step(dvdcss autoreconf
118 DEPENDEES download update patch 121 DEPENDEES download update patch
119 DEPENDERS configure 122 DEPENDERS configure
120 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif 123 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
121 WORKING_DIRECTORY <SOURCE_DIR>) 124 WORKING_DIRECTORY <SOURCE_DIR>)
122 125 else()
123 set_target_properties(dvdcss PROPERTIES FOLDER "External Projects") 126 ExternalProject_Add(dvdcss
127 URL ${LIBDVDCSS_URL}
128 DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/project/BuildDependencies/downloads
129 DOWNLOAD_NAME libdvdcss-${libdvdcss_VER}.tar.gz
130 CMAKE_ARGS
131 ${LIBDVD_ADDITIONAL_ARGS}
132 -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd
133 )
124 endif() 134 endif()
135 set_target_properties(dvdcss PROPERTIES FOLDER "External Projects")
136 endif()
125 137
126 set(DVDREAD_CFLAGS "-D_XBMC -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include") 138 set(DVDREAD_CFLAGS "-D_XBMC -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include")
127 if(ENABLE_DVDCSS) 139 if(ENABLE_DVDCSS)
128 set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -DHAVE_DVDCSS_DVDCSS_H") 140 set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -DHAVE_DVDCSS_DVDCSS_H")
129 endif() 141 endif()
130 142
143 if(NOT CORE_SYSTEM_NAME MATCHES windows)
131 set(DVDREAD_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a) 144 set(DVDREAD_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a)
132 ExternalProject_Add(dvdread URL ${LIBDVDREAD_URL} 145 ExternalProject_Add(dvdread URL ${LIBDVDREAD_URL}
133 DOWNLOAD_NAME libdvdread-${libdvdread_VER}.tar.gz 146 DOWNLOAD_NAME libdvdread-${libdvdread_VER}.tar.gz
@@ -146,74 +159,90 @@ if(NOT WIN32)
146 "LDFLAGS=${CMAKE_LD_FLAGS}" 159 "LDFLAGS=${CMAKE_LD_FLAGS}"
147 BUILD_BYPRODUCTS ${DVDREAD_LIBRARY}) 160 BUILD_BYPRODUCTS ${DVDREAD_LIBRARY})
148 ExternalProject_Add_Step(dvdread autoreconf 161 ExternalProject_Add_Step(dvdread autoreconf
149 DEPENDEES download update patch 162 DEPENDEES download update patch
150 DEPENDERS configure 163 DEPENDERS configure
151 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif 164 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
152 WORKING_DIRECTORY <SOURCE_DIR>) 165 WORKING_DIRECTORY <SOURCE_DIR>)
153 if(ENABLE_DVDCSS) 166 else()
154 add_dependencies(dvdread dvdcss) 167 ExternalProject_Add(dvdread
155 endif() 168 URL ${LIBDVDREAD_URL}
169 DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/project/BuildDependencies/downloads
170 DOWNLOAD_NAME libdvdread-${libdvdread_VER}.tar.gz
171 CMAKE_ARGS
172 ${LIBDVD_ADDITIONAL_ARGS}
173 -DCMAKE_PREFIX_PATH:PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd
174 -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd
175 )
176 endif()
177 if(ENABLE_DVDCSS)
178 add_dependencies(dvdread dvdcss)
179 endif()
156 180
157 set_target_properties(dvdread PROPERTIES FOLDER "External Projects") 181 set_target_properties(dvdread PROPERTIES FOLDER "External Projects")
158 182
159 if(ENABLE_DVDCSS) 183 if(ENABLE_DVDCSS)
160 set(DVDNAV_LIBS -ldvdcss) 184 set(DVDNAV_LIBS -ldvdcss)
161 endif() 185 endif()
162 186
187 if(NOT CORE_SYSTEM_NAME MATCHES windows)
163 set(DVDNAV_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a) 188 set(DVDNAV_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a)
164 ExternalProject_Add(dvdnav URL ${LIBDVDNAV_URL} 189 ExternalProject_Add(dvdnav URL ${LIBDVDNAV_URL}
165 DOWNLOAD_NAME libdvdnav-${libdvdnav_VER}.tar.gz 190 DOWNLOAD_NAME libdvdnav-${libdvdnav_VER}.tar.gz
166 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download 191 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
167 PREFIX ${CORE_BUILD_DIR}/libdvd 192 PREFIX ${CORE_BUILD_DIR}/libdvd
168 CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure 193 CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure
169 --target=${HOST_ARCH} 194 --target=${HOST_ARCH}
170 --host=${HOST_ARCH} 195 --host=${HOST_ARCH}
171 --enable-static 196 --enable-static
172 --disable-shared 197 --disable-shared
173 --with-pic 198 --with-pic
174 --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd 199 --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd
175 --libdir=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib 200 --libdir=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib
176 "${EXTRA_FLAGS}" 201 "${EXTRA_FLAGS}"
177 "LDFLAGS=${CMAKE_LD_FLAGS} -L${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib" 202 "LDFLAGS=${CMAKE_LD_FLAGS} -L${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib"
178 "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" 203 "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}"
179 "DVDREAD_CFLAGS=${DVDREAD_CFLAGS}" 204 "DVDREAD_CFLAGS=${DVDREAD_CFLAGS}"
180 "DVDREAD_LIBS=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.la" 205 "DVDREAD_LIBS=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.la"
181 "LIBS=${DVDNAV_LIBS}" 206 "LIBS=${DVDNAV_LIBS}"
182 BUILD_BYPRODUCTS ${DVDNAV_LIBRARY}) 207 BUILD_BYPRODUCTS ${DVDNAV_LIBRARY})
183 ExternalProject_Add_Step(dvdnav autoreconf 208 ExternalProject_Add_Step(dvdnav autoreconf
184 DEPENDEES download update patch 209 DEPENDEES download update patch
185 DEPENDERS configure 210 DEPENDERS configure
186 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif 211 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
187 WORKING_DIRECTORY <SOURCE_DIR>) 212 WORKING_DIRECTORY <SOURCE_DIR>)
188 add_dependencies(dvdnav dvdread) 213 else()
189 set_target_properties(dvdnav PROPERTIES FOLDER "External Projects") 214 set(DVDNAV_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.lib)
215 ExternalProject_Add(dvdnav
216 URL ${LIBDVDNAV_URL}
217 DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/project/BuildDependencies/downloads
218 DOWNLOAD_NAME libdvdnav-${libdvdnav_VER}.tar.gz
219 CMAKE_ARGS
220 ${LIBDVD_ADDITIONAL_ARGS}
221 -DCMAKE_PREFIX_PATH:PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd
222 -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd
223 )
224 endif()
225 add_dependencies(dvdnav dvdread)
226 set_target_properties(dvdnav PROPERTIES FOLDER "External Projects")
190 227
191 set(_dvdlibs ${DVDREAD_LIBRARY} ${DVDCSS_LIBRARY}) 228 set(_dvdlibs ${DVDREAD_LIBRARY} ${DVDCSS_LIBRARY})
229 if(NOT CORE_SYSTEM_NAME MATCHES windows)
192 # link a shared dvdnav library that includes the whole archives of dvdread and dvdcss as well 230 # link a shared dvdnav library that includes the whole archives of dvdread and dvdcss as well
193 # the quotes around _dvdlibs are on purpose, since we want to pass a list to the function that will be unpacked automatically 231 # the quotes around _dvdlibs are on purpose, since we want to pass a list to the function that will be unpacked automatically
194 core_link_library(${DVDNAV_LIBRARY} system/players/VideoPlayer/libdvdnav dvdnav archives "${_dvdlibs}") 232 core_link_library(${DVDNAV_LIBRARY} system/players/VideoPlayer/libdvdnav dvdnav archives "${_dvdlibs}")
195 233 else()
196 set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include) 234 set(LIBDVD_TARGET_DIR .)
197 set(LIBDVD_LIBRARIES ${DVDNAV_LIBRARY} ${DVDREAD_LIBRARY}) 235 if(CORE_SYSTEM_NAME STREQUAL windowsstore)
198 if(ENABLE_DVDCSS) 236 set(LIBDVD_TARGET_DIR dlls)
199 list(APPEND LIBDVD_LIBRARIES ${DVDCSS_LIBRARY})
200 endif()
201 set(LIBDVD_LIBRARIES ${LIBDVD_LIBRARIES} CACHE STRING "libdvd libraries" FORCE)
202 set(LIBDVD_FOUND 1 CACHE BOOL "libdvd found" FORCE)
203 endif() 237 endif()
204else() 238 copy_file_to_buildtree(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/bin/libdvdnav.dll DIRECTORY ${LIBDVD_TARGET_DIR})
205 # Dynamically loaded on Windows
206 find_path(LIBDVD_INCLUDE_DIR dvdcss/dvdcss.h)
207
208 include(FindPackageHandleStandardArgs)
209 find_package_handle_standard_args(LibDvd REQUIRED_VARS LIBDVD_INCLUDE_DIR)
210
211 if(LIBDVD_FOUND)
212 set(LIBDVD_INCLUDE_DIRS ${LIBDVD_INCLUDE_DIR})
213
214 add_custom_target(dvdnav)
215 set_target_properties(dvdnav PROPERTIES FOLDER "External Projects")
216 endif() 239 endif()
217 240
218 mark_as_advanced(LIBDVD_INCLUDE_DIR) 241 set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include)
219endif() 242 set(LIBDVD_LIBRARIES ${DVDNAV_LIBRARY} ${DVDREAD_LIBRARY})
243 if(ENABLE_DVDCSS)
244 list(APPEND LIBDVD_LIBRARIES ${DVDCSS_LIBRARY})
245 endif()
246 set(LIBDVD_LIBRARIES ${LIBDVD_LIBRARIES} CACHE STRING "libdvd libraries" FORCE)
247 set(LIBDVD_FOUND 1 CACHE BOOL "libdvd found" FORCE)
248endif() \ No newline at end of file
diff --git a/cmake/modules/FindMDNS.cmake b/cmake/modules/FindMDNS.cmake
index c001f7b..9294708 100644
--- a/cmake/modules/FindMDNS.cmake
+++ b/cmake/modules/FindMDNS.cmake
@@ -26,9 +26,9 @@ find_package_handle_standard_args(MDNS
26if(MDNS_FOUND) 26if(MDNS_FOUND)
27 set(MDNS_INCLUDE_DIRS ${MDNS_INCLUDE_DIR}) 27 set(MDNS_INCLUDE_DIRS ${MDNS_INCLUDE_DIR})
28 set(MDNS_LIBRARIES ${MDNS_LIBRARY}) 28 set(MDNS_LIBRARIES ${MDNS_LIBRARY})
29 set(MDNS_DEFINITIONS -DHAVE_LIBMDNS=1) 29 set(MDNS_DEFINITIONS -DHAS_MDNS=1 -DHAS_ZEROCONF=1)
30 if(MDNS_EMBEDDED_INCLUDE_DIR) 30 if(MDNS_EMBEDDED_INCLUDE_DIR)
31 list(APPEND MDNS_DEFINITIONS -DHAVE_LIBMDNSEMBEDDED=1) 31 list(APPEND MDNS_DEFINITIONS -DHAS_MDNS_EMBEDDED=1)
32 endif() 32 endif()
33 33
34 if(NOT TARGET MDNS::MDNS) 34 if(NOT TARGET MDNS::MDNS)
@@ -36,10 +36,10 @@ if(MDNS_FOUND)
36 set_target_properties(MDNS::MDNS PROPERTIES 36 set_target_properties(MDNS::MDNS PROPERTIES
37 IMPORTED_LOCATION "${MDNS_LIBRARY}" 37 IMPORTED_LOCATION "${MDNS_LIBRARY}"
38 INTERFACE_INCLUDE_DIRECTORIES "${MDNS_INCLUDE_DIR}" 38 INTERFACE_INCLUDE_DIRECTORIES "${MDNS_INCLUDE_DIR}"
39 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBMDNS=1) 39 INTERFACE_COMPILE_DEFINITIONS HAS_MDNS=1)
40 if(MDNS_EMBEDDED_INCLUDE_DIR) 40 if(MDNS_EMBEDDED_INCLUDE_DIR)
41 set_target_properties(MDNS::MDNS PROPERTIES 41 set_target_properties(MDNS::MDNS PROPERTIES
42 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBMDNSEMBEDDED=1) 42 INTERFACE_COMPILE_DEFINITIONS HAS_MDNS_EMBEDDED=1)
43 endif() 43 endif()
44 endif() 44 endif()
45endif() 45endif()
diff --git a/cmake/modules/FindMicroHttpd.cmake b/cmake/modules/FindMicroHttpd.cmake
index 8eecbc4..232f8e5 100644
--- a/cmake/modules/FindMicroHttpd.cmake
+++ b/cmake/modules/FindMicroHttpd.cmake
@@ -33,7 +33,7 @@ find_package_handle_standard_args(MicroHttpd
33if(MICROHTTPD_FOUND) 33if(MICROHTTPD_FOUND)
34 set(MICROHTTPD_LIBRARIES ${MICROHTTPD_LIBRARY}) 34 set(MICROHTTPD_LIBRARIES ${MICROHTTPD_LIBRARY})
35 set(MICROHTTPD_INCLUDE_DIRS ${MICROHTTPD_INCLUDE_DIR}) 35 set(MICROHTTPD_INCLUDE_DIRS ${MICROHTTPD_INCLUDE_DIR})
36 set(MICROHTTPD_DEFINITIONS -DHAVE_LIBMICROHTTPD=1) 36 set(MICROHTTPD_DEFINITIONS -DHAS_WEB_SERVER=1 -DHAS_WEB_INTERFACE=1)
37 37
38 if(KODI_DEPENDSBUILD AND NOT WIN32) 38 if(KODI_DEPENDSBUILD AND NOT WIN32)
39 find_library(GCRYPT_LIBRARY gcrypt) 39 find_library(GCRYPT_LIBRARY gcrypt)
diff --git a/cmake/modules/FindMySqlClient.cmake b/cmake/modules/FindMySqlClient.cmake
index 7b48577..50db582 100644
--- a/cmake/modules/FindMySqlClient.cmake
+++ b/cmake/modules/FindMySqlClient.cmake
@@ -46,7 +46,7 @@ find_package_handle_standard_args(MySqlClient
46if(MYSQLCLIENT_FOUND) 46if(MYSQLCLIENT_FOUND)
47 set(MYSQLCLIENT_LIBRARIES ${MYSQLCLIENT_LIBRARY}) 47 set(MYSQLCLIENT_LIBRARIES ${MYSQLCLIENT_LIBRARY})
48 set(MYSQLCLIENT_INCLUDE_DIRS ${MYSQLCLIENT_INCLUDE_DIR}) 48 set(MYSQLCLIENT_INCLUDE_DIRS ${MYSQLCLIENT_INCLUDE_DIR})
49 set(MYSQLCLIENT_DEFINITIONS -DHAVE_MYSQL=1) 49 set(MYSQLCLIENT_DEFINITIONS -DHAS_MYSQL=1)
50 50
51 if(NOT TARGET MySqlClient::MySqlClient) 51 if(NOT TARGET MySqlClient::MySqlClient)
52 add_library(MySqlClient::MySqlClient UNKNOWN IMPORTED) 52 add_library(MySqlClient::MySqlClient UNKNOWN IMPORTED)
@@ -62,7 +62,7 @@ if(MYSQLCLIENT_FOUND)
62 endif() 62 endif()
63 set_target_properties(MySqlClient::MySqlClient PROPERTIES 63 set_target_properties(MySqlClient::MySqlClient PROPERTIES
64 INTERFACE_INCLUDE_DIRECTORIES "${MYSQLCLIENT_INCLUDE_DIR}" 64 INTERFACE_INCLUDE_DIRECTORIES "${MYSQLCLIENT_INCLUDE_DIR}"
65 INTERFACE_COMPILE_DEFINITIONS HAVE_MYSQL=1) 65 INTERFACE_COMPILE_DEFINITIONS HAS_MYSQL=1)
66 endif() 66 endif()
67endif() 67endif()
68 68
diff --git a/cmake/modules/FindNFS.cmake b/cmake/modules/FindNFS.cmake
index 646ee33..b304bf3 100644
--- a/cmake/modules/FindNFS.cmake
+++ b/cmake/modules/FindNFS.cmake
@@ -41,7 +41,7 @@ endif()
41if(NFS_FOUND) 41if(NFS_FOUND)
42 set(NFS_LIBRARIES ${NFS_LIBRARY}) 42 set(NFS_LIBRARIES ${NFS_LIBRARY})
43 set(NFS_INCLUDE_DIRS ${NFS_INCLUDE_DIR}) 43 set(NFS_INCLUDE_DIRS ${NFS_INCLUDE_DIR})
44 set(NFS_DEFINITIONS -DHAVE_LIBNFS=1) 44 set(NFS_DEFINITIONS -DHAS_FILESYSTEM_NFS=1)
45 45
46 if(NOT TARGET NFS::NFS) 46 if(NOT TARGET NFS::NFS)
47 add_library(NFS::NFS UNKNOWN IMPORTED) 47 add_library(NFS::NFS UNKNOWN IMPORTED)
@@ -51,7 +51,7 @@ if(NFS_FOUND)
51 endif() 51 endif()
52 set_target_properties(NFS::NFS PROPERTIES 52 set_target_properties(NFS::NFS PROPERTIES
53 INTERFACE_INCLUDE_DIRECTORIES "${NFS_INCLUDE_DIR}" 53 INTERFACE_INCLUDE_DIRECTORIES "${NFS_INCLUDE_DIR}"
54 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBNFS=1) 54 INTERFACE_COMPILE_DEFINITIONS HAS_FILESYSTEM_NFS=1)
55 endif() 55 endif()
56endif() 56endif()
57 57
diff --git a/cmake/modules/FindOpenGLES.cmake b/cmake/modules/FindOpenGLES.cmake
index 4333a69..fac21bc 100644
--- a/cmake/modules/FindOpenGLES.cmake
+++ b/cmake/modules/FindOpenGLES.cmake
@@ -10,14 +10,18 @@
10# OPENGLES_LIBRARIES - the OpenGLES libraries 10# OPENGLES_LIBRARIES - the OpenGLES libraries
11# OPENGLES_DEFINITIONS - the OpenGLES definitions 11# OPENGLES_DEFINITIONS - the OpenGLES definitions
12 12
13if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
14 set(_brcmprefix brcm)
15endif()
16
13if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
14 pkg_check_modules(PC_OPENGLES glesv2 QUIET) 18 pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET)
15endif() 19endif()
16 20
17if(NOT CORE_SYSTEM_NAME STREQUAL ios) 21if(NOT CORE_SYSTEM_NAME STREQUAL ios)
18 find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h 22 find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h
19 PATHS ${PC_OPENGLES_INCLUDEDIR}) 23 PATHS ${PC_OPENGLES_INCLUDEDIR})
20 find_library(OPENGLES_gl_LIBRARY NAMES GLESv2 24 find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2
21 PATHS ${PC_OPENGLES_LIBDIR}) 25 PATHS ${PC_OPENGLES_LIBDIR})
22else() 26else()
23 find_library(OPENGLES_gl_LIBRARY NAMES OpenGLES 27 find_library(OPENGLES_gl_LIBRARY NAMES OpenGLES
@@ -27,14 +31,24 @@ else()
27 set(OPENGLES_INCLUDE_DIR ${OPENGLES_gl_LIBRARY}/Headers) 31 set(OPENGLES_INCLUDE_DIR ${OPENGLES_gl_LIBRARY}/Headers)
28endif() 32endif()
29 33
34find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h)
35
30include(FindPackageHandleStandardArgs) 36include(FindPackageHandleStandardArgs)
31find_package_handle_standard_args(OpenGLES 37find_package_handle_standard_args(OpenGLES
32 REQUIRED_VARS OPENGLES_gl_LIBRARY OPENGLES_INCLUDE_DIR) 38 REQUIRED_VARS OPENGLES_gl_LIBRARY OPENGLES_INCLUDE_DIR)
33 39
40find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h
41 PATHS ${PC_OPENGLES_INCLUDEDIR})
42
34if(OPENGLES_FOUND) 43if(OPENGLES_FOUND)
35 set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR})
36 set(OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY}) 44 set(OPENGLES_LIBRARIES ${OPENGLES_gl_LIBRARY})
37 set(OPENGLES_DEFINITIONS -DHAVE_LIBGLESV2) 45 if(OPENGLES3_INCLUDE_DIR)
46 set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR} ${OPENGLES3_INCLUDE_DIR})
47 set(OPENGLES_DEFINITIONS -DHAS_GLES=3)
48 mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES3_INCLUDE_DIR OPENGLES_gl_LIBRARY)
49 else()
50 set(OPENGLES_INCLUDE_DIRS ${OPENGLES_INCLUDE_DIR})
51 set(OPENGLES_DEFINITIONS -DHAS_GLES=2)
52 mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES_gl_LIBRARY)
53 endif()
38endif() 54endif()
39
40mark_as_advanced(OPENGLES_INCLUDE_DIR OPENGLES_gl_LIBRARY)
diff --git a/cmake/modules/FindOpenGLES3.cmake b/cmake/modules/FindOpenGLES3.cmake
deleted file mode 100644
index 394328d..0000000
--- a/cmake/modules/FindOpenGLES3.cmake
+++ /dev/null
@@ -1,24 +0,0 @@
1#.rst:
2# FindOpenGLES3
3# ------------
4# Finds the OpenGLES3 library
5#
6# This will will define the following variables::
7#
8# OPENGLES3_FOUND - system has OpenGLES3
9# OPENGLES3_INCLUDE_DIRS - the OpenGLES3 include directory
10# OPENGLES3_DEFINITIONS - the OpenGLES3 definitions
11
12
13find_path(OPENGLES3_INCLUDE_DIR GLES3/gl3.h)
14
15include(FindPackageHandleStandardArgs)
16find_package_handle_standard_args(OpenGLES3
17 REQUIRED_VARS OPENGLES3_INCLUDE_DIR)
18
19if(OPENGLES3_FOUND)
20 set(OPENGLES3_INCLUDE_DIRS ${OPENGLES3_INCLUDE_DIR})
21 set(OPENGLES3_DEFINITIONS -DHAVE_LIBGLESV3)
22endif()
23
24mark_as_advanced(OPENGLES3_INCLUDE_DIR)
diff --git a/cmake/modules/FindOpenGl.cmake b/cmake/modules/FindOpenGl.cmake
index b8cff79..af1c433 100644
--- a/cmake/modules/FindOpenGl.cmake
+++ b/cmake/modules/FindOpenGl.cmake
@@ -37,7 +37,7 @@ find_package_handle_standard_args(OpenGl
37if(OPENGL_FOUND) 37if(OPENGL_FOUND)
38 set(OPENGL_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) 38 set(OPENGL_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
39 set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) 39 set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
40 set(OPENGL_DEFINITIONS -DHAVE_LIBGL=1) 40 set(OPENGL_DEFINITIONS -DHAS_GL=1)
41endif() 41endif()
42 42
43mark_as_advanced(OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY OPENGL_glu_LIBRARY) 43mark_as_advanced(OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY OPENGL_glu_LIBRARY)
diff --git a/cmake/modules/FindPlist.cmake b/cmake/modules/FindPlist.cmake
index 862da46..0664c10 100644
--- a/cmake/modules/FindPlist.cmake
+++ b/cmake/modules/FindPlist.cmake
@@ -41,7 +41,7 @@ endif()
41if(PLIST_FOUND) 41if(PLIST_FOUND)
42 set(PLIST_LIBRARIES ${PLIST_LIBRARY}) 42 set(PLIST_LIBRARIES ${PLIST_LIBRARY})
43 set(PLIST_INCLUDE_DIRS ${PLIST_INCLUDE_DIR}) 43 set(PLIST_INCLUDE_DIRS ${PLIST_INCLUDE_DIR})
44 set(PLIST_DEFINITIONS -DHAVE_LIBPLIST=1) 44 set(PLIST_DEFINITIONS -DHAS_AIRPLAY=1)
45 45
46 if(NOT TARGET Plist::Plist) 46 if(NOT TARGET Plist::Plist)
47 add_library(Plist::Plist UNKNOWN IMPORTED) 47 add_library(Plist::Plist UNKNOWN IMPORTED)
@@ -51,7 +51,7 @@ if(PLIST_FOUND)
51 endif() 51 endif()
52 set_target_properties(Plist::Plist PROPERTIES 52 set_target_properties(Plist::Plist PROPERTIES
53 INTERFACE_INCLUDE_DIRECTORIES "${PLIST_INCLUDE_DIR}" 53 INTERFACE_INCLUDE_DIRECTORIES "${PLIST_INCLUDE_DIR}"
54 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBPLIST=1) 54 INTERFACE_COMPILE_DEFINITIONS HAS_AIRPLAY=1)
55 endif() 55 endif()
56endif() 56endif()
57 57
diff --git a/cmake/modules/FindPulseAudio.cmake b/cmake/modules/FindPulseAudio.cmake
index 5761005..2ef7910 100644
--- a/cmake/modules/FindPulseAudio.cmake
+++ b/cmake/modules/FindPulseAudio.cmake
@@ -21,14 +21,18 @@ endif()
21if(PKG_CONFIG_FOUND) 21if(PKG_CONFIG_FOUND)
22 pkg_check_modules(PC_PULSEAUDIO libpulse>=${PulseAudio_FIND_VERSION} QUIET) 22 pkg_check_modules(PC_PULSEAUDIO libpulse>=${PulseAudio_FIND_VERSION} QUIET)
23 pkg_check_modules(PC_PULSEAUDIO_MAINLOOP libpulse-mainloop-glib QUIET) 23 pkg_check_modules(PC_PULSEAUDIO_MAINLOOP libpulse-mainloop-glib QUIET)
24 pkg_check_modules(PC_PULSEAUDIO_SIMPLE libpulse-simple QUIET)
24endif() 25endif()
25 26
26find_path(PULSEAUDIO_INCLUDE_DIR NAMES pulse/pulseaudio.h 27find_path(PULSEAUDIO_INCLUDE_DIR NAMES pulse/pulseaudio.h pulse/simple.h
27 PATHS ${PC_PULSEAUDIO_INCLUDEDIR} ${PC_PULSEAUDIO_INCLUDE_DIRS}) 28 PATHS ${PC_PULSEAUDIO_INCLUDEDIR} ${PC_PULSEAUDIO_INCLUDE_DIRS})
28 29
29find_library(PULSEAUDIO_LIBRARY NAMES pulse libpulse 30find_library(PULSEAUDIO_LIBRARY NAMES pulse libpulse
30 PATHS ${PC_PULSEAUDIO_LIBDIR} ${PC_PULSEAUDIO_LIBRARY_DIRS}) 31 PATHS ${PC_PULSEAUDIO_LIBDIR} ${PC_PULSEAUDIO_LIBRARY_DIRS})
31 32
33find_library(PULSEAUDIO_SIMPLE_LIBRARY NAMES pulse-simple libpulse-simple
34 PATHS ${PC_PULSEAUDIO_LIBDIR} ${PC_PULSEAUDIO_LIBRARY_DIRS})
35
32find_library(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib 36find_library(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib
33 PATHS ${PC_PULSEAUDIO_LIBDIR} ${PC_PULSEAUDIO_LIBRARY_DIRS}) 37 PATHS ${PC_PULSEAUDIO_LIBDIR} ${PC_PULSEAUDIO_LIBRARY_DIRS})
34 38
@@ -42,13 +46,13 @@ endif()
42 46
43include(FindPackageHandleStandardArgs) 47include(FindPackageHandleStandardArgs)
44find_package_handle_standard_args(PulseAudio 48find_package_handle_standard_args(PulseAudio
45 REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY PULSEAUDIO_INCLUDE_DIR 49 REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY PULSEAUDIO_SIMPLE_LIBRARY PULSEAUDIO_INCLUDE_DIR
46 VERSION_VAR PULSEAUDIO_VERSION_STRING) 50 VERSION_VAR PULSEAUDIO_VERSION_STRING)
47 51
48if(PULSEAUDIO_FOUND) 52if(PULSEAUDIO_FOUND)
49 set(PULSEAUDIO_INCLUDE_DIRS ${PULSEAUDIO_INCLUDE_DIR}) 53 set(PULSEAUDIO_INCLUDE_DIRS ${PULSEAUDIO_INCLUDE_DIR})
50 set(PULSEAUDIO_LIBRARIES ${PULSEAUDIO_LIBRARY} ${PULSEAUDIO_MAINLOOP_LIBRARY}) 54 set(PULSEAUDIO_LIBRARIES ${PULSEAUDIO_LIBRARY} ${PULSEAUDIO_MAINLOOP_LIBRARY} ${PULSEAUDIO_SIMPLE_LIBRARY})
51 set(PULSEAUDIO_DEFINITIONS -DHAVE_LIBPULSE=1) 55 set(PULSEAUDIO_DEFINITIONS -DHAS_PULSEAUDIO=1)
52 56
53 if(NOT TARGET PulseAudio::PulseAudioMainloop) 57 if(NOT TARGET PulseAudio::PulseAudioMainloop)
54 add_library(PulseAudio::PulseAudioMainloop UNKNOWN IMPORTED) 58 add_library(PulseAudio::PulseAudioMainloop UNKNOWN IMPORTED)
@@ -65,4 +69,4 @@ if(PULSEAUDIO_FOUND)
65 endif() 69 endif()
66endif() 70endif()
67 71
68mark_as_advanced(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY) 72mark_as_advanced(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY PULSEAUDIO_SIMPLE_LIBRARY)
diff --git a/cmake/modules/FindRapidJSON.cmake b/cmake/modules/FindRapidJSON.cmake
index 3c3dc3f..a21ed0b 100644
--- a/cmake/modules/FindRapidJSON.cmake
+++ b/cmake/modules/FindRapidJSON.cmake
@@ -10,7 +10,7 @@
10# 10#
11if(ENABLE_INTERNAL_RapidJSON) 11if(ENABLE_INTERNAL_RapidJSON)
12 include(ExternalProject) 12 include(ExternalProject)
13 file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/rapidjson/Makefile VER REGEX MATCH "^[ ]*VERSION[ ]*=.+$") 13 file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/rapidjson/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$")
14 string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" RJSON_VER "${VER}") 14 string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" RJSON_VER "${VER}")
15 15
16 # allow user to override the download URL with a local tarball 16 # allow user to override the download URL with a local tarball
@@ -36,6 +36,10 @@ if(ENABLE_INTERNAL_RapidJSON)
36 PREFIX ${CORE_BUILD_DIR}/rapidjson 36 PREFIX ${CORE_BUILD_DIR}/rapidjson
37 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} 37 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
38 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} 38 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
39 -DRAPIDJSON_BUILD_DOC=OFF
40 -DRAPIDJSON_BUILD_EXAMPLES=OFF
41 -DRAPIDJSON_BUILD_TESTS=OFF
42 -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF
39 "${EXTRA_ARGS}" 43 "${EXTRA_ARGS}"
40 PATCH_COMMAND patch -p1 < ${CORE_SOURCE_DIR}/tools/depends/target/rapidjson/0001-remove_custom_cxx_flags.patch 44 PATCH_COMMAND patch -p1 < ${CORE_SOURCE_DIR}/tools/depends/target/rapidjson/0001-remove_custom_cxx_flags.patch
41 BUILD_BYPRODUCTS ${RapidJSON_LIBRARY}) 45 BUILD_BYPRODUCTS ${RapidJSON_LIBRARY})
diff --git a/cmake/modules/FindSSE.cmake b/cmake/modules/FindSSE.cmake
index d001b03..b860dca 100644
--- a/cmake/modules/FindSSE.cmake
+++ b/cmake/modules/FindSSE.cmake
@@ -40,6 +40,41 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
40 string(COMPARE EQUAL "avx2" "${_SSE_THERE}" _AVX2_TRUE) 40 string(COMPARE EQUAL "avx2" "${_SSE_THERE}" _AVX2_TRUE)
41 CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK) 41 CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK)
42 endif() 42 endif()
43elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
44 if(CPU MATCHES "amd64" OR CPU MATCHES "i.86")
45 exec_program(cat ARGS "/var/run/dmesg.boot | grep Features" OUTPUT_VARIABLE CPUINFO)
46
47 string(REGEX REPLACE "^.*(SSE).*$" "\\1" _SSE_THERE ${CPUINFO})
48 string(COMPARE EQUAL "SSE" "${_SSE_THERE}" _SSE_TRUE)
49 CHECK_CXX_ACCEPTS_FLAG("-msse" _SSE_OK)
50
51 string(REGEX REPLACE "^.*(SSE2).*$" "\\1" _SSE_THERE ${CPUINFO})
52 string(COMPARE EQUAL "SSE2" "${_SSE_THERE}" _SSE2_TRUE)
53 CHECK_CXX_ACCEPTS_FLAG("-msse2" _SSE2_OK)
54
55 string(REGEX REPLACE "^.*(SSE3).*$" "\\1" _SSE_THERE ${CPUINFO})
56 string(COMPARE EQUAL "SSE3" "${_SSE_THERE}" _SSE3_TRUE)
57 CHECK_CXX_ACCEPTS_FLAG("-msse3" _SSE3_OK)
58
59 string(REGEX REPLACE "^.*(SSSE3).*$" "\\1" _SSE_THERE ${CPUINFO})
60 string(COMPARE EQUAL "SSSE3" "${_SSE_THERE}" _SSSE3_TRUE)
61 CHECK_CXX_ACCEPTS_FLAG("-mssse3" _SSSE3_OK)
62
63 string(REGEX REPLACE "^.*(SSE4.1).*$" "\\1" _SSE_THERE ${CPUINFO})
64 string(COMPARE EQUAL "SSE4.1" "${_SSE_THERE}" _SSE41_TRUE)
65 CHECK_CXX_ACCEPTS_FLAG("-msse4.1" _SSE41_OK)
66 string(REGEX REPLACE "^.*(SSE4.2).*$" "\\1" _SSE_THERE ${CPUINFO})
67 string(COMPARE EQUAL "SSE4.2" "${_SSE_THERE}" _SSE42_TRUE)
68 CHECK_CXX_ACCEPTS_FLAG("-msse4.2" _SSE42_OK)
69
70 string(REGEX REPLACE "^.*(AVX).*$" "\\1" _SSE_THERE ${CPUINFO})
71 string(COMPARE EQUAL "AVX" "${_SSE_THERE}" _AVX_TRUE)
72 CHECK_CXX_ACCEPTS_FLAG("-mavx" _AVX_OK)
73
74 string(REGEX REPLACE "^.*(AVX2).*$" "\\1" _SSE_THERE ${CPUINFO})
75 string(COMPARE EQUAL "AVX2" "${_SSE_THERE}" _AVX2_TRUE)
76 CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK)
77 endif()
43elseif(CMAKE_SYSTEM_NAME MATCHES "Android") 78elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
44 if(CPU MATCHES "x86_64" OR CPU MATCHES "i.86") 79 if(CPU MATCHES "x86_64" OR CPU MATCHES "i.86")
45 set(_SSE_TRUE TRUE) 80 set(_SSE_TRUE TRUE)
@@ -94,10 +129,12 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
94 endif() 129 endif()
95elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") 130elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
96 # TODO 131 # TODO
97 set(_SSE_TRUE true) 132 if(ARCH STREQUAL win32 OR ARCH STREQUAL x64)
98 set(_SSE_OK true) 133 set(_SSE_TRUE true)
99 set(_SSE2_TRUE true) 134 set(_SSE_OK true)
100 set(_SSE2_OK true) 135 set(_SSE2_TRUE true)
136 set(_SSE2_OK true)
137 endif()
101endif() 138endif()
102 139
103include(FindPackageHandleStandardArgs) 140include(FindPackageHandleStandardArgs)
diff --git a/cmake/modules/FindSSH.cmake b/cmake/modules/FindSSH.cmake
index 538c699..ee65210 100644
--- a/cmake/modules/FindSSH.cmake
+++ b/cmake/modules/FindSSH.cmake
@@ -33,14 +33,14 @@ find_package_handle_standard_args(SSH
33if(SSH_FOUND) 33if(SSH_FOUND)
34 set(SSH_LIBRARIES ${SSH_LIBRARY}) 34 set(SSH_LIBRARIES ${SSH_LIBRARY})
35 set(SSH_INCLUDE_DIRS ${SSH_INCLUDE_DIR}) 35 set(SSH_INCLUDE_DIRS ${SSH_INCLUDE_DIR})
36 set(SSH_DEFINITIONS -DHAVE_LIBSSH=1) 36 set(SSH_DEFINITIONS -DHAS_FILESYSTEM_SFTP=1)
37 37
38 if(NOT TARGET SSH::SSH) 38 if(NOT TARGET SSH::SSH)
39 add_library(SSH::SSH UNKNOWN IMPORTED) 39 add_library(SSH::SSH UNKNOWN IMPORTED)
40 set_target_properties(SSH::SSH PROPERTIES 40 set_target_properties(SSH::SSH PROPERTIES
41 IMPORTED_LOCATION "${SSH_LIBRARY}" 41 IMPORTED_LOCATION "${SSH_LIBRARY}"
42 INTERFACE_INCLUDE_DIRECTORIES "${SSH_INCLUDE_DIR}" 42 INTERFACE_INCLUDE_DIRECTORIES "${SSH_INCLUDE_DIR}"
43 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBSSH=1) 43 INTERFACE_COMPILE_DEFINITIONS HAS_FILESYSTEM_SFTP=1)
44 endif() 44 endif()
45endif() 45endif()
46 46
diff --git a/cmake/modules/FindShairplay.cmake b/cmake/modules/FindShairplay.cmake
index 87d3107..699fb7a 100644
--- a/cmake/modules/FindShairplay.cmake
+++ b/cmake/modules/FindShairplay.cmake
@@ -46,7 +46,7 @@ endif()
46if(SHAIRPLAY_FOUND) 46if(SHAIRPLAY_FOUND)
47 set(SHAIRPLAY_LIBRARIES ${SHAIRPLAY_LIBRARY}) 47 set(SHAIRPLAY_LIBRARIES ${SHAIRPLAY_LIBRARY})
48 set(SHAIRPLAY_INCLUDE_DIRS ${SHAIRPLAY_INCLUDE_DIR}) 48 set(SHAIRPLAY_INCLUDE_DIRS ${SHAIRPLAY_INCLUDE_DIR})
49 set(SHAIRPLAY_DEFINITIONS -DHAVE_LIBSHAIRPLAY=1) 49 set(SHAIRPLAY_DEFINITIONS -DHAS_AIRTUNES=1)
50 50
51 if(NOT TARGET Shairplay::Shairplay) 51 if(NOT TARGET Shairplay::Shairplay)
52 add_library(Shairplay::Shairplay UNKNOWN IMPORTED) 52 add_library(Shairplay::Shairplay UNKNOWN IMPORTED)
@@ -56,7 +56,7 @@ if(SHAIRPLAY_FOUND)
56 endif() 56 endif()
57 set_target_properties(Shairplay::Shairplay PROPERTIES 57 set_target_properties(Shairplay::Shairplay PROPERTIES
58 INTERFACE_INCLUDE_DIRECTORIES "${SHAIRPLAY_INCLUDE_DIR}" 58 INTERFACE_INCLUDE_DIRECTORIES "${SHAIRPLAY_INCLUDE_DIR}"
59 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBSHAIRPLAY=1) 59 INTERFACE_COMPILE_DEFINITIONS HAS_AIRTUNES=1)
60 endif() 60 endif()
61endif() 61endif()
62 62
diff --git a/cmake/modules/FindSmbClient.cmake b/cmake/modules/FindSmbClient.cmake
index 6455cce..9a8b197 100644
--- a/cmake/modules/FindSmbClient.cmake
+++ b/cmake/modules/FindSmbClient.cmake
@@ -33,14 +33,14 @@ find_package_handle_standard_args(SmbClient
33if(SMBCLIENT_FOUND) 33if(SMBCLIENT_FOUND)
34 set(SMBCLIENT_LIBRARIES ${SMBCLIENT_LIBRARY}) 34 set(SMBCLIENT_LIBRARIES ${SMBCLIENT_LIBRARY})
35 set(SMBCLIENT_INCLUDE_DIRS ${SMBCLIENT_INCLUDE_DIR}) 35 set(SMBCLIENT_INCLUDE_DIRS ${SMBCLIENT_INCLUDE_DIR})
36 set(SMBCLIENT_DEFINITIONS -DHAVE_LIBSMBCLIENT=1) 36 set(SMBCLIENT_DEFINITIONS -DHAS_FILESYSTEM_SMB=1)
37 37
38 if(NOT TARGET SmbClient::SmbClient) 38 if(NOT TARGET SmbClient::SmbClient)
39 add_library(SmbClient::SmbClient UNKNOWN IMPORTED) 39 add_library(SmbClient::SmbClient UNKNOWN IMPORTED)
40 set_target_properties(SmbClient::SmbClient PROPERTIES 40 set_target_properties(SmbClient::SmbClient PROPERTIES
41 IMPORTED_LOCATION "${SMBCLIENT_LIBRARY}" 41 IMPORTED_LOCATION "${SMBCLIENT_LIBRARY}"
42 INTERFACE_INCLUDE_DIRECTORIES "${SMBCLIENT_INCLUDE_DIR}" 42 INTERFACE_INCLUDE_DIRECTORIES "${SMBCLIENT_INCLUDE_DIR}"
43 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBSMBCLIENT=1) 43 INTERFACE_COMPILE_DEFINITIONS HAS_FILESYSTEM_SMB=1)
44 endif() 44 endif()
45endif() 45endif()
46 46
diff --git a/cmake/modules/FindSndio.cmake b/cmake/modules/FindSndio.cmake
index 3dd53d9..5f08acd 100644
--- a/cmake/modules/FindSndio.cmake
+++ b/cmake/modules/FindSndio.cmake
@@ -25,7 +25,7 @@ find_package_handle_standard_args(Sndio
25if(SNDIO_FOUND) 25if(SNDIO_FOUND)
26 set(SNDIO_INCLUDE_DIRS ${SNDIO_INCLUDE_DIR}) 26 set(SNDIO_INCLUDE_DIRS ${SNDIO_INCLUDE_DIR})
27 set(SNDIO_LIBRARIES ${SNDIO_LIBRARY}) 27 set(SNDIO_LIBRARIES ${SNDIO_LIBRARY})
28 set(SNDIO_DEFINITIONS -DHAVE_SNDIO=1) 28 set(SNDIO_DEFINITIONS -DHAS_SNDIO=1)
29 29
30 if(NOT TARGET Sndio::Sndio) 30 if(NOT TARGET Sndio::Sndio)
31 add_library(Sndio::Sndio UNKNOWN IMPORTED) 31 add_library(Sndio::Sndio UNKNOWN IMPORTED)
@@ -33,7 +33,7 @@ if(SNDIO_FOUND)
33 IMPORTED_LOCATION "${SNDIO_LIBRARY}" 33 IMPORTED_LOCATION "${SNDIO_LIBRARY}"
34 INTERFACE_INCLUDE_DIRECTORIES "${SNDIO_INCLUDE_DIR}") 34 INTERFACE_INCLUDE_DIRECTORIES "${SNDIO_INCLUDE_DIR}")
35 set_target_properties(Sndio::Sndio PROPERTIES 35 set_target_properties(Sndio::Sndio PROPERTIES
36 INTERFACE_COMPILE_DEFINITIONS -DHAVE_SNDIO=1) 36 INTERFACE_COMPILE_DEFINITIONS -DHAS_SNDIO=1)
37 endif() 37 endif()
38endif() 38endif()
39 39
diff --git a/cmake/modules/FindTexturePacker.cmake b/cmake/modules/FindTexturePacker.cmake
index aa6fd3a..874a8f6 100644
--- a/cmake/modules/FindTexturePacker.cmake
+++ b/cmake/modules/FindTexturePacker.cmake
@@ -19,7 +19,7 @@ if(NOT TARGET TexturePacker::TexturePacker)
19 elseif(WIN32) 19 elseif(WIN32)
20 add_executable(TexturePacker::TexturePacker IMPORTED GLOBAL) 20 add_executable(TexturePacker::TexturePacker IMPORTED GLOBAL)
21 set_target_properties(TexturePacker::TexturePacker PROPERTIES 21 set_target_properties(TexturePacker::TexturePacker PROPERTIES
22 IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/tools/TexturePacker/TexturePacker.exe") 22 IMPORTED_LOCATION "${DEPENDENCIES_DIR}/tools/TexturePacker/TexturePacker.exe")
23 else() 23 else()
24 if(WITH_TEXTUREPACKER) 24 if(WITH_TEXTUREPACKER)
25 get_filename_component(_tppath ${WITH_TEXTUREPACKER} ABSOLUTE) 25 get_filename_component(_tppath ${WITH_TEXTUREPACKER} ABSOLUTE)
diff --git a/cmake/platform/android/android.cmake b/cmake/platform/android/android.cmake
index bfa003b..c857cba 100644
--- a/cmake/platform/android/android.cmake
+++ b/cmake/platform/android/android.cmake
@@ -1 +1 @@
set(PLATFORM_REQUIRED_DEPS OpenGLES EGL) set(PLATFORM_REQUIRED_DEPS OpenGLES EGL Zip)
diff --git a/cmake/platform/freebsd/wayland.cmake b/cmake/platform/freebsd/wayland.cmake
new file mode 100644
index 0000000..55fbd8a
--- /dev/null
+++ b/cmake/platform/freebsd/wayland.cmake
@@ -0,0 +1,17 @@
1set(PLATFORM_REQUIRED_DEPS EGL Waylandpp LibDRM Xkbcommon)
2set(PLATFORM_OPTIONAL_DEPS VAAPI)
3
4set(WAYLAND_RENDER_SYSTEM "" CACHE STRING "Render system to use with Wayland: \"gl\" or \"gles\"")
5
6if(WAYLAND_RENDER_SYSTEM STREQUAL "gl")
7 list(APPEND PLATFORM_REQUIRED_DEPS OpenGl)
8elseif(WAYLAND_RENDER_SYSTEM STREQUAL "gles")
9 list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES)
10else()
11 message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the Wayland windowing system. Please set WAYLAND_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".")
12endif()
13
14set(PLATFORM_GLOBAL_TARGET_DEPS generate-wayland-extra-protocols)
15set(WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}")
16# for wayland-extra-protocols.hpp
17include_directories("${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}")
diff --git a/cmake/platform/freebsd/x11.cmake b/cmake/platform/freebsd/x11.cmake
new file mode 100644
index 0000000..656fd66
--- /dev/null
+++ b/cmake/platform/freebsd/x11.cmake
@@ -0,0 +1,2 @@
1set(PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM)
2set(PLATFORM_OPTIONAL_DEPS VAAPI VDPAU GLX)
diff --git a/cmake/platform/linux/gbm.cmake b/cmake/platform/linux/gbm.cmake
index 616cefb..6a9165a 100644
--- a/cmake/platform/linux/gbm.cmake
+++ b/cmake/platform/linux/gbm.cmake
@@ -1,2 +1,2 @@
1set(PLATFORM_REQUIRED_DEPS OpenGLES EGL GBM LibDRM) 1set(PLATFORM_REQUIRED_DEPS OpenGLES EGL GBM LibDRM)
2set(PLATFORM_OPTIONAL_DEPS VAAPI OpenGLES3) 2set(PLATFORM_OPTIONAL_DEPS VAAPI)
diff --git a/cmake/platform/linux/imx.cmake b/cmake/platform/linux/imx.cmake
deleted file mode 100644
index c0c7196..0000000
--- a/cmake/platform/linux/imx.cmake
+++ /dev/null
@@ -1 +0,0 @@
1set(PLATFORM_REQUIRED_DEPS OpenGLES EGL IMX)
diff --git a/cmake/platform/linux/x11.cmake b/cmake/platform/linux/x11.cmake
index edea24d..656fd66 100644
--- a/cmake/platform/linux/x11.cmake
+++ b/cmake/platform/linux/x11.cmake
@@ -1,2 +1,2 @@
1set(PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM GLX) 1set(PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM)
2set(PLATFORM_OPTIONAL_DEPS VAAPI VDPAU) 2set(PLATFORM_OPTIONAL_DEPS VAAPI VDPAU GLX)
diff --git a/cmake/platform/windowsstore/defines.txt b/cmake/platform/windowsstore/defines.txt
new file mode 100644
index 0000000..e962feb
--- /dev/null
+++ b/cmake/platform/windowsstore/defines.txt
@@ -0,0 +1 @@
-DTARGET_WINDOWS -DTARGET_WINDOWS_STORE -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_WINSOCKAPI_ \ No newline at end of file
diff --git a/cmake/platform/windowsstore/windowsstore.cmake b/cmake/platform/windowsstore/windowsstore.cmake
new file mode 100644
index 0000000..266fb3e
--- /dev/null
+++ b/cmake/platform/windowsstore/windowsstore.cmake
@@ -0,0 +1 @@
set(PLATFORM_REQUIRED_DEPS zlib)
diff --git a/cmake/scripts/android/ArchSetup.cmake b/cmake/scripts/android/ArchSetup.cmake
index 7b8b466..03056fa 100644
--- a/cmake/scripts/android/ArchSetup.cmake
+++ b/cmake/scripts/android/ArchSetup.cmake
@@ -6,15 +6,22 @@ endif()
6 6
7set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID) 7set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID)
8set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_LARGEFILE64_SOURCE 8set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_LARGEFILE64_SOURCE
9 -D_FILE_OFFSET_BITS=64) 9 -D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64=1)
10set(PLATFORM_DIR linux) 10
11# Main cpp
12set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/android/activity/XBMCApp.cpp)
13
14set(PLATFORM_DIR platform/linux)
11if(WITH_ARCH) 15if(WITH_ARCH)
12 set(ARCH ${WITH_ARCH}) 16 set(ARCH ${WITH_ARCH})
13else() 17else()
14 if(CPU STREQUAL armeabi-v7a) 18 if(CPU STREQUAL armeabi-v7a)
15 set(ARCH arm) 19 set(ARCH arm)
16 set(NEON True) 20 set(NEON True)
17 set(NEON_FLAGS "-mfpu=neon -mvectorize-with-neon-quad") 21 set(NEON_FLAGS "-mfpu=neon")
22 if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX)
23 set(NEON_FLAGS "${NEON_FLAGS} -mvectorize-with-neon-quad")
24 endif()
18 elseif(CPU STREQUAL arm64-v8a) 25 elseif(CPU STREQUAL arm64-v8a)
19 set(ARCH aarch64) 26 set(ARCH aarch64)
20 set(NEON True) 27 set(NEON True)
@@ -26,6 +33,9 @@ else()
26 endif() 33 endif()
27endif() 34endif()
28 35
36# Additional SYSTEM_DEFINES
37list(APPEND SYSTEM_DEFINES -DHAS_ZEROCONF)
38
29set(ENABLE_X11 OFF CACHE BOOL "" FORCE) 39set(ENABLE_X11 OFF CACHE BOOL "" FORCE)
30set(ENABLE_AML OFF CACHE BOOL "" FORCE) 40set(ENABLE_AML OFF CACHE BOOL "" FORCE)
31set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) 41set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE)
diff --git a/cmake/scripts/android/Install.cmake b/cmake/scripts/android/Install.cmake
index 46181f7..cc52d51 100644
--- a/cmake/scripts/android/Install.cmake
+++ b/cmake/scripts/android/Install.cmake
@@ -26,14 +26,38 @@ configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/apksign
26 ${CMAKE_BINARY_DIR}/tools/android/packaging/apksign COPYONLY) 26 ${CMAKE_BINARY_DIR}/tools/android/packaging/apksign COPYONLY)
27configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/make_symbols.sh 27configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/make_symbols.sh
28 ${CMAKE_BINARY_DIR}/tools/android/packaging/make_symbols.sh COPYONLY) 28 ${CMAKE_BINARY_DIR}/tools/android/packaging/make_symbols.sh COPYONLY)
29configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/build.gradle
30 ${CMAKE_BINARY_DIR}/tools/android/packaging/build.gradle COPYONLY)
31configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/gradlew
32 ${CMAKE_BINARY_DIR}/tools/android/packaging/gradlew COPYONLY)
33configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/settings.gradle
34 ${CMAKE_BINARY_DIR}/tools/android/packaging/settings.gradle COPYONLY)
35configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/gradle/wrapper/gradle-wrapper.jar
36 ${CMAKE_BINARY_DIR}/tools/android/packaging/gradle/wrapper/gradle-wrapper.jar COPYONLY)
37configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/gradle/wrapper/gradle-wrapper.properties
38 ${CMAKE_BINARY_DIR}/tools/android/packaging/gradle/wrapper/gradle-wrapper.properties COPYONLY)
29file(WRITE ${CMAKE_BINARY_DIR}/tools/depends/Makefile.include 39file(WRITE ${CMAKE_BINARY_DIR}/tools/depends/Makefile.include
30 "$(PREFIX)/lib/${APP_NAME_LC}/lib${APP_NAME_LC}.so: ;\n") 40 "$(PREFIX)/lib/${APP_NAME_LC}/lib${APP_NAME_LC}.so: ;\n")
31 41
42string(REPLACE "." ";" APP_VERSION_CODE_LIST ${APP_VERSION_CODE})
43list(GET APP_VERSION_CODE_LIST 0 major)
44list(GET APP_VERSION_CODE_LIST 1 minor)
45list(GET APP_VERSION_CODE_LIST 2 patch)
46unset(APP_VERSION_CODE_LIST)
47math(EXPR APP_VERSION_CODE_ANDROID "(${major} * 100 + ${minor}) * 1000 + ${patch}")
48unset(major)
49unset(minor)
50if(ARCH STREQUAL aarch64 AND patch LESS 999)
51 math(EXPR APP_VERSION_CODE_ANDROID "${APP_VERSION_CODE_ANDROID} + 1")
52endif()
53unset(patch)
54
32set(package_files strings.xml 55set(package_files strings.xml
33 activity_main.xml 56 activity_main.xml
34 colors.xml 57 colors.xml
35 searchable.xml 58 searchable.xml
36 AndroidManifest.xml 59 AndroidManifest.xml
60 build.gradle
37 src/Main.java 61 src/Main.java
38 src/Splash.java 62 src/Splash.java
39 src/XBMCBroadcastReceiver.java 63 src/XBMCBroadcastReceiver.java
@@ -124,6 +148,8 @@ foreach(target apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb apk-clean
124 CC=${CMAKE_C_COMPILER} 148 CC=${CMAKE_C_COMPILER}
125 CPU=${CPU} 149 CPU=${CPU}
126 ARCH=${ARCH} 150 ARCH=${ARCH}
151 HOST=${HOST}
152 TOOLCHAIN=${TOOLCHAIN}
127 PREFIX=${prefix} 153 PREFIX=${prefix}
128 DEPENDS_PATH=${DEPENDS_PATH} 154 DEPENDS_PATH=${DEPENDS_PATH}
129 NDKROOT=${NDKROOT} 155 NDKROOT=${NDKROOT}
diff --git a/cmake/scripts/common/AddonHelpers.cmake b/cmake/scripts/common/AddonHelpers.cmake
index 2fafe79..c11923e 100644
--- a/cmake/scripts/common/AddonHelpers.cmake
+++ b/cmake/scripts/common/AddonHelpers.cmake
@@ -52,7 +52,8 @@ macro (build_addon target prefix libs)
52 # Read used headers from addon, needed to identitfy used kodi addon interface headers 52 # Read used headers from addon, needed to identitfy used kodi addon interface headers
53 if(${prefix}_HEADERS) 53 if(${prefix}_HEADERS)
54 # Add the used header files defined with CMakeLists.txt from addon itself 54 # Add the used header files defined with CMakeLists.txt from addon itself
55 if(${prefix}_HEADERS MATCHES ${PROJECT_SOURCE_DIR}) 55 string(FIND "${${prefix}_HEADERS}" "${PROJECT_SOURCE_DIR}" position)
56 if(position GREATER -1)
56 # include path name already complete 57 # include path name already complete
57 list(APPEND USED_SOURCES ${${prefix}_HEADERS}) 58 list(APPEND USED_SOURCES ${${prefix}_HEADERS})
58 else() 59 else()
@@ -75,7 +76,8 @@ macro (build_addon target prefix libs)
75 endif() 76 endif()
76 77
77 # Add the used source files defined with CMakeLists.txt from addon itself 78 # Add the used source files defined with CMakeLists.txt from addon itself
78 if(${prefix}_SOURCES MATCHES ${PROJECT_SOURCE_DIR}) 79 string(FIND "${${prefix}_SOURCES}" "${PROJECT_SOURCE_DIR}" position)
80 if(position GREATER -1)
79 # include path name already complete 81 # include path name already complete
80 list(APPEND USED_SOURCES ${${prefix}_SOURCES}) 82 list(APPEND USED_SOURCES ${${prefix}_SOURCES})
81 else() 83 else()
@@ -228,7 +230,9 @@ macro (build_addon target prefix libs)
228 set(CPACK_COMPONENTS_IGNORE_GROUPS 1) 230 set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
229 list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION}) 231 list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION})
230 # Pack files together to create an archive 232 # Pack files together to create an archive
231 install(DIRECTORY ${target} DESTINATION ./ COMPONENT ${target}-${${prefix}_VERSION} PATTERN "*.xml.in" EXCLUDE) 233 install(DIRECTORY ${target} DESTINATION ./
234 COMPONENT ${target}-${${prefix}_VERSION}
235 REGEX ".+\\.xml\\.in(clude)?$" EXCLUDE)
232 if(WIN32) 236 if(WIN32)
233 if(NOT CPACK_PACKAGE_DIRECTORY) 237 if(NOT CPACK_PACKAGE_DIRECTORY)
234 # determine the temporary path 238 # determine the temporary path
@@ -321,7 +325,8 @@ macro (build_addon target prefix libs)
321 if (${prefix}_CUSTOM_BINARY) 325 if (${prefix}_CUSTOM_BINARY)
322 install(FILES ${LIBRARY_LOCATION} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target} RENAME ${LIBRARY_FILENAME}) 326 install(FILES ${LIBRARY_LOCATION} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target} RENAME ${LIBRARY_FILENAME})
323 endif() 327 endif()
324 install(DIRECTORY ${target} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons PATTERN "*.xml.in" EXCLUDE) 328 install(DIRECTORY ${target} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons
329 REGEX ".+\\.xml\\.in(clude)?$" EXCLUDE)
325 if(${prefix}_CUSTOM_DATA) 330 if(${prefix}_CUSTOM_DATA)
326 install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons/${target}/resources) 331 install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons/${target}/resources)
327 endif() 332 endif()
@@ -348,6 +353,12 @@ macro (build_addon target prefix libs)
348 COMMAND ${CMAKE_COMMAND} -E copy 353 COMMAND ${CMAKE_COMMAND} -E copy
349 ${LIBRARY_LOCATION} 354 ${LIBRARY_LOCATION}
350 ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/${LIBRARY_FILENAME}) 355 ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/${LIBRARY_FILENAME})
356 if(${prefix}_ADDITIONAL_BINARY)
357 add_custom_command(TARGET ${target} POST_BUILD
358 COMMAND ${CMAKE_COMMAND} -E copy
359 ${${prefix}_ADDITIONAL_BINARY}
360 ${${APP_NAME_UC}_BUILD_DIR}/addons/${target})
361 endif()
351 endif() 362 endif()
352endmacro() 363endmacro()
353 364
diff --git a/cmake/scripts/common/ArchSetup.cmake b/cmake/scripts/common/ArchSetup.cmake
index 357c14c..3b81533 100644
--- a/cmake/scripts/common/ArchSetup.cmake
+++ b/cmake/scripts/common/ArchSetup.cmake
@@ -11,6 +11,9 @@
11# DEP_DEFINES - compiler definitions for system dependencies (e.g. LIRC) 11# DEP_DEFINES - compiler definitions for system dependencies (e.g. LIRC)
12# + the results of compiler tests etc. 12# + the results of compiler tests etc.
13 13
14# workaround a bug in older cmake, where binutils wouldn't be set after deleting CMakeCache.txt
15include(CMakeFindBinUtils)
16
14include(CheckCXXSourceCompiles) 17include(CheckCXXSourceCompiles)
15include(CheckSymbolExists) 18include(CheckSymbolExists)
16include(CheckFunctionExists) 19include(CheckFunctionExists)
diff --git a/cmake/scripts/common/GenerateVersionedFiles.cmake b/cmake/scripts/common/GenerateVersionedFiles.cmake
index 90b2173..011f495 100644
--- a/cmake/scripts/common/GenerateVersionedFiles.cmake
+++ b/cmake/scripts/common/GenerateVersionedFiles.cmake
@@ -13,12 +13,11 @@ endfunction()
13 13
14# add-on xml's 14# add-on xml's
15file(GLOB ADDON_XML_IN_FILE ${CORE_SOURCE_DIR}/addons/*/addon.xml.in) 15file(GLOB ADDON_XML_IN_FILE ${CORE_SOURCE_DIR}/addons/*/addon.xml.in)
16foreach(loop_var ${ADDON_XML_IN_FILE})
17 # prevent 'xbmc.json'; will be obtained from 'xbmc/interfaces/json-rpc/schema/CMakeLists.txt'.
18 if(loop_var MATCHES "xbmc.json")
19 continue()
20 endif()
21 16
17# remove 'xbmc.json', will be created from 'xbmc/interfaces/json-rpc/schema/CMakeLists.txt'
18list(REMOVE_ITEM ADDON_XML_IN_FILE xbmc.json)
19
20foreach(loop_var ${ADDON_XML_IN_FILE})
22 list(GET loop_var 0 xml_name) 21 list(GET loop_var 0 xml_name)
23 22
24 string(REPLACE "/addon.xml.in" "" source_dir ${xml_name}) 23 string(REPLACE "/addon.xml.in" "" source_dir ${xml_name})
@@ -35,4 +34,5 @@ foreach(loop_var ${ADDON_XML_IN_FILE})
35 unset(xml_name) 34 unset(xml_name)
36endforeach() 35endforeach()
37 36
37
38generate_versioned_file(xbmc/CompileInfo.cpp.in ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp) 38generate_versioned_file(xbmc/CompileInfo.cpp.in ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp)
diff --git a/cmake/scripts/common/HandleDepends.cmake b/cmake/scripts/common/HandleDepends.cmake
index 85d2cf4..49e5ac8 100644
--- a/cmake/scripts/common/HandleDepends.cmake
+++ b/cmake/scripts/common/HandleDepends.cmake
@@ -7,6 +7,10 @@ function(add_addon_depends addon searchpath)
7 set(OUTPUT_DIR ${ADDON_DEPENDS_PATH}) 7 set(OUTPUT_DIR ${ADDON_DEPENDS_PATH})
8 # look for platform-specific dependencies 8 # look for platform-specific dependencies
9 file(GLOB_RECURSE cmake_input_files ${searchpath}/${CORE_SYSTEM_NAME}/*.txt) 9 file(GLOB_RECURSE cmake_input_files ${searchpath}/${CORE_SYSTEM_NAME}/*.txt)
10 # backward compatibility
11 if(NOT cmake_input_files AND CORE_SYSTEM_NAME STREQUAL windowsstore)
12 file(GLOB_RECURSE cmake_input_files ${searchpath}/windows/*.txt)
13 endif()
10 file(GLOB_RECURSE cmake_input_files2 ${searchpath}/common/*.txt) 14 file(GLOB_RECURSE cmake_input_files2 ${searchpath}/common/*.txt)
11 list(APPEND cmake_input_files ${cmake_input_files2}) 15 list(APPEND cmake_input_files ${cmake_input_files2})
12 16
@@ -67,6 +71,11 @@ function(add_addon_depends addon searchpath)
67 -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} 71 -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME}
68 -DENABLE_STATIC=1 72 -DENABLE_STATIC=1
69 -DBUILD_SHARED_LIBS=0) 73 -DBUILD_SHARED_LIBS=0)
74 # windows store args
75 if (CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
76 list(APPEND BUILD_ARGS -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
77 -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION})
78 endif()
70 # if there are no make rules override files available take care of manually passing on ARCH_DEFINES 79 # if there are no make rules override files available take care of manually passing on ARCH_DEFINES
71 if(NOT CMAKE_USER_MAKE_RULES_OVERRIDE AND NOT CMAKE_USER_MAKE_RULES_OVERRIDE_CXX) 80 if(NOT CMAKE_USER_MAKE_RULES_OVERRIDE AND NOT CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
72 # make sure we create strings, not lists 81 # make sure we create strings, not lists
@@ -147,6 +156,10 @@ function(add_addon_depends addon searchpath)
147 if(EXISTS ${dir}/${CORE_SYSTEM_NAME}-deps.txt) 156 if(EXISTS ${dir}/${CORE_SYSTEM_NAME}-deps.txt)
148 file(STRINGS ${dir}/${CORE_SYSTEM_NAME}-deps.txt deps) 157 file(STRINGS ${dir}/${CORE_SYSTEM_NAME}-deps.txt deps)
149 message(STATUS "${id} depends: ${deps}") 158 message(STATUS "${id} depends: ${deps}")
159 # backward compatibility
160 elseif(CORE_SYSTEM_NAME STREQUAL windowsstore AND EXISTS ${dir}/windows-deps.txt)
161 file(STRINGS ${dir}/windows-deps.txt deps)
162 message(STATUS "${id} depends: ${deps}")
150 elseif(EXISTS ${dir}/deps.txt) 163 elseif(EXISTS ${dir}/deps.txt)
151 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt) 164 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt)
152 file(STRINGS ${dir}/deps.txt deps) 165 file(STRINGS ${dir}/deps.txt deps)
diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake
index 9f00bb7..d508f87 100644
--- a/cmake/scripts/common/Macros.cmake
+++ b/cmake/scripts/common/Macros.cmake
@@ -72,11 +72,15 @@ function(core_add_library name)
72 add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS}) 72 add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS})
73 set_target_properties(${name} PROPERTIES PREFIX "") 73 set_target_properties(${name} PROPERTIES PREFIX "")
74 set(core_DEPENDS ${name} ${core_DEPENDS} CACHE STRING "" FORCE) 74 set(core_DEPENDS ${name} ${core_DEPENDS} CACHE STRING "" FORCE)
75 add_dependencies(${name} libcpluff ffmpeg dvdnav crossguid ${PLATFORM_GLOBAL_TARGET_DEPS}) 75 set(lib_DEPS libcpluff ffmpeg crossguid ${PLATFORM_GLOBAL_TARGET_DEPS})
76 if(NOT CORE_SYSTEM_NAME STREQUAL windowsstore)
77 list(APPEND lib_DEPS dvdnav)
78 endif()
79 add_dependencies(${name} ${lib_DEPS})
76 set(CORE_LIBRARY ${name} PARENT_SCOPE) 80 set(CORE_LIBRARY ${name} PARENT_SCOPE)
77 81
78 # Add precompiled headers to Kodi main libraries 82 # Add precompiled headers to Kodi main libraries
79 if(CORE_SYSTEM_NAME STREQUAL windows) 83 if(CORE_SYSTEM_NAME MATCHES windows)
80 add_precompiled_header(${name} pch.h ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) 84 add_precompiled_header(${name} pch.h ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi)
81 set_language_cxx(${name}) 85 set_language_cxx(${name})
82 target_link_libraries(${name} PUBLIC effects11) 86 target_link_libraries(${name} PUBLIC effects11)
@@ -102,7 +106,11 @@ function(core_add_test_library name)
102 set_target_properties(${name} PROPERTIES PREFIX "" 106 set_target_properties(${name} PROPERTIES PREFIX ""
103 EXCLUDE_FROM_ALL 1 107 EXCLUDE_FROM_ALL 1
104 FOLDER "Build Utilities/tests") 108 FOLDER "Build Utilities/tests")
105 add_dependencies(${name} libcpluff ffmpeg dvdnav crossguid) 109 set(lib_DEPS libcpluff ffmpeg crossguid ${PLATFORM_GLOBAL_TARGET_DEPS})
110 if(NOT CORE_SYSTEM_NAME STREQUAL windowsstore)
111 list(APPEND lib_DEPS dvdnav)
112 endif()
113 add_dependencies(${name} ${lib_DEPS})
106 set(test_archives ${test_archives} ${name} CACHE STRING "" FORCE) 114 set(test_archives ${test_archives} ${name} CACHE STRING "" FORCE)
107 endif() 115 endif()
108 foreach(src IN LISTS SOURCES SUPPORTED_SOURCES HEADERS OTHERS) 116 foreach(src IN LISTS SOURCES SUPPORTED_SOURCES HEADERS OTHERS)
@@ -314,6 +322,7 @@ function(copy_files_from_filelist_to_buildtree pattern)
314 copy_file_to_buildtree(${CMAKE_SOURCE_DIR}/${file} DIRECTORY ${dest} ${DIR_OPTION}) 322 copy_file_to_buildtree(${CMAKE_SOURCE_DIR}/${file} DIRECTORY ${dest} ${DIR_OPTION})
315 endif() 323 endif()
316 endforeach() 324 endforeach()
325 set(DIR_OPTION)
317 endforeach() 326 endforeach()
318 endforeach() 327 endforeach()
319 endforeach() 328 endforeach()
@@ -583,7 +592,8 @@ function(core_find_git_rev stamp)
583 else() 592 else()
584 find_package(Git) 593 find_package(Git)
585 if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) 594 if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
586 execute_process(COMMAND ${GIT_EXECUTABLE} update-index --ignore-submodules --refresh -q) 595 execute_process(COMMAND ${GIT_EXECUTABLE} update-index --ignore-submodules -q --refresh
596 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
587 execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- 597 execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet --
588 RESULT_VARIABLE status_code 598 RESULT_VARIABLE status_code
589 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) 599 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
@@ -610,7 +620,11 @@ function(core_find_git_rev stamp)
610 string(REPLACE "-" "" DATE ${DATE}) 620 string(REPLACE "-" "" DATE ${DATE})
611 else() 621 else()
612 string(TIMESTAMP DATE "%Y%m%d" UTC) 622 string(TIMESTAMP DATE "%Y%m%d" UTC)
613 set(HASH "nogitfound") 623 if(EXISTS ${CMAKE_SOURCE_DIR}/VERSION)
624 file(STRINGS ${CMAKE_SOURCE_DIR}/VERSION HASH LIMIT_INPUT 16)
625 else()
626 set(HASH "nogitfound")
627 endif()
614 endif() 628 endif()
615 cmake_parse_arguments(arg "FULL" "" "" ${ARGN}) 629 cmake_parse_arguments(arg "FULL" "" "" ${ARGN})
616 if(arg_FULL) 630 if(arg_FULL)
@@ -637,6 +651,7 @@ endfunction()
637# APP_VERSION - the app version (${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}-${APP_VERSION_TAG}) 651# APP_VERSION - the app version (${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}-${APP_VERSION_TAG})
638# APP_ADDON_API - the addon API version in the form of 16.9.702 652# APP_ADDON_API - the addon API version in the form of 16.9.702
639# FILE_VERSION - file version in the form of 16,9,702,0 - Windows only 653# FILE_VERSION - file version in the form of 16,9,702,0 - Windows only
654# JSONRPC_VERSION - the json api version in the form of 8.3.0
640# 655#
641# Set various variables defined in "versions.h" 656# Set various variables defined in "versions.h"
642macro(core_find_versions) 657macro(core_find_versions)
@@ -651,9 +666,28 @@ macro(core_find_versions)
651 666
652 include(CMakeParseArguments) 667 include(CMakeParseArguments)
653 core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt) 668 core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt)
654 string(REPLACE " " ";" version_list "${version_list}") 669 core_file_read_filtered(json_version ${CORE_SOURCE_DIR}/xbmc/interfaces/json-rpc/schema/version.txt)
655 cmake_parse_arguments(APP "" "APP_NAME;COMPANY_NAME;WEBSITE;VERSION_MAJOR;VERSION_MINOR;VERSION_TAG;VERSION_CODE;ADDON_API;APP_PACKAGE" "" ${version_list}) 670 string(REGEX REPLACE "([^ ;]*) ([^;]*)" "\\1;\\2" version_list "${version_list};${json_version}")
656 671 set(version_props
672 ADDON_API
673 APP_NAME
674 APP_PACKAGE
675 COMPANY_NAME
676 JSONRPC_VERSION
677 PACKAGE_DESCRIPTION
678 PACKAGE_IDENTITY
679 PACKAGE_PUBLISHER
680 VERSION_MAJOR
681 VERSION_MINOR
682 VERSION_TAG
683 VERSION_CODE
684 WEBSITE
685 )
686 cmake_parse_arguments(APP "" "${version_props}" "" ${version_list})
687
688 if(NOT ${APP_VERSION_CODE} MATCHES "^[0-9]+\\.[0-9][0-9]?\\.[0-9][0-9]?[0-9]?$")
689 message(FATAL_ERROR "VERSION_CODE was set to ${APP_VERSION_CODE} in version.txt, but it has to match '^\\d+\\.\\d{1,2}\\.\\d{1,3}$'")
690 endif()
657 set(APP_NAME ${APP_APP_NAME}) # inconsistency but APP_APP_NAME looks weird 691 set(APP_NAME ${APP_APP_NAME}) # inconsistency but APP_APP_NAME looks weird
658 string(TOLOWER ${APP_APP_NAME} APP_NAME_LC) 692 string(TOLOWER ${APP_APP_NAME} APP_NAME_LC)
659 string(TOUPPER ${APP_APP_NAME} APP_NAME_UC) 693 string(TOUPPER ${APP_APP_NAME} APP_NAME_UC)
@@ -665,6 +699,7 @@ macro(core_find_versions)
665 string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC) 699 string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC)
666 endif() 700 endif()
667 string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0) 701 string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0)
702 set(JSONRPC_VERSION ${APP_JSONRPC_VERSION})
668 703
669 # Set defines used in addon.xml.in and read from versions.h to set add-on 704 # Set defines used in addon.xml.in and read from versions.h to set add-on
670 # version parts automatically 705 # version parts automatically
@@ -689,6 +724,9 @@ macro(core_find_versions)
689 if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR) 724 if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR)
690 message(FATAL_ERROR "Could not determine app version! Make sure that ${CORE_SOURCE_DIR}/version.txt exists") 725 message(FATAL_ERROR "Could not determine app version! Make sure that ${CORE_SOURCE_DIR}/version.txt exists")
691 endif() 726 endif()
727 if(NOT DEFINED JSONRPC_VERSION)
728 message(FATAL_ERROR "Could not determine json-rpc version! Make sure that ${CORE_SOURCE_DIR}/xbmc/interfaces/json-rpc/schema/version.txt exists")
729 endif()
692endmacro() 730endmacro()
693 731
694# add-on xml's 732# add-on xml's
diff --git a/cmake/scripts/common/Platform.cmake b/cmake/scripts/common/Platform.cmake
index b19b7e5..5ac233a 100644
--- a/cmake/scripts/common/Platform.cmake
+++ b/cmake/scripts/common/Platform.cmake
@@ -2,14 +2,17 @@ if(NOT CORE_SYSTEM_NAME)
2 string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) 2 string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME)
3endif() 3endif()
4 4
5if(CORE_SYSTEM_NAME STREQUAL linux) 5if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd)
6 # Set default CORE_PLATFORM_NAME to X11 6 # Set default CORE_PLATFORM_NAME to X11
7 # This is overridden by user setting -DCORE_PLATFORM_NAME=<platform> 7 # This is overridden by user setting -DCORE_PLATFORM_NAME=<platform>
8 set(_DEFAULT_PLATFORM X11) 8 set(_DEFAULT_PLATFORM X11)
9 option(ENABLE_APP_AUTONAME "Enable renaming the binary according to windowing?" ON)
9else() 10else()
10 string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM) 11 string(TOLOWER ${CORE_SYSTEM_NAME} _DEFAULT_PLATFORM)
11endif() 12endif()
12 13
14set(APP_BINARY_SUFFIX ".bin")
15
13# 16#
14# Note: please do not use CORE_PLATFORM_NAME in any checks, 17# Note: please do not use CORE_PLATFORM_NAME in any checks,
15# use the normalized to lower case CORE_PLATFORM_NAME_LC (see below) instead 18# use the normalized to lower case CORE_PLATFORM_NAME_LC (see below) instead
@@ -23,10 +26,12 @@ string(TOLOWER ${CORE_PLATFORM_NAME} CORE_PLATFORM_NAME_LC)
23list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}") 26list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}")
24if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) 27if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake)
25 include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake) 28 include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake)
29 if(ENABLE_APP_AUTONAME)
30 set(APP_BINARY_SUFFIX "-${CORE_PLATFORM_NAME_LC}")
31 endif()
26else() 32else()
27 file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/ 33 file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/
28 ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake) 34 ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake)
29 string(REPLACE ".cmake" " " _platformnames ${_platformnames}) 35 string(REPLACE ".cmake" " " _platformnames ${_platformnames})
30 message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}") 36 message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}")
31endif() 37endif()
32
diff --git a/cmake/scripts/common/PrepareEnv.cmake b/cmake/scripts/common/PrepareEnv.cmake
index 5a6066b..1426148 100644
--- a/cmake/scripts/common/PrepareEnv.cmake
+++ b/cmake/scripts/common/PrepareEnv.cmake
@@ -40,17 +40,11 @@ file(COPY ${CORE_SOURCE_DIR}/cmake/scripts/common/AddonHelpers.cmake
40 ${CORE_SOURCE_DIR}/cmake/scripts/common/AddOptions.cmake 40 ${CORE_SOURCE_DIR}/cmake/scripts/common/AddOptions.cmake
41 DESTINATION ${APP_LIB_DIR}) 41 DESTINATION ${APP_LIB_DIR})
42 42
43# copy standard add-on include files
44file(COPY ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/
45 DESTINATION ${APP_INCLUDE_DIR} REGEX ".txt" EXCLUDE)
46
47### copy all the addon binding header files to include/kodi 43### copy all the addon binding header files to include/kodi
48# parse addon-bindings.mk to get the list of header files to copy 44include(${CORE_SOURCE_DIR}/xbmc/addons/AddonBindings.cmake)
49core_file_read_filtered(bindings ${CORE_SOURCE_DIR}/xbmc/addons/addon-bindings.mk) 45file(COPY ${CORE_ADDON_BINDINGS_FILES} ${CORE_ADDON_BINDINGS_DIRS}/
50foreach(header ${bindings}) 46 DESTINATION ${APP_INCLUDE_DIR}
51 # copy the header file to include/kodi 47 REGEX ".txt" EXCLUDE)
52 configure_file(${CORE_SOURCE_DIR}/${header} ${APP_INCLUDE_DIR} COPYONLY)
53endforeach()
54 48
55### processing additional tools required by the platform 49### processing additional tools required by the platform
56if(EXISTS ${CORE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/tools/) 50if(EXISTS ${CORE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/tools/)
diff --git a/cmake/scripts/freebsd/ArchSetup.cmake b/cmake/scripts/freebsd/ArchSetup.cmake
index ef693b0..8ee78fc 100644
--- a/cmake/scripts/freebsd/ArchSetup.cmake
+++ b/cmake/scripts/freebsd/ArchSetup.cmake
@@ -1,7 +1,7 @@
1set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_FREEBSD) 1set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_FREEBSD)
2set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_LARGEFILE64_SOURCE 2set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_LARGEFILE64_SOURCE
3 -D_FILE_OFFSET_BITS=64) 3 -D_FILE_OFFSET_BITS=64)
4set(PLATFORM_DIR linux) 4set(PLATFORM_DIR platform/linux)
5set(SYSTEM_LDFLAGS -L/usr/local/lib) 5set(SYSTEM_LDFLAGS -L/usr/local/lib)
6if(WITH_ARCH) 6if(WITH_ARCH)
7 set(ARCH ${WITH_ARCH}) 7 set(ARCH ${WITH_ARCH})
@@ -14,3 +14,6 @@ else()
14 message(WARNING "unknown CPU: ${CPU}") 14 message(WARNING "unknown CPU: ${CPU}")
15 endif() 15 endif()
16endif() 16endif()
17
18# Additional SYSTEM_DEFINES
19list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK)
diff --git a/cmake/scripts/freebsd/ExtraTargets.cmake b/cmake/scripts/freebsd/ExtraTargets.cmake
new file mode 100644
index 0000000..66383ab
--- /dev/null
+++ b/cmake/scripts/freebsd/ExtraTargets.cmake
@@ -0,0 +1,29 @@
1# xrandr
2if(X_FOUND AND XRANDR_FOUND)
3 find_package(X QUIET)
4 find_package(XRandR QUIET)
5 add_executable(${APP_NAME_LC}-xrandr ${CMAKE_SOURCE_DIR}/xbmc-xrandr.c)
6 target_link_libraries(${APP_NAME_LC}-xrandr ${SYSTEM_LDFLAGS} ${X_LIBRARIES} m ${XRANDR_LIBRARIES})
7endif()
8
9# WiiRemote
10if(ENABLE_EVENTCLIENTS AND BLUETOOTH_FOUND)
11 find_package(CWiid QUIET)
12 if(CWIID_FOUND)
13 add_subdirectory(${CMAKE_SOURCE_DIR}/tools/EventClients/Clients/WiiRemote build/WiiRemote)
14 endif()
15endif()
16
17if(CORE_PLATFORM_NAME_LC STREQUAL "wayland")
18 # This cannot go into wayland.cmake since it requires the Wayland dependencies
19 # to already be resolved
20 set(PROTOCOL_XMLS "${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-shell/xdg-shell-unstable-v6.xml"
21 "${WAYLAND_PROTOCOLS_DIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml")
22 add_custom_command(OUTPUT "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp"
23 COMMAND "${WAYLANDPP_SCANNER}" ${PROTOCOL_XMLS} "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp"
24 DEPENDS "${WAYLANDPP_SCANNER}" ${PROTOCOL_XMLS}
25 COMMENT "Generating wayland-protocols C++ wrappers")
26
27 # Dummy target for dependencies
28 add_custom_target(generate-wayland-extra-protocols DEPENDS wayland-extra-protocols.hpp)
29endif()
diff --git a/cmake/scripts/ios/ArchSetup.cmake b/cmake/scripts/ios/ArchSetup.cmake
index be12c49..0808eb2 100644
--- a/cmake/scripts/ios/ArchSetup.cmake
+++ b/cmake/scripts/ios/ArchSetup.cmake
@@ -7,7 +7,7 @@ set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/XBMCApplicatio
7set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS) 7set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS)
8set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE 8set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
9 -D__STDC_CONSTANT_MACROS) 9 -D__STDC_CONSTANT_MACROS)
10set(PLATFORM_DIR linux) 10set(PLATFORM_DIR platform/linux)
11set(CMAKE_SYSTEM_NAME Darwin) 11set(CMAKE_SYSTEM_NAME Darwin)
12if(WITH_ARCH) 12if(WITH_ARCH)
13 set(ARCH ${WITH_ARCH}) 13 set(ARCH ${WITH_ARCH})
@@ -21,6 +21,9 @@ else()
21 endif() 21 endif()
22endif() 22endif()
23 23
24# Additional SYSTEM_DEFINES
25list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK -DHAS_ZEROCONF)
26
24find_package(CXX11 REQUIRED) 27find_package(CXX11 REQUIRED)
25 28
26list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) 29list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX})
diff --git a/cmake/scripts/ios/Install.cmake b/cmake/scripts/ios/Install.cmake
index fee7368..587b24f 100644
--- a/cmake/scripts/ios/Install.cmake
+++ b/cmake/scripts/ios/Install.cmake
@@ -4,6 +4,8 @@ set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-568h@2
4 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-667h@2x.png 4 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-667h@2x.png
5 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-736h@3x.png 5 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-736h@3x.png
6 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png 6 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png
7 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-812h@3x.png
8 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-812h@3x.png
7 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png 9 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png
8 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png 10 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png
9 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png 11 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png
diff --git a/cmake/scripts/linux/ArchSetup.cmake b/cmake/scripts/linux/ArchSetup.cmake
index 74018d0..ee69c09 100644
--- a/cmake/scripts/linux/ArchSetup.cmake
+++ b/cmake/scripts/linux/ArchSetup.cmake
@@ -5,7 +5,7 @@ if(CORE_PLATFORM_NAME_LC STREQUAL rbpi)
5endif() 5endif()
6set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED 6set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED
7 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) 7 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64)
8set(PLATFORM_DIR linux) 8set(PLATFORM_DIR platform/linux)
9set(CMAKE_SYSTEM_NAME Linux) 9set(CMAKE_SYSTEM_NAME Linux)
10if(WITH_ARCH) 10if(WITH_ARCH)
11 set(ARCH ${WITH_ARCH}) 11 set(ARCH ${WITH_ARCH})
@@ -37,9 +37,32 @@ else()
37 endif() 37 endif()
38endif() 38endif()
39 39
40# Make sure we strip binaries in Release build 40if((CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_BUILD_TYPE STREQUAL MinSizeRel)
41if(CMAKE_BUILD_TYPE STREQUAL Release AND CMAKE_COMPILER_IS_GNUCXX) 41 AND CMAKE_COMPILER_IS_GNUCXX)
42 # Make sure we strip binaries in Release build
42 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") 43 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
44
45 # LTO Support, requires cmake >= 3.9
46 if(CMAKE_VERSION VERSION_EQUAL 3.9.0 OR CMAKE_VERSION VERSION_GREATER 3.9.0)
47 option(USE_LTO "Enable link time optimization. Specify an int for number of parallel jobs" OFF)
48 if(USE_LTO)
49 include(CheckIPOSupported)
50 check_ipo_supported(RESULT HAVE_LTO OUTPUT _output)
51 if(HAVE_LTO)
52 set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
53 # override flags to enable parallel processing
54 set(NJOBS 2)
55 if(USE_LTO MATCHES "^[0-9]+$")
56 set(NJOBS ${USE_LTO})
57 endif()
58 set(CMAKE_CXX_COMPILE_OPTIONS_IPO -flto=${NJOBS} -fno-fat-lto-objects)
59 set(CMAKE_C_COMPILE_OPTIONS_IPO -flto=${NJOBS} -fno-fat-lto-objects)
60 else()
61 message(WARNING "LTO optimization not supported: ${_output}")
62 unset(_output)
63 endif()
64 endif()
65 endif()
43endif() 66endif()
44 67
45if(KODI_DEPENDSBUILD) 68if(KODI_DEPENDSBUILD)
@@ -64,6 +87,9 @@ if(HAVE_MKOSTEMP)
64 list(APPEND ARCH_DEFINES "-DHAVE_MKOSTEMP=1" "-D_GNU_SOURCE") 87 list(APPEND ARCH_DEFINES "-DHAVE_MKOSTEMP=1" "-D_GNU_SOURCE")
65endif() 88endif()
66 89
90# Additional SYSTEM_DEFINES
91list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK)
92
67# Code Coverage 93# Code Coverage
68if(CMAKE_BUILD_TYPE STREQUAL Coverage) 94if(CMAKE_BUILD_TYPE STREQUAL Coverage)
69 set(COVERAGE_TEST_BINARY ${APP_NAME_LC}-test) 95 set(COVERAGE_TEST_BINARY ${APP_NAME_LC}-test)
@@ -78,5 +104,8 @@ endif()
78 104
79if(ENABLE_GBM) 105if(ENABLE_GBM)
80 set(ENABLE_VDPAU OFF CACHE BOOL "Disabling VDPAU" FORCE) 106 set(ENABLE_VDPAU OFF CACHE BOOL "Disabling VDPAU" FORCE)
81 set(ENABLE_VAAPI OFF CACHE BOOL "Disabling VAAPI" FORCE) 107endif()
108
109if(ENABLE_VDPAU)
110 set(ENABLE_GLX ON CACHE BOOL "Enabling GLX" FORCE)
82endif() 111endif()
diff --git a/cmake/scripts/linux/Install.cmake b/cmake/scripts/linux/Install.cmake
index 7a2705b..d6767bf 100644
--- a/cmake/scripts/linux/Install.cmake
+++ b/cmake/scripts/linux/Install.cmake
@@ -15,6 +15,7 @@ else()
15endif() 15endif()
16 16
17# CMake config 17# CMake config
18set(APP_BINARY ${APP_NAME_LC}${APP_BINARY_SUFFIX})
18set(APP_PREFIX ${prefix}) 19set(APP_PREFIX ${prefix})
19set(APP_LIB_DIR ${libdir}/${APP_NAME_LC}) 20set(APP_LIB_DIR ${libdir}/${APP_NAME_LC})
20set(APP_DATA_DIR ${datarootdir}/${APP_NAME_LC}) 21set(APP_DATA_DIR ${datarootdir}/${APP_NAME_LC})
@@ -146,17 +147,13 @@ if(NOT WITH_TEXTUREPACKER)
146endif() 147endif()
147 148
148# Install kodi-addon-dev headers 149# Install kodi-addon-dev headers
149install(DIRECTORY ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/ 150include(${CMAKE_SOURCE_DIR}/xbmc/addons/AddonBindings.cmake)
151install(DIRECTORY ${CORE_ADDON_BINDINGS_DIRS}/
150 DESTINATION ${includedir}/${APP_NAME_LC} 152 DESTINATION ${includedir}/${APP_NAME_LC}
151 COMPONENT kodi-addon-dev 153 COMPONENT kodi-addon-dev
152 REGEX ".txt" EXCLUDE) 154 REGEX ".txt" EXCLUDE)
153 155
154install(FILES ${CMAKE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h 156install(FILES ${CORE_ADDON_BINDINGS_FILES}
155 ${CMAKE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DemuxCrypto.h
156 ${CMAKE_SOURCE_DIR}/xbmc/cores/AudioEngine/Utils/AEChannelData.h
157 ${CMAKE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h
158 ${CMAKE_SOURCE_DIR}/xbmc/input/ActionIDs.h
159 ${CMAKE_SOURCE_DIR}/xbmc/input/XBMC_vkeys.h
160 DESTINATION ${includedir}/${APP_NAME_LC} 157 DESTINATION ${includedir}/${APP_NAME_LC}
161 COMPONENT kodi-addon-dev) 158 COMPONENT kodi-addon-dev)
162 159
@@ -178,7 +175,7 @@ install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cm
178 COMPONENT kodi-addon-dev) 175 COMPONENT kodi-addon-dev)
179 176
180if(ENABLE_EVENTCLIENTS) 177if(ENABLE_EVENTCLIENTS)
181 execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(prefix='')" 178 execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(prefix=''))"
182 OUTPUT_VARIABLE PYTHON_LIB_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) 179 OUTPUT_VARIABLE PYTHON_LIB_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
183 # Install kodi-eventclients-common BT python files 180 # Install kodi-eventclients-common BT python files
184 install(PROGRAMS ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/bt/__init__.py 181 install(PROGRAMS ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/bt/__init__.py
diff --git a/cmake/scripts/linux/clang-check-test.sh.in b/cmake/scripts/linux/clang-check-test.sh.in
index 3b30ec1..12e9a0e 100755
--- a/cmake/scripts/linux/clang-check-test.sh.in
+++ b/cmake/scripts/linux/clang-check-test.sh.in
@@ -12,7 +12,7 @@ source_file=$2
12 12
13tmpfil=`mktemp` 13tmpfil=`mktemp`
14$clangcheck_cmd -p @CMAKE_BINARY_DIR@ -analyze $source_file &> $tmpfil 14$clangcheck_cmd -p @CMAKE_BINARY_DIR@ -analyze $source_file &> $tmpfil
15nerr=`cat $tmpfil | grep -v "warning: /usr/bin/c++: 'linker' input unused" | wc -l` 15nerr=`cat $tmpfil | grep -v "warning: .*: 'linker' input unused" | wc -l`
16if test $nerr -gt 0 16if test $nerr -gt 0
17then 17then
18 cat $tmpfil 18 cat $tmpfil
diff --git a/cmake/scripts/osx/ArchSetup.cmake b/cmake/scripts/osx/ArchSetup.cmake
index 5a1b567..d0c5506 100644
--- a/cmake/scripts/osx/ArchSetup.cmake
+++ b/cmake/scripts/osx/ArchSetup.cmake
@@ -9,7 +9,7 @@ set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/posix/main.cpp
9set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX) 9set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX)
10set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE 10set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
11 -D__STDC_CONSTANT_MACROS) 11 -D__STDC_CONSTANT_MACROS)
12set(PLATFORM_DIR linux) 12set(PLATFORM_DIR platform/linux)
13set(CMAKE_SYSTEM_NAME Darwin) 13set(CMAKE_SYSTEM_NAME Darwin)
14if(WITH_ARCH) 14if(WITH_ARCH)
15 set(ARCH ${WITH_ARCH}) 15 set(ARCH ${WITH_ARCH})
@@ -22,6 +22,9 @@ else()
22 endif() 22 endif()
23endif() 23endif()
24 24
25# Additional SYSTEM_DEFINES
26list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK -DHAS_SDL -DHAS_ZEROCONF)
27
25find_package(CXX11 REQUIRED) 28find_package(CXX11 REQUIRED)
26 29
27list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) 30list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX})
diff --git a/cmake/scripts/windows/ArchSetup.cmake b/cmake/scripts/windows/ArchSetup.cmake
index d438b05..8e4f61d 100644
--- a/cmake/scripts/windows/ArchSetup.cmake
+++ b/cmake/scripts/windows/ArchSetup.cmake
@@ -17,14 +17,15 @@ set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/WinMain.cpp)
17 17
18# Precompiled headers fail with per target output directory. (needs CMake 3.1) 18# Precompiled headers fail with per target output directory. (needs CMake 3.1)
19set(PRECOMPILEDHEADER_DIR ${PROJECT_BINARY_DIR}/${CORE_BUILD_CONFIG}/objs) 19set(PRECOMPILEDHEADER_DIR ${PROJECT_BINARY_DIR}/${CORE_BUILD_CONFIG}/objs)
20
21set(CMAKE_SYSTEM_NAME Windows) 20set(CMAKE_SYSTEM_NAME Windows)
22list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${CMAKE_SOURCE_DIR}/project/BuildDependencies/mingwlibs/${ARCH}) 21set(DEPS_FOLDER_RELATIVE project/BuildDependencies)
23list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SOURCE_DIR}/project/BuildDependencies/mingwlibs/${ARCH}/bin) 22set(DEPENDENCIES_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/${ARCH})
24list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${CMAKE_SOURCE_DIR}/project/BuildDependencies/${ARCH}) 23set(MINGW_LIBS_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/mingwlibs/${ARCH})
25list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${CMAKE_SOURCE_DIR}/project/BuildDependencies)
26set(PYTHON_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/project/BuildDependencies/${ARCH}/include/python)
27 24
25list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${MINGW_LIBS_DIR})
26list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin)
27list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${DEPENDENCIES_DIR})
28set(PYTHON_INCLUDE_DIR ${DEPENDENCIES_DIR}/include/python)
28 29
29# -------- Compiler options --------- 30# -------- Compiler options ---------
30 31
@@ -41,6 +42,9 @@ if(${ARCH} STREQUAL win32)
41 list(APPEND SYSTEM_DEFINES $<$<CONFIG:Debug>:-D_ITERATOR_DEBUG_LEVEL=0>) 42 list(APPEND SYSTEM_DEFINES $<$<CONFIG:Debug>:-D_ITERATOR_DEBUG_LEVEL=0>)
42endif() 43endif()
43 44
45# Additional SYSTEM_DEFINES
46list(APPEND SYSTEM_DEFINES -DHAS_IRSERVERSUITE -DHAS_WIN32_NETWORK -DHAS_FILESYSTEM_SMB)
47
44# Make sure /FS is set for Visual Studio in order to prevent simultaneous access to pdb files. 48# Make sure /FS is set for Visual Studio in order to prevent simultaneous access to pdb files.
45if(CMAKE_GENERATOR MATCHES "Visual Studio") 49if(CMAKE_GENERATOR MATCHES "Visual Studio")
46 set(CMAKE_CXX_FLAGS "/MP /FS ${CMAKE_CXX_FLAGS}") 50 set(CMAKE_CXX_FLAGS "/MP /FS ${CMAKE_CXX_FLAGS}")
@@ -56,14 +60,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
56 60
57# For #pragma comment(lib X) 61# For #pragma comment(lib X)
58# TODO: It would certainly be better to handle these libraries via CMake modules. 62# TODO: It would certainly be better to handle these libraries via CMake modules.
59if(${ARCH} STREQUAL win32) 63link_directories(${DEPENDENCIES_DIR}/lib)
60 link_directories(${CMAKE_SOURCE_DIR}/lib/win32/ffmpeg/bin
61 ${CMAKE_SOURCE_DIR}/project/BuildDependencies/${ARCH}/lib
62 ${CMAKE_SOURCE_DIR}/project/BuildDependencies/lib)
63else()
64 link_directories(${CMAKE_SOURCE_DIR}/lib/win32/ffmpeg/bin
65 ${CMAKE_SOURCE_DIR}/project/BuildDependencies/${ARCH}/lib)
66endif()
67 64
68# Additional libraries 65# Additional libraries
69list(APPEND DEPLIBS d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib WS2_32.lib 66list(APPEND DEPLIBS d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib WS2_32.lib
diff --git a/cmake/scripts/windowsstore/ArchSetup.cmake b/cmake/scripts/windowsstore/ArchSetup.cmake
new file mode 100644
index 0000000..6c6622c
--- /dev/null
+++ b/cmake/scripts/windowsstore/ArchSetup.cmake
@@ -0,0 +1,121 @@
1# -------- Architecture settings ---------
2
3check_symbol_exists(_X86_ "Windows.h" _X86_)
4check_symbol_exists(_AMD64_ "Windows.h" _AMD64_)
5check_symbol_exists(_ARM_ "Windows.h" _ARM_)
6
7if(_X86_)
8 set(ARCH win32)
9 set(SDK_TARGET_ARCH x86)
10elseif(_AMD64_)
11 set(ARCH x64)
12 set(SDK_TARGET_ARCH x64)
13elseif(_ARM_)
14 set(ARCH arm)
15 set(SDK_TARGET_ARCH arm)
16else()
17 message(FATAL_ERROR "Unsupported architecture")
18endif()
19
20unset(_X86_)
21unset(_AMD64_)
22unset(_ARM_)
23
24# -------- Paths (mainly for find_package) ---------
25
26set(PLATFORM_DIR platform/win32)
27set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/win10/main.cpp)
28
29# Precompiled headers fail with per target output directory. (needs CMake 3.1)
30set(PRECOMPILEDHEADER_DIR ${PROJECT_BINARY_DIR}/${CORE_BUILD_CONFIG}/objs)
31
32set(CMAKE_SYSTEM_NAME WindowsStore)
33set(CORE_SYSTEM_NAME "windowsstore")
34set(PACKAGE_GUID "281d668b-5739-4abd-b3c2-ed1cda572ed2")
35set(APP_MANIFEST_NAME package.appxmanifest)
36set(DEPS_FOLDER_RELATIVE project/BuildDependencies)
37
38set(DEPENDENCIES_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/win10-${ARCH})
39set(MINGW_LIBS_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/mingwlibs/win10-${ARCH})
40
41# mingw libs
42list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${MINGW_LIBS_DIR})
43list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin)
44# dependencies
45list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${DEPENDENCIES_DIR})
46# for python
47set(PYTHON_INCLUDE_DIR ${DEPENDENCIES_DIR}/include/python)
48
49
50# -------- Compiler options ---------
51
52add_options(CXX ALL_BUILDS "/wd\"4996\"")
53add_options(CXX ALL_BUILDS "/wd\"4146\"")
54add_options(CXX ALL_BUILDS "/wd\"4251\"")
55add_options(CXX ALL_BUILDS "/wd\"4668\"")
56set(ARCH_DEFINES -D_WINDOWS -DTARGET_WINDOWS -DTARGET_WINDOWS_STORE -DXBMC_EXPORT -DMS_UWP)
57if(NOT SDK_TARGET_ARCH STREQUAL arm)
58 list(APPEND ARCH_DEFINES -D__SSE__ -D__SSE2__)
59endif()
60set(SYSTEM_DEFINES -DNOMINMAX -DHAS_DX -D__STDC_CONSTANT_MACROS
61 -DFMT_HEADER_ONLY -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING
62 -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi"
63 -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi"
64 -DUNICODE -D_UNICODE
65 $<$<CONFIG:Debug>:-DD3D_DEBUG_INFO>)
66
67# Additional SYSTEM_DEFINES
68list(APPEND SYSTEM_DEFINES -DHAS_IRSERVERSUITE -DHAS_WIN10_NETWORK)
69
70# The /MP option enables /FS by default.
71set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS} /ZW /EHsc /await")
72# Google Test needs to use shared version of runtime libraries
73set(gtest_force_shared_crt ON CACHE STRING "" FORCE)
74
75
76# -------- Linker options ---------
77
78# For #pragma comment(lib X)
79# TODO: It would certainly be better to handle these libraries via CMake modules.
80link_directories(${MINGW_LIBS_DIR}/lib
81 ${DEPENDENCIES_DIR}/lib)
82
83list(APPEND DEPLIBS d3d11.lib WS2_32.lib dxguid.lib dloadhelper.lib)
84if(ARCH STREQUAL win32 OR ARCH STREQUAL x64)
85 list(APPEND DEPLIBS DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib PowrProf.lib setupapi.lib dwmapi.lib)
86endif()
87# NODEFAULTLIB option
88
89set(_nodefaultlibs_RELEASE libcmt)
90set(_nodefaultlibs_DEBUG libcmt msvcrt)
91foreach(_lib ${_nodefaultlibs_RELEASE})
92 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:\"${_lib}\"")
93endforeach()
94foreach(_lib ${_nodefaultlibs_DEBUG})
95 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:\"${_lib}\"")
96endforeach()
97
98# Make the Release version create a PDB
99set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
100# Minimize the size or the resulting DLLs
101set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF")
102# remove warning
103set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4264")
104
105
106# -------- Visual Studio options ---------
107
108if(CMAKE_GENERATOR MATCHES "Visual Studio")
109 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
110
111 # Generate a batch file that opens Visual Studio with the necessary env variables set.
112 file(WRITE ${CMAKE_BINARY_DIR}/kodi-sln.bat
113 "@echo off\n"
114 "set KODI_HOME=%~dp0\n"
115 "set PATH=%~dp0\\system\n"
116 "start %~dp0\\${PROJECT_NAME}.sln")
117endif()
118
119# -------- Build options ---------
120
121set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE)
diff --git a/cmake/scripts/windowsstore/CFlagOverrides.cmake b/cmake/scripts/windowsstore/CFlagOverrides.cmake
new file mode 100644
index 0000000..0cd1c4d
--- /dev/null
+++ b/cmake/scripts/windowsstore/CFlagOverrides.cmake
@@ -0,0 +1,12 @@
1# compiler flags
2string(APPEND CMAKE_C_FLAGS_INIT " /D_UNICODE /DUNICODE /MP /DWIN32 /D_WINDOWS /W3 /Zi /DTARGET_WINDOWS")
3string(APPEND CMAKE_C_FLAGS_INIT " /DWINAPI_FAMILY=2 /DTARGET_WINDOWS_STORE /D_WINSOCK_DEPRECATED_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE")
4string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " /D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0")
5string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " /MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG")
6# linker flags
7string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " /DYNAMICBASE /NXCOMPAT /APPCONTAINER")
8# win32 specific flags
9if("$ENV{Platform}" STREQUAL X86)
10 string(APPEND CMAKE_C_FLAGS_INIT " /arch:SSE2")
11 string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " /SAFESEH")
12endif()
diff --git a/cmake/scripts/windowsstore/CXXFlagOverrides.cmake b/cmake/scripts/windowsstore/CXXFlagOverrides.cmake
new file mode 100644
index 0000000..2219af4
--- /dev/null
+++ b/cmake/scripts/windowsstore/CXXFlagOverrides.cmake
@@ -0,0 +1,12 @@
1# compiler flags
2string(APPEND CMAKE_CXX_FLAGS_INIT " /D_UNICODE /DUNICODE /MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /DTARGET_WINDOWS")
3string(APPEND CMAKE_CXX_FLAGS_INIT " /DWINAPI_FAMILY=2 /DTARGET_WINDOWS_STORE /D_WINSOCK_DEPRECATED_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE")
4string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " /D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0")
5string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " /MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG")
6# linker flags
7string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " /DYNAMICBASE /NXCOMPAT /APPCONTAINER")
8# win32 specific flags
9if("$ENV{Platform}" STREQUAL X86)
10 string(APPEND CMAKE_CXX_FLAGS_INIT " /arch:SSE2")
11 string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " /SAFESEH")
12endif()
diff --git a/cmake/scripts/windowsstore/Install.cmake b/cmake/scripts/windowsstore/Install.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/cmake/scripts/windowsstore/Install.cmake
diff --git a/cmake/scripts/windowsstore/Macros.cmake b/cmake/scripts/windowsstore/Macros.cmake
new file mode 100644
index 0000000..6e7d1d0
--- /dev/null
+++ b/cmake/scripts/windowsstore/Macros.cmake
@@ -0,0 +1,181 @@
1function(core_link_library lib wraplib)
2 message(AUTHOR_WARNING "core_link_library is not compatible with windows.")
3endfunction()
4
5function(find_soname lib)
6 # Windows uses hardcoded dlls in xbmc/DllPaths_win32.h.
7 # Therefore the output of this function is unused.
8endfunction()
9
10# Add precompiled header to target
11# Arguments:
12# target existing target that will be set up to compile with a precompiled header
13# pch_header the precompiled header file
14# pch_source the precompiled header source file
15# Optional Arguments:
16# PCH_TARGET build precompiled header as separate target with the given name
17# so that the same precompiled header can be used for multiple libraries
18# EXCLUDE_SOURCES if not all target sources shall use the precompiled header,
19# the relevant files can be listed here
20# On return:
21# Compiles the pch_source into a precompiled header and adds the header to
22# the given target
23function(add_precompiled_header target pch_header pch_source)
24 cmake_parse_arguments(PCH "" "PCH_TARGET" "EXCLUDE_SOURCES" ${ARGN})
25
26 if(PCH_PCH_TARGET)
27 set(pch_binary ${PRECOMPILEDHEADER_DIR}/${PCH_PCH_TARGET}.pch)
28 else()
29 set(pch_binary ${PRECOMPILEDHEADER_DIR}/${target}.pch)
30 endif()
31
32 # Set compile options and dependency for sources
33 get_target_property(sources ${target} SOURCES)
34 list(REMOVE_ITEM sources ${pch_source})
35 foreach(exclude_source IN LISTS PCH_EXCLUDE_SOURCES)
36 list(REMOVE_ITEM sources ${exclude_source})
37 endforeach()
38 set_source_files_properties(${sources}
39 PROPERTIES COMPILE_FLAGS "/Yu\"${pch_header}\" /Fp\"${pch_binary}\" /FI\"${pch_header}\""
40 OBJECT_DEPENDS "${pch_binary}")
41
42 # Set compile options for precompiled header
43 if(NOT PCH_PCH_TARGET OR NOT TARGET ${PCH_PCH_TARGET}_pch)
44 set_source_files_properties(${pch_source}
45 PROPERTIES COMPILE_FLAGS "/Yc\"${pch_header}\" /Fp\"${pch_binary}\""
46 OBJECT_OUTPUTS "${pch_binary}")
47 endif()
48
49 # Compile precompiled header
50 if(PCH_PCH_TARGET)
51 # As own target for usage in multiple libraries
52 if(NOT TARGET ${PCH_PCH_TARGET}_pch)
53 add_library(${PCH_PCH_TARGET}_pch STATIC ${pch_source})
54 set_target_properties(${PCH_PCH_TARGET}_pch PROPERTIES COMPILE_PDB_NAME vc140
55 COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR}
56 FOLDER "Build Utilities")
57 endif()
58 # From VS2012 onwards, precompiled headers have to be linked against (LNK2011).
59 target_link_libraries(${target} PUBLIC ${PCH_PCH_TARGET}_pch)
60 set_target_properties(${target} PROPERTIES COMPILE_PDB_NAME vc140
61 COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR})
62 else()
63 # As part of the target
64 target_sources(${target} PRIVATE ${pch_source})
65 endif()
66endfunction()
67
68macro(winstore_set_assets target)
69 file(GLOB ASSET_FILES "${CMAKE_SOURCE_DIR}/tools/windows/packaging/uwp/media/*.png")
70 set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1)
71 set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "media")
72 source_group("media" FILES ${ASSET_FILES})
73 set(RESOURCES ${RESOURCES} ${ASSET_FILES}
74 "${CMAKE_SOURCE_DIR}/tools/windows/packaging/uwp/kodi_temp_key.pfx")
75 set(LICENSE_FILES
76 ${CMAKE_SOURCE_DIR}/LICENSE.GPL
77 ${CMAKE_SOURCE_DIR}/copying.txt
78 ${CMAKE_SOURCE_DIR}/privacy-policy.txt)
79 if(EXISTS "${CMAKE_SOURCE_DIR}/known_issues.txt")
80 list(APPEND LICENSE_FILES ${CMAKE_SOURCE_DIR}/known_issues.txt)
81 endif()
82 set_property(SOURCE ${LICENSE_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1)
83 list(APPEND RESOURCES ${LICENSE_FILES})
84endmacro()
85
86macro(winstore_generate_manifest target)
87 configure_file(
88 ${CMAKE_SOURCE_DIR}/tools/windows/packaging/uwp/${APP_MANIFEST_NAME}.in
89 ${CMAKE_CURRENT_BINARY_DIR}/${APP_MANIFEST_NAME}
90 @ONLY)
91 set(RESOURCES ${RESOURCES} ${CMAKE_CURRENT_BINARY_DIR}/${APP_MANIFEST_NAME})
92endmacro()
93
94macro(add_deployment_content_group path link match exclude)
95 set(_link "")
96 set(_exclude "")
97 file(TO_NATIVE_PATH ${path} _path)
98 file(TO_NATIVE_PATH ${match} _match)
99 if (NOT "${link}" STREQUAL "")
100 file(TO_NATIVE_PATH ${link} _link)
101 set(_link "${_link}\\")
102 endif()
103 if(NOT "${exclude}" STREQUAL "")
104 string(REPLACE "/" "\\" _exclude ${exclude})
105 endif()
106 string(CONCAT UWP_DEPLOYMENT_CONTENT_STR "${UWP_DEPLOYMENT_CONTENT_STR}"
107 " <EmbedResources Include=\"${_path}\\${_match}\" Exclude=\"${_exclude}\">\n"
108 " <Link>${_link}%(RecursiveDir)%(FileName)%(Extension)</Link>\n"
109 " <DeploymentContent>true</DeploymentContent>\n"
110 " </EmbedResources>\n")
111endmacro()
112
113macro(winstore_append_props target)
114 # exclude debug dlls from packaging
115 set(DEBUG_DLLS zlibd.dll freetyped.dll sqlite3d.dll)
116 foreach(_dll ${DEBUG_DLLS})
117 if (DEBUG_DLLS_EXCLUDE)
118 list(APPEND DEBUG_DLLS_EXCLUDE "\;$(BuildRootPath)/dlls/${_dll}")
119 else()
120 list(APPEND DEBUG_DLLS_EXCLUDE "$(BuildRootPath)/dlls/${_dll}")
121 endif()
122 string(CONCAT DEBUG_DLLS_LINKAGE_PROPS "${DEBUG_DLLS_LINKAGE_PROPS}"
123 " <ItemGroup Label=\"Binaries\">\n"
124 " <None Include=\"$(BinPath)\\${_dll}\" Condition=\"'$(Configuration)'=='Debug'\">\n"
125 " <DeploymentContent>true</DeploymentContent>\n"
126 " </None>\n"
127 " </ItemGroup>\n")
128 endforeach(_dll DEBUG_DLLS)
129
130 add_deployment_content_group($(BuildRootPath)/dlls "" *.dll "${DEBUG_DLLS_EXCLUDE}")
131 add_deployment_content_group($(BuildRootPath)/system system **/* "$(BuildRootPath)/**/*.glsl")
132 add_deployment_content_group($(BuildRootPath)/media media **/* "")
133 add_deployment_content_group($(BuildRootPath)/userdata userdata **/* "")
134 add_deployment_content_group($(BuildRootPath)/addons addons **/* "")
135 add_deployment_content_group($(BinaryAddonsPath) addons **/* "")
136
137 foreach(xbt_file ${XBT_FILES})
138 file(RELATIVE_PATH relative ${CMAKE_CURRENT_BINARY_DIR} ${xbt_file})
139 file(TO_NATIVE_PATH ${relative} relative)
140 string(CONCAT XBT_FILE_PROPS "${XBT_FILE_PROPS}"
141 " <ItemGroup Label=\"SkinsMedia\">\n"
142 " <None Include=\"$(BuildRootPath)\\${relative}\">\n"
143 " <Link>${relative}</Link>\n"
144 " <DeploymentContent>true</DeploymentContent>\n"
145 " </None>\n"
146 " </ItemGroup>\n")
147 endforeach()
148
149 set(VCPROJECT_PROPS_FILE "${CMAKE_CURRENT_BINARY_DIR}/${target}.props")
150 file(TO_NATIVE_PATH ${DEPENDENCIES_DIR} DEPENDENCIES_DIR_NATIVE)
151 file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR} CMAKE_CURRENT_BINARY_DIR_NATIVE)
152 file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/project/Win32BuildSetup/BUILD_WIN32/addons BINARY_ADDONS_DIR_NATIVE)
153
154 file(WRITE ${VCPROJECT_PROPS_FILE}
155 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
156 "<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"
157 " <ImportGroup Label=\"PropertySheets\" />\n"
158 " <PropertyGroup Label=\"APP_DLLS\">\n"
159 " <BinPath>${DEPENDENCIES_DIR_NATIVE}\\bin</BinPath>\n"
160 " <BuildRootPath>${CMAKE_CURRENT_BINARY_DIR_NATIVE}</BuildRootPath>\n"
161 " <BinaryAddonsPath>${BINARY_ADDONS_DIR_NATIVE}</BinaryAddonsPath>\n"
162 " </PropertyGroup>\n"
163 "${DEBUG_DLLS_LINKAGE_PROPS}"
164 "${XBT_FILE_PROPS}"
165 " <ItemGroup>\n"
166 "${UWP_DEPLOYMENT_CONTENT_STR}"
167 " </ItemGroup>\n"
168 " <Target Name=\"_CollectCustomResources\" Inputs=\"@(EmbedResources)\" Outputs=\"@(EmbedResources->'$(OutputPath)\\PackageLayout\\%(Link)')\" BeforeTargets=\"AssignTargetPaths\">\n"
169 " <Message Text=\"Collecting package resources...\"/>\n"
170 " <ItemGroup>\n"
171 " <None Include=\"@(EmbedResources)\" />\n"
172 " </ItemGroup>\n"
173 " </Target>\n"
174 "</Project>")
175endmacro()
176
177macro(winstore_add_target_properties target)
178 winstore_set_assets(${target})
179 winstore_generate_manifest(${target})
180 winstore_append_props(${target})
181endmacro() \ No newline at end of file
diff --git a/cmake/scripts/windowsstore/PathSetup.cmake b/cmake/scripts/windowsstore/PathSetup.cmake
new file mode 100644
index 0000000..8550616
--- /dev/null
+++ b/cmake/scripts/windowsstore/PathSetup.cmake
@@ -0,0 +1,34 @@
1if(NOT prefix)
2 set(prefix ${CMAKE_INSTALL_PREFIX})
3else()
4 set(CMAKE_INSTALL_PREFIX ${prefix})
5endif()
6if(NOT exec_prefix)
7 set(exec_prefix ${prefix})
8endif()
9if(NOT libdir)
10 set(libdir ${prefix}/lib)
11endif()
12if(NOT bindir)
13 set(bindir ${prefix}/bin)
14endif()
15if(NOT includedir)
16 set(includedir ${prefix}/include)
17endif()
18if(NOT datarootdir)
19 set(datarootdir ${prefix}/share)
20endif()
21if(NOT datadir)
22 set(datadir ${datarootdir})
23endif()
24
25list(APPEND final_message "-- PATH config --")
26list(APPEND final_message "Prefix: ${prefix}")
27list(APPEND final_message "Libdir: ${libdir}")
28list(APPEND final_message "Bindir: ${bindir}")
29list(APPEND final_message "Includedir: ${includedir}")
30list(APPEND final_message "Datarootdir: ${datarootdir}")
31list(APPEND final_message "Datadir: ${datadir}")
32
33set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\"
34 -DINSTALL_PATH=\"${datarootdir}/kodi\")
diff --git a/cmake/scripts/windowsstore/tools/patch.cmake b/cmake/scripts/windowsstore/tools/patch.cmake
new file mode 100644
index 0000000..0a342fa
--- /dev/null
+++ b/cmake/scripts/windowsstore/tools/patch.cmake
@@ -0,0 +1,37 @@
1find_program(PATCH_FOUND NAMES patch patch.exe)
2if(PATCH_FOUND)
3 message(STATUS "patch utility found at ${PATCH_FOUND}")
4else()
5 set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-3")
6 set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip")
7 set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}")
8 set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE})
9
10 # download the archive containing patch.exe
11 message(STATUS "Downloading patch utility from ${PATCH_URL}...")
12 file(DOWNLOAD "${PATCH_URL}" "${PATCH_DOWNLOAD}" STATUS PATCH_DL_STATUS LOG PATCH_LOG SHOW_PROGRESS)
13 list(GET PATCH_DL_STATUS 0 PATCH_RETCODE)
14 if(NOT PATCH_RETCODE EQUAL 0)
15 message(FATAL_ERROR "ERROR downloading ${PATCH_URL} - status: ${PATCH_DL_STATUS} log: ${PATCH_LOG}")
16 endif()
17
18 # extract the archive containing patch.exe
19 execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${PATCH_DOWNLOAD}
20 WORKING_DIRECTORY ${BUILD_DIR})
21
22 # make sure the extraction worked and that patch.exe is there
23 set(PATCH_PATH ${BUILD_DIR}/${PATCH_ARCHIVE_NAME})
24 set(PATCH_BINARY_PATH ${PATCH_PATH}/bin/patch.exe)
25 if(NOT EXISTS ${PATCH_PATH} OR NOT EXISTS ${PATCH_BINARY_PATH})
26 message(FATAL_ERROR "ERROR extracting patch utility from ${PATCH_PATH}")
27 endif()
28
29 # copy patch.exe into the output directory
30 file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin)
31
32 # make sure that cmake can find the copied patch.exe
33 find_program(PATCH_FOUND NAMES patch patch.exe)
34 if(NOT PATCH_FOUND)
35 message(FATAL_ERROR "ERROR installing patch utility from ${PATCH_BINARY_PATH} to ${ADDON_DEPENDS_PATH}/bin")
36 endif()
37endif()
diff --git a/cmake/treedata/android/subdirs.txt b/cmake/treedata/android/subdirs.txt
index 0733201..b56618a 100644
--- a/cmake/treedata/android/subdirs.txt
+++ b/cmake/treedata/android/subdirs.txt
@@ -1,4 +1,5 @@
1xbmc/linux linuxsupport 1xbmc/cores/RetroPlayer/process/android cores/RetroPlayer/process/android
2xbmc/platform/linux platform/linux
2xbmc/input/touch input/touch 3xbmc/input/touch input/touch
3xbmc/input/touch/generic input/touch/generic 4xbmc/input/touch/generic input/touch/generic
4xbmc/network/linux network/linux 5xbmc/network/linux network/linux
diff --git a/cmake/treedata/common/music.txt b/cmake/treedata/common/music.txt
index 71f30e1..29aae7b 100644
--- a/cmake/treedata/common/music.txt
+++ b/cmake/treedata/common/music.txt
@@ -1,5 +1,6 @@
1xbmc/music music 1xbmc/music music
2xbmc/music/dialogs music/dialogs 2xbmc/music/dialogs music/dialogs
3xbmc/music/infoscanner music/infoscanner 3xbmc/music/infoscanner music/infoscanner
4xbmc/music/jobs music/jobs
4xbmc/music/tags music/tags 5xbmc/music/tags music/tags
5xbmc/music/windows music/windows 6xbmc/music/windows music/windows
diff --git a/cmake/treedata/common/retroplayer.txt b/cmake/treedata/common/retroplayer.txt
index ab18c3c..97e27b3 100644
--- a/cmake/treedata/common/retroplayer.txt
+++ b/cmake/treedata/common/retroplayer.txt
@@ -1,3 +1,7 @@
1xbmc/cores/RetroPlayer cores/RetroPlayer 1xbmc/cores/RetroPlayer cores/RetroPlayer
2xbmc/cores/RetroPlayer/guicontrols cores/RetroPlayer/guicontrols 2xbmc/cores/RetroPlayer/guicontrols cores/RetroPlayer/guicontrols
3xbmc/cores/RetroPlayer/process cores/RetroPlayer/process
3xbmc/cores/RetroPlayer/rendering cores/RetroPlayer/rendering 4xbmc/cores/RetroPlayer/rendering cores/RetroPlayer/rendering
5xbmc/cores/RetroPlayer/rendering/VideoRenderers cores/RetroPlayer/rendering/VideoRenderers
6xbmc/cores/RetroPlayer/rendering/VideoShaders cores/RetroPlayer/rendering/VideoShaders
7xbmc/cores/RetroPlayer/windows cores/RetroPlayer/windows
diff --git a/cmake/treedata/common/subdirs.txt b/cmake/treedata/common/subdirs.txt
index ee4e83c..d5412b5 100644
--- a/cmake/treedata/common/subdirs.txt
+++ b/cmake/treedata/common/subdirs.txt
@@ -1,16 +1,23 @@
1xbmc xbmc 1xbmc xbmc
2xbmc/addons addons 2xbmc/addons addons
3xbmc/addons/binary-addons addons_binary-addons 3xbmc/addons/binary-addons addons_binary-addons
4xbmc/addons/interfaces addonsBinaryInterfaces 4xbmc/addons/interfaces addons_interfaces
5xbmc/addons/interfaces/Addon addonCallbacks_Addon 5xbmc/addons/interfaces/Addon addons_interfaces_addon
6xbmc/addons/interfaces/GUI addons_interfaces_gui 6xbmc/addons/interfaces/GUI addons_interfaces_gui
7xbmc/addons/interfaces/GUI/controls addons_interfaces_gui_controls 7xbmc/addons/interfaces/GUI/controls addons_interfaces_gui_controls
8xbmc/addons/interfaces/GUI/dialogs addons_interfaces_gui_dialogs 8xbmc/addons/interfaces/GUI/dialogs addons_interfaces_gui_dialogs
9xbmc/addons/settings addonsSettings 9xbmc/addons/kodi-addon-dev-kit/include/kodi addons_kodi-addon-dev-kit_include_kodi
10xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance addons_kodi-addon-dev-kit_include_kodi_addon-instance
11xbmc/addons/kodi-addon-dev-kit/include/kodi/gui addons_kodi-addon-dev-kit_include_kodi_gui
12xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls addons_kodi-addon-dev-kit_include_kodi_gui_controls
13xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs addons_kodi-addon-dev-kit_include_kodi_gui_dialogs
14xbmc/addons/kodi-addon-dev-kit/include/kodi/tools addons_kodi-addon-dev-kit_include_kodi_tools
15xbmc/addons/settings addons_settings
10xbmc/commons commons 16xbmc/commons commons
11xbmc/dbwrappers dbwrappers 17xbmc/dbwrappers dbwrappers
12xbmc/dialogs dialogs 18xbmc/dialogs dialogs
13xbmc/favourites favourites 19xbmc/favourites favourites
20xbmc/guiinfo guiinfo
14xbmc/guilib guilib 21xbmc/guilib guilib
15xbmc/input input 22xbmc/input input
16xbmc/input/joysticks input/joysticks 23xbmc/input/joysticks input/joysticks
@@ -35,5 +42,6 @@ xbmc/storage storage
35xbmc/threads threads 42xbmc/threads threads
36xbmc/utils utils 43xbmc/utils utils
37xbmc/view view 44xbmc/view view
45xbmc/weather weather
38xbmc/windowing windowing 46xbmc/windowing windowing
39xbmc/windows windows 47xbmc/windows windows
diff --git a/cmake/treedata/common/video.txt b/cmake/treedata/common/video.txt
index acfb33b..ab53453 100644
--- a/cmake/treedata/common/video.txt
+++ b/cmake/treedata/common/video.txt
@@ -1,4 +1,5 @@
1xbmc/video video 1xbmc/video video
2xbmc/video/dialogs video/dialogs 2xbmc/video/dialogs video/dialogs
3xbmc/video/jobs video/jobs 3xbmc/video/jobs video/jobs
4xbmc/video/tags video/tags
4xbmc/video/windows video/windows 5xbmc/video/windows video/windows
diff --git a/cmake/treedata/freebsd/subdirs.txt b/cmake/treedata/freebsd/subdirs.txt
index df2fa76..f7651ee 100644
--- a/cmake/treedata/freebsd/subdirs.txt
+++ b/cmake/treedata/freebsd/subdirs.txt
@@ -1,6 +1,5 @@
1xbmc/linux linuxsupport 1xbmc/platform/linux platform/linux
2xbmc/linux/sse4 sse4 2xbmc/platform/linux/input platform/linux/input
3xbmc/input/linux input/linux
4xbmc/input/touch input/touch 3xbmc/input/touch input/touch
5xbmc/input/touch/generic input/touch/generic 4xbmc/input/touch/generic input/touch/generic
6xbmc/network/linux network/linux 5xbmc/network/linux network/linux
diff --git a/cmake/treedata/ios/subdirs.txt b/cmake/treedata/ios/subdirs.txt
index 4bbeeb1..00f5cf1 100644
--- a/cmake/treedata/ios/subdirs.txt
+++ b/cmake/treedata/ios/subdirs.txt
@@ -1,4 +1,4 @@
1xbmc/linux linuxsupport 1xbmc/platform/linux platform/linux
2xbmc/input/touch input/touch 2xbmc/input/touch input/touch
3xbmc/input/touch/generic input/touch/generic 3xbmc/input/touch/generic input/touch/generic
4xbmc/network/linux network/linux 4xbmc/network/linux network/linux
@@ -13,4 +13,5 @@ xbmc/platform/darwin/ios-common platform_ios-common
13xbmc/filesystem/posix filesystem/posix 13xbmc/filesystem/posix filesystem/posix
14xbmc/utils/posix utils_posix 14xbmc/utils/posix utils_posix
15xbmc/windowing/osx windowing/osx 15xbmc/windowing/osx windowing/osx
16xbmc/cores/RetroPlayer/process/ios cores/RetroPlayer/process/ios
16xbmc/cores/VideoPlayer/Process/ios cores/VideoPlayer/Process/ios 17xbmc/cores/VideoPlayer/Process/ios cores/VideoPlayer/Process/ios
diff --git a/cmake/treedata/linux/subdirs.txt b/cmake/treedata/linux/subdirs.txt
index e301579..b310b53 100644
--- a/cmake/treedata/linux/subdirs.txt
+++ b/cmake/treedata/linux/subdirs.txt
@@ -1,5 +1,5 @@
1xbmc/linux linuxsupport 1xbmc/platform/linux platform/linux
2xbmc/input/linux input/linux 2xbmc/platform/linux/input platform/linux/input
3xbmc/input/touch input/touch 3xbmc/input/touch input/touch
4xbmc/input/touch/generic input/touch/generic 4xbmc/input/touch/generic input/touch/generic
5xbmc/network/linux network/linux 5xbmc/network/linux network/linux
@@ -9,5 +9,6 @@ xbmc/storage/linux storage/linux
9xbmc/filesystem/posix filesystem/posix 9xbmc/filesystem/posix filesystem/posix
10xbmc/utils/posix utils_posix 10xbmc/utils/posix utils_posix
11xbmc/platform/posix posix 11xbmc/platform/posix posix
12xbmc/cores/RetroPlayer/process/rbpi cores/RetroPlayer/process/rbpi
12xbmc/cores/VideoPlayer/Process/rbpi cores/VideoPlayer/Process/rbpi 13xbmc/cores/VideoPlayer/Process/rbpi cores/VideoPlayer/Process/rbpi
13xbmc/windowing/linux windowing/linux 14xbmc/windowing/linux windowing/linux
diff --git a/cmake/treedata/optional/common/X.txt b/cmake/treedata/optional/common/X.txt
index 26b8a90..e66ad80 100644
--- a/cmake/treedata/optional/common/X.txt
+++ b/cmake/treedata/optional/common/X.txt
@@ -1,2 +1,3 @@
1xbmc/windowing/X11 windowing/X11 # X 1xbmc/windowing/X11 windowing/X11 # X
2xbmc/cores/RetroPlayer/process/X11 cores/RetroPlayer/process/X11 # X
2xbmc/cores/VideoPlayer/Process/X11 cores/VideoPlayer/Process/X11 # X 3xbmc/cores/VideoPlayer/Process/X11 cores/VideoPlayer/Process/X11 # X
diff --git a/cmake/treedata/optional/common/aml.txt b/cmake/treedata/optional/common/aml.txt
index db1efd1..3d412d0 100644
--- a/cmake/treedata/optional/common/aml.txt
+++ b/cmake/treedata/optional/common/aml.txt
@@ -1,2 +1,3 @@
1xbmc/cores/RetroPlayer/process/amlogic cores/RetroPlayer/process/amlogic # AML
1xbmc/windowing/amlogic windowing/amlogic # AML 2xbmc/windowing/amlogic windowing/amlogic # AML
2 3
diff --git a/cmake/treedata/optional/common/gbm.txt b/cmake/treedata/optional/common/gbm.txt
index 1adde93..196b323 100644
--- a/cmake/treedata/optional/common/gbm.txt
+++ b/cmake/treedata/optional/common/gbm.txt
@@ -1 +1,2 @@
1xbmc/windowing/gbm windowing/gbm # GBM 1xbmc/cores/RetroPlayer/process/gbm cores/RetroPlayer/process/gbm # GBM
2xbmc/windowing/gbm windowing/gbm # GBM \ No newline at end of file
diff --git a/cmake/treedata/optional/common/imx.txt b/cmake/treedata/optional/common/imx.txt
deleted file mode 100644
index 8c7e60b..0000000
--- a/cmake/treedata/optional/common/imx.txt
+++ /dev/null
@@ -1 +0,0 @@
1xbmc/windowing/egl windowing/egl # IMX
diff --git a/cmake/treedata/optional/common/python.txt b/cmake/treedata/optional/common/python.txt
index 4960485..c381a18 100644
--- a/cmake/treedata/optional/common/python.txt
+++ b/cmake/treedata/optional/common/python.txt
@@ -1,4 +1,4 @@
1xbmc/interfaces/legacy interfaces/legacy # PYTHON 1xbmc/interfaces/legacy interfaces/legacy # PYTHON
2xbmc/interfaces/legacy/wsgi interfaces/legacy/wsgi # PYTHON 2xbmc/interfaces/legacy/wsgi interfaces/legacy/wsgi # PYTHON
3xbmc/interfaces/python interfaces/python # PYTHON 3xbmc/interfaces/python interfaces/python # PYTHON
4xbmc/interfaces/swig build/swig # PYTHON 4xbmc/interfaces/swig swig # PYTHON
diff --git a/cmake/treedata/optional/common/wayland.txt b/cmake/treedata/optional/common/wayland.txt
index 3725fc6..4664b35 100644
--- a/cmake/treedata/optional/common/wayland.txt
+++ b/cmake/treedata/optional/common/wayland.txt
@@ -1,2 +1,3 @@
1xbmc/windowing/wayland windowing/wayland # WAYLANDPP 1xbmc/windowing/wayland windowing/wayland # WAYLANDPP
2xbmc/cores/RetroPlayer/process/wayland cores/RetroPlayer/process/wayland # WAYLANDPP
2xbmc/cores/VideoPlayer/Process/wayland cores/VideoPlayer/Process/wayland # WAYLANDPP \ No newline at end of file 3xbmc/cores/VideoPlayer/Process/wayland cores/VideoPlayer/Process/wayland # WAYLANDPP \ No newline at end of file
diff --git a/cmake/treedata/osx/subdirs.txt b/cmake/treedata/osx/subdirs.txt
index a520243..5b1b302 100644
--- a/cmake/treedata/osx/subdirs.txt
+++ b/cmake/treedata/osx/subdirs.txt
@@ -1,4 +1,4 @@
1xbmc/linux linuxsupport 1xbmc/platform/linux platform/linux
2xbmc/network/linux network/linux 2xbmc/network/linux network/linux
3xbmc/network/osx network/osx 3xbmc/network/osx network/osx
4xbmc/peripherals/bus/osx peripherals/bus/osx 4xbmc/peripherals/bus/osx peripherals/bus/osx
@@ -10,4 +10,5 @@ xbmc/platform/darwin/osx platform_osx
10xbmc/filesystem/posix filesystem/posix 10xbmc/filesystem/posix filesystem/posix
11xbmc/utils/posix utils_posix 11xbmc/utils/posix utils_posix
12xbmc/windowing/osx windowing/osx 12xbmc/windowing/osx windowing/osx
13xbmc/cores/RetroPlayer/process/osx cores/RetroPlayer/process/osx
13xbmc/cores/VideoPlayer/Process/osx cores/VideoPlayer/Process/osx 14xbmc/cores/VideoPlayer/Process/osx cores/VideoPlayer/Process/osx
diff --git a/cmake/treedata/windows/subdirs.txt b/cmake/treedata/windows/subdirs.txt
index bdbbe1d..8344320 100644
--- a/cmake/treedata/windows/subdirs.txt
+++ b/cmake/treedata/windows/subdirs.txt
@@ -12,4 +12,6 @@ xbmc/utils/win32 utils_win32
12xbmc/rendering/dx rendering_dx 12xbmc/rendering/dx rendering_dx
13xbmc/threads/platform/win threads_win 13xbmc/threads/platform/win threads_win
14xbmc/windowing/windows windowing/windows 14xbmc/windowing/windows windowing/windows
15xbmc/cores/RetroPlayer/process/windows cores/RetroPlayer/process/windows
16xbmc/cores/RetroPlayer/rendering/VideoShaders/windows cores/RetroPlayer/rendering/VideoShaders/windows
15xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows 17xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows
diff --git a/cmake/treedata/windowsstore/externals.txt b/cmake/treedata/windowsstore/externals.txt
new file mode 100644
index 0000000..989677e
--- /dev/null
+++ b/cmake/treedata/windowsstore/externals.txt
@@ -0,0 +1 @@
lib/win32/Effects11 Effects11
diff --git a/cmake/treedata/windowsstore/subdirs.txt b/cmake/treedata/windowsstore/subdirs.txt
new file mode 100644
index 0000000..84150d5
--- /dev/null
+++ b/cmake/treedata/windowsstore/subdirs.txt
@@ -0,0 +1,16 @@
1xbmc/platform/win10 platform_win10
2xbmc/input/windows input/windows
3xbmc/input/touch input/touch
4xbmc/input/touch/generic input/touch/generic
5xbmc/network/win10 network/win10
6xbmc/network/mdns network/mdns
7xbmc/peripherals/bus/win10 peripherals/bus/win10
8xbmc/powermanagement/win10 powermanagement/win10
9xbmc/storage/win10 storage/win10
10xbmc/filesystem/win32 filesystem/win32
11xbmc/filesystem/win10 filesystem/win10
12xbmc/utils/win32 utils_win32
13xbmc/rendering/dx rendering_dx
14xbmc/threads/platform/win threads_win
15xbmc/windowing/win10 windowing/win10
16xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows
diff --git a/version.txt b/version.txt
index d828028..545f436 100644
--- a/version.txt
+++ b/version.txt
@@ -1,10 +1,12 @@
1APP_NAME Kodi 1APP_NAME Kodi
2COMPANY_NAME XBMC-Foundation 2COMPANY_NAME XBMC Foundation
3WEBSITE http://kodi.tv 3WEBSITE http://kodi.tv
4VERSION_MAJOR 18 4VERSION_MAJOR 18
5VERSION_MINOR 0 5VERSION_MINOR 0
6VERSION_TAG ALPHA1 6VERSION_TAG ALPHA1
7VERSION_CODE 179701 7VERSION_CODE 17.99.701
8ADDON_API 17.9.701 8ADDON_API 17.9.701
9APP_PACKAGE org.xbmc.kodi 9APP_PACKAGE org.xbmc.kodi
10 10PACKAGE_IDENTITY XBMCFoundation.Kodi
11PACKAGE_PUBLISHER C62BD90A-CDD8-477F-96C3-B25992247B97
12PACKAGE_DESCRIPTION Kodi is an open source (GPL) software media center for playing videos, music, pictures, games, and more.
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h
index 0c5e617..432a1c3 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h
@@ -160,6 +160,7 @@ typedef struct AddonToKodiFuncTable_Addon
160 160
161 // Function addresses used for callbacks from addon to Kodi 161 // Function addresses used for callbacks from addon to Kodi
162 void (*free_string)(void* kodiBase, char* str); 162 void (*free_string)(void* kodiBase, char* str);
163 void (*free_string_array)(void* kodiBase, char** arr, int numElements);
163 char* (*get_addon_path)(void* kodiBase); 164 char* (*get_addon_path)(void* kodiBase);
164 char* (*get_base_user_path)(void* kodiBase); 165 char* (*get_base_user_path)(void* kodiBase);
165 void (*addon_log_msg)(void* kodiBase, const int loglevel, const char *msg); 166 void (*addon_log_msg)(void* kodiBase, const int loglevel, const char *msg);
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/CMakeLists.txt
new file mode 100644
index 0000000..80e9275
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/CMakeLists.txt
@@ -0,0 +1,24 @@
1set(HEADERS AddonBase.h
2 AudioEngine.h
3 Filesystem.h
4 General.h
5 Network.h
6 StreamCodec.h
7 StreamCrypto.h
8 kodi_game_dll.h
9 kodi_game_types.h
10 kodi_vfs_types.h
11 libKODI_game.h
12 libKODI_guilib.h
13 libXBMC_addon.h
14 libXBMC_pvr.h
15 versions.h
16 xbmc_addon_dll.h
17 xbmc_addon_types.h
18 xbmc_epg_types.h
19 xbmc_pvr_dll.h
20 xbmc_pvr_types.h)
21
22if(NOT ENABLE_STATIC_LIBS)
23 core_add_library(addons_kodi-addon-dev-kit_include_kodi)
24endif()
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/Filesystem.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/Filesystem.h
index b06770c..b089da3 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/Filesystem.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/Filesystem.h
@@ -22,11 +22,16 @@
22#include "AddonBase.h" 22#include "AddonBase.h"
23 23
24#include <map> 24#include <map>
25#include <vector>
25 26
26#if !defined(_WIN32) 27#if !defined(_WIN32)
27 #include <sys/stat.h> 28 #include <sys/stat.h>
28 #if !defined(__stat64) 29 #if !defined(__stat64)
29 #define __stat64 stat64 30 #if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD)
31 #define __stat64 stat
32 #else
33 #define __stat64 stat64
34 #endif
30 #endif 35 #endif
31#endif 36#endif
32#ifdef _WIN32 // windows 37#ifdef _WIN32 // windows
@@ -110,7 +115,7 @@ extern "C"
110 double (*get_file_download_speed)(void* kodiBase, void* file); 115 double (*get_file_download_speed)(void* kodiBase, void* file);
111 void (*close_file)(void* kodiBase, void* file); 116 void (*close_file)(void* kodiBase, void* file);
112 int (*get_file_chunk_size)(void* kodiBase, void* file); 117 int (*get_file_chunk_size)(void* kodiBase, void* file);
113 char* (*get_property)(void* kodiBase, void* file, int type, const char *name); 118 char** (*get_property_values)(void* kodiBase, void* file, int type, const char *name, int *numValues);
114 119
115 void* (*curl_create)(void* kodiBase, const char* url); 120 void* (*curl_create)(void* kodiBase, const char* url);
116 bool (*curl_add_option)(void* kodiBase, void* file, int type, const char* name, const char* value); 121 bool (*curl_add_option)(void* kodiBase, void* file, int type, const char* name, const char* value);
@@ -180,16 +185,40 @@ typedef enum OpenFileFlags
180 185
181//============================================================================== 186//==============================================================================
182/// \ingroup cpp_kodi_vfs_Defs 187/// \ingroup cpp_kodi_vfs_Defs
183/// @brief Used CURL message types 188/// @brief CURL message types
189///
190/// Used on kodi::vfs::CFile::CURLAddOption()
184/// 191///
185typedef enum CURLOptiontype 192typedef enum CURLOptiontype
186{ 193{
187 /// Set a general option 194 /// Set a general option
188 ADDON_CURL_OPTION_OPTION, 195 ADDON_CURL_OPTION_OPTION,
196
189 /// Set a protocol option 197 /// Set a protocol option
198 ///
199 /// The following names for *ADDON_CURL_OPTION_PROTOCOL* are possible:
200 ///
201 /// | Option name | Description
202 /// |---------------------------:|:----------------------------------------------------------
203 /// | accept-charset | Set the "accept-charset" header
204 /// | acceptencoding or encoding | Set the "accept-encoding" header
205 /// | active-remote | Set the "active-remote" header
206 /// | auth | Set the authentication method. Possible values: any, anysafe, digest, ntlm
207 /// | connection-timeout | Set the connection timeout in seconds
208 /// | cookie | Set the "cookie" header
209 /// | customrequest | Set a custom HTTP request like DELETE
210 /// | noshout | Set to true if kodi detects a stream as shoutcast by mistake.
211 /// | postdata | Set the post body (value needs to be base64 encoded). (Implicitly sets the request to POST)
212 /// | referer | Set the "referer" header
213 /// | user-agent | Set the "user-agent" header
214 /// | seekable | Set the stream seekable. 1: enable, 0: disable
215 /// | sslcipherlist | Set list of accepted SSL ciphers.
216 ///
190 ADDON_CURL_OPTION_PROTOCOL, 217 ADDON_CURL_OPTION_PROTOCOL,
218
191 /// Set User and password 219 /// Set User and password
192 ADDON_CURL_OPTION_CREDENTIALS, 220 ADDON_CURL_OPTION_CREDENTIALS,
221
193 /// Add a Header 222 /// Add a Header
194 ADDON_CURL_OPTION_HEADER 223 ADDON_CURL_OPTION_HEADER
195} CURLOptiontype; 224} CURLOptiontype;
@@ -197,7 +226,9 @@ typedef enum CURLOptiontype
197 226
198//============================================================================== 227//==============================================================================
199/// \ingroup cpp_kodi_vfs_Defs 228/// \ingroup cpp_kodi_vfs_Defs
200/// @brief Used CURL message types 229/// @brief CURL message types
230///
231/// Used on kodi::vfs::CFile::GetPropertyValue() and kodi::vfs::CFile::GetPropertyValues()
201/// 232///
202typedef enum FilePropertyTypes 233typedef enum FilePropertyTypes
203{ 234{
@@ -210,7 +241,9 @@ typedef enum FilePropertyTypes
210 /// Get file content charset 241 /// Get file content charset
211 ADDON_FILE_PROPERTY_CONTENT_CHARSET, 242 ADDON_FILE_PROPERTY_CONTENT_CHARSET,
212 /// Get file mime type 243 /// Get file mime type
213 ADDON_FILE_PROPERTY_MIME_TYPE 244 ADDON_FILE_PROPERTY_MIME_TYPE,
245 /// Get file effective URL (last one if redirected)
246 ADDON_FILE_PROPERTY_EFFECTIVE_URL
214} FilePropertyTypes; 247} FilePropertyTypes;
215//------------------------------------------------------------------------------ 248//------------------------------------------------------------------------------
216 249
@@ -1027,7 +1060,7 @@ namespace vfs
1027 /// #include <kodi/Filesystem.h> 1060 /// #include <kodi/Filesystem.h>
1028 /// ... 1061 /// ...
1029 /// STAT_STRUCTURE statFile; 1062 /// STAT_STRUCTURE statFile;
1030 /// int ret = kodi::vfs::StatFile("special://temp/kodi.log", &statFile); 1063 /// int ret = kodi::vfs::StatFile("special://temp/kodi.log", statFile);
1031 /// fprintf(stderr, "deviceId (ID of device containing file) = %u\n" 1064 /// fprintf(stderr, "deviceId (ID of device containing file) = %u\n"
1032 /// "size (total size, in bytes) = %lu\n" 1065 /// "size (total size, in bytes) = %lu\n"
1033 /// "accessTime (time of last access) = %lu\n" 1066 /// "accessTime (time of last access) = %lu\n"
@@ -1540,22 +1573,51 @@ namespace vfs
1540 /// @param[in] name The name of a named property value (e.g. Header) 1573 /// @param[in] name The name of a named property value (e.g. Header)
1541 /// @return value of requested property, empty on failure / non-existance 1574 /// @return value of requested property, empty on failure / non-existance
1542 /// 1575 ///
1543 const std::string GetProperty(FilePropertyTypes type, const std::string &name) const 1576 const std::string GetPropertyValue(FilePropertyTypes type, const std::string &name) const
1544 { 1577 {
1545 if (!m_file) 1578 if (!m_file)
1546 { 1579 {
1547 kodi::Log(ADDON_LOG_ERROR, "kodi::vfs::CURLCreate(...) needed to call before GetProperty!"); 1580 kodi::Log(ADDON_LOG_ERROR, "kodi::vfs::CURLCreate(...) needed to call before GetPropertyValue!");
1581 return "";
1582 }
1583 std::vector<std::string> values = GetPropertyValues(type, name);
1584 if (values.empty()) {
1548 return ""; 1585 return "";
1549 } 1586 }
1550 char *res(::kodi::addon::CAddonBase::m_interface->toKodi->kodi_filesystem->get_property( 1587 return values[0];
1551 ::kodi::addon::CAddonBase::m_interface->toKodi->kodiBase, m_file, type, name.c_str())); 1588 }
1589 //--------------------------------------------------------------------------
1590
1591 //==========================================================================
1592 ///
1593 /// @ingroup cpp_kodi_vfs_CFile
1594 /// @brief retrieve file property values
1595 ///
1596 /// @param[in] type The type of the file property values to retrieve the value for
1597 /// @param[in] name The name of the named property (e.g. Header)
1598 /// @return values of requested property, empty vector on failure / non-existance
1599 ///
1600 const std::vector<std::string> GetPropertyValues(FilePropertyTypes type, const std::string &name) const
1601 {
1602 if (!m_file)
1603 {
1604 kodi::Log(ADDON_LOG_ERROR, "kodi::vfs::CURLCreate(...) needed to call before GetPropertyValues!");
1605 return std::vector<std::string>();
1606 }
1607 int numValues;
1608 char **res(::kodi::addon::CAddonBase::m_interface->toKodi->kodi_filesystem->get_property_values(
1609 ::kodi::addon::CAddonBase::m_interface->toKodi->kodiBase, m_file, type, name.c_str(), &numValues));
1552 if (res) 1610 if (res)
1553 { 1611 {
1554 std::string strReturn(res); 1612 std::vector<std::string> vecReturn;
1555 ::kodi::addon::CAddonBase::m_interface->toKodi->free_string(::kodi::addon::CAddonBase::m_interface->toKodi->kodiBase, res); 1613 for (int i = 0; i < numValues; ++i)
1556 return strReturn; 1614 {
1615 vecReturn.emplace_back(res[i]);
1616 }
1617 ::kodi::addon::CAddonBase::m_interface->toKodi->free_string_array(::kodi::addon::CAddonBase::m_interface->toKodi->kodiBase, res, numValues);
1618 return vecReturn;
1557 } 1619 }
1558 return ""; 1620 return std::vector<std::string>();
1559 } 1621 }
1560 //-------------------------------------------------------------------------- 1622 //--------------------------------------------------------------------------
1561 1623
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/General.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/General.h
index f4295ea..22d31f1 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/General.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/General.h
@@ -37,7 +37,7 @@ typedef struct AddonToKodiFuncTable_kodi
37 char* (*get_addon_info)(void* kodiBase, const char* id); 37 char* (*get_addon_info)(void* kodiBase, const char* id);
38 bool (*open_settings_dialog)(void* kodiBase); 38 bool (*open_settings_dialog)(void* kodiBase);
39 char* (*unknown_to_utf8)(void* kodiBase, const char* source, bool* ret, bool failOnBadChar); 39 char* (*unknown_to_utf8)(void* kodiBase, const char* source, bool* ret, bool failOnBadChar);
40 char* (*get_localized_string)(void* kodiBase, long dwCode); 40 char* (*get_localized_string)(void* kodiBase, long label_id);
41 char* (*get_language)(void* kodiBase, int format, bool region); 41 char* (*get_language)(void* kodiBase, int format, bool region);
42 bool (*queue_notification)(void* kodiBase, int type, const char* header, const char* message, const char* imageFile, unsigned int displayTime, bool withSound, unsigned int messageTime); 42 bool (*queue_notification)(void* kodiBase, int type, const char* header, const char* message, const char* imageFile, unsigned int displayTime, bool withSound, unsigned int messageTime);
43 void (*get_md5)(void* kodiBase, const char* text, char* md5); 43 void (*get_md5)(void* kodiBase, const char* text, char* md5);
@@ -46,6 +46,7 @@ typedef struct AddonToKodiFuncTable_kodi
46 void (*get_free_mem)(void* kodiBase, long* free, long* total, bool as_bytes); 46 void (*get_free_mem)(void* kodiBase, long* free, long* total, bool as_bytes);
47 int (*get_global_idle_time)(void* kodiBase); 47 int (*get_global_idle_time)(void* kodiBase);
48 void (*kodi_version)(void* kodiBase, char** compile_name, int* major, int* minor, char** revision, char** tag, char** tagversion); 48 void (*kodi_version)(void* kodiBase, char** compile_name, int* major, int* minor, char** revision, char** tag, char** tagversion);
49 char* (*get_current_skin_id)(void* kodiBase);
49} AddonToKodiFuncTable_kodi; 50} AddonToKodiFuncTable_kodi;
50 51
51//============================================================================== 52//==============================================================================
@@ -623,6 +624,47 @@ inline int GetGlobalIdleTime()
623namespace kodi { 624namespace kodi {
624/// 625///
625/// \ingroup cpp_kodi 626/// \ingroup cpp_kodi
627/// @brief Get the currently used skin identification name from Kodi
628///-----------------------------------------------------------------------
629///
630/// @return The active skin id name as a string
631///
632///
633/// @note This is not the full path like 'special://home/addons/MediaCenter',
634/// but only 'MediaCenter'.
635///
636///
637/// ------------------------------------------------------------------------
638///
639/// **Example:**
640/// ~~~~~~~~~~~~~{.cpp}
641/// #include <kodi/General.h>
642/// ..
643/// std::string skinid = kodi::GetCurrentSkinId();
644/// ..
645/// ~~~~~~~~~~~~~
646///
647inline std::string GetCurrentSkinId()
648{
649 AddonToKodiFuncTable_Addon* toKodi = ::kodi::addon::CAddonBase::m_interface->toKodi;
650
651 std::string strReturn;
652 char* strMsg = toKodi->kodi->get_current_skin_id(toKodi->kodiBase);
653 if (strMsg != nullptr)
654 {
655 if (std::strlen(strMsg))
656 strReturn = strMsg;
657 toKodi->free_string(toKodi->kodiBase, strMsg);
658 }
659 return strReturn;
660}
661} /* namespace kodi */
662//------------------------------------------------------------------------------
663
664//==============================================================================
665namespace kodi {
666///
667/// \ingroup cpp_kodi
626/// @brief Get current Kodi informations and versions, returned data from the following 668/// @brief Get current Kodi informations and versions, returned data from the following
627/// <b><tt>kodi_version_t version; kodi::KodiVersion(version);</tt></b> 669/// <b><tt>kodi_version_t version; kodi::KodiVersion(version);</tt></b>
628/// is e.g.: 670/// is e.g.:
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/CMakeLists.txt
new file mode 100644
index 0000000..ba4f889
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/CMakeLists.txt
@@ -0,0 +1,15 @@
1set(HEADERS AudioDSP.h
2 AudioDecoder.h
3 AudioEncoder.h
4 ImageDecoder.h
5 Inputstream.h
6 Peripheral.h
7 PeripheralUtils.h
8 Screensaver.h
9 VFS.h
10 VideoCodec.h
11 Visualization.h)
12
13if(NOT ENABLE_STATIC_LIBS)
14 core_add_library(addons_kodi-addon-dev-kit_include_kodi_addon-instance)
15endif()
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h
index 8db17c0..08d01ad 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h
@@ -29,9 +29,9 @@
29#include "../StreamCodec.h" 29#include "../StreamCodec.h"
30 30
31#ifdef BUILD_KODI_ADDON 31#ifdef BUILD_KODI_ADDON
32#include "../DVDDemuxPacket.h" 32#include "../DemuxPacket.h"
33#else 33#else
34#include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" 34#include "cores/VideoPlayer/Interface/Addon/DemuxPacket.h"
35#endif 35#endif
36 36
37namespace kodi { namespace addon { class CInstanceInputStream; }} 37namespace kodi { namespace addon { class CInstanceInputStream; }}
@@ -41,7 +41,7 @@ extern "C" {
41 /*! 41 /*!
42 * @brief InputStream add-on capabilities. All capabilities are set to "false" as default. 42 * @brief InputStream add-on capabilities. All capabilities are set to "false" as default.
43 */ 43 */
44 typedef struct INPUTSTREAM_CAPABILITIES 44 struct INPUTSTREAM_CAPABILITIES
45 { 45 {
46 enum MASKTYPE: uint32_t 46 enum MASKTYPE: uint32_t
47 { 47 {
@@ -58,17 +58,20 @@ extern "C" {
58 SUPPORTS_SEEK = (1 << 3), 58 SUPPORTS_SEEK = (1 << 3),
59 59
60 /// supports pause 60 /// supports pause
61 SUPPORTS_PAUSE = (1 << 4) 61 SUPPORTS_PAUSE = (1 << 4),
62
63 /// supports interface ITime
64 SUPPORTS_ITIME = (1 << 5)
62 }; 65 };
63 66
64 /// set of supported capabilities 67 /// set of supported capabilities
65 uint32_t m_mask; 68 uint32_t m_mask;
66 } INPUTSTREAM_CAPABILITIES; 69 };
67 70
68 /*! 71 /*!
69 * @brief structure of key/value pairs passed to addon on Open() 72 * @brief structure of key/value pairs passed to addon on Open()
70 */ 73 */
71 typedef struct INPUTSTREAM 74 struct INPUTSTREAM
72 { 75 {
73 static const unsigned int MAX_INFO_COUNT = 8; 76 static const unsigned int MAX_INFO_COUNT = 8;
74 77
@@ -83,22 +86,22 @@ extern "C" {
83 86
84 const char *m_libFolder; 87 const char *m_libFolder;
85 const char *m_profileFolder; 88 const char *m_profileFolder;
86 } INPUTSTREAM; 89 };
87 90
88 /*! 91 /*!
89 * @brief Array of stream IDs 92 * @brief Array of stream IDs
90 */ 93 */
91 typedef struct INPUTSTREAM_IDS 94 struct INPUTSTREAM_IDS
92 { 95 {
93 static const unsigned int MAX_STREAM_COUNT = 32; 96 static const unsigned int MAX_STREAM_COUNT = 32;
94 unsigned int m_streamCount; 97 unsigned int m_streamCount;
95 unsigned int m_streamIds[MAX_STREAM_COUNT]; 98 unsigned int m_streamIds[MAX_STREAM_COUNT];
96 } INPUTSTREAM_IDS; 99 };
97 100
98 /*! 101 /*!
99 * @brief stream properties 102 * @brief stream properties
100 */ 103 */
101 typedef struct INPUTSTREAM_INFO 104 struct INPUTSTREAM_INFO
102 { 105 {
103 enum STREAM_TYPE 106 enum STREAM_TYPE
104 { 107 {
@@ -130,6 +133,7 @@ extern "C" {
130 }; 133 };
131 uint32_t m_flags; 134 uint32_t m_flags;
132 135
136 char m_name[256]; /*!< @brief (optinal) name of the stream, \0 for default handling */
133 char m_codecName[32]; /*!< @brief (required) name of codec according to ffmpeg */ 137 char m_codecName[32]; /*!< @brief (required) name of codec according to ffmpeg */
134 char m_codecInternalName[32]; /*!< @brief (optional) internal name of codec (selectionstream info) */ 138 char m_codecInternalName[32]; /*!< @brief (optional) internal name of codec (selectionstream info) */
135 STREAMCODEC_PROFILE m_codecProfile; /*!< @brief (optional) the profile of the codec */ 139 STREAMCODEC_PROFILE m_codecProfile; /*!< @brief (optional) the profile of the codec */
@@ -153,7 +157,15 @@ extern "C" {
153 unsigned int m_BlockAlign; 157 unsigned int m_BlockAlign;
154 158
155 CRYPTO_INFO m_cryptoInfo; 159 CRYPTO_INFO m_cryptoInfo;
156 } INPUTSTREAM_INFO; 160 };
161
162 struct INPUTSTREAM_TIMES
163 {
164 time_t startTime;
165 double ptsStart;
166 double ptsBegin;
167 double ptsEnd;
168 };
157 169
158 /*! 170 /*!
159 * @brief Structure to transfer the methods from xbmc_inputstream_dll.h to XBMC 171 * @brief Structure to transfer the methods from xbmc_inputstream_dll.h to XBMC
@@ -201,6 +213,9 @@ extern "C" {
201 int (__cdecl* get_total_time)(const AddonInstance_InputStream* instance); 213 int (__cdecl* get_total_time)(const AddonInstance_InputStream* instance);
202 int (__cdecl* get_time)(const AddonInstance_InputStream* instance); 214 int (__cdecl* get_time)(const AddonInstance_InputStream* instance);
203 215
216 // ITime
217 bool(__cdecl* get_times)(const AddonInstance_InputStream* instance, INPUTSTREAM_TIMES *times);
218
204 // IPosTime 219 // IPosTime
205 bool (__cdecl* pos_time)(const AddonInstance_InputStream* instance, int ms); 220 bool (__cdecl* pos_time)(const AddonInstance_InputStream* instance, int ms);
206 221
@@ -364,6 +379,12 @@ namespace addon
364 virtual int GetTime() { return -1; } 379 virtual int GetTime() { return -1; }
365 380
366 /*! 381 /*!
382 * Get current timing values in PTS scale
383 * @remarks
384 */
385 virtual bool GetTimes(INPUTSTREAM_TIMES &times) { return false; }
386
387 /*!
367 * Positions inputstream to playing time given in ms 388 * Positions inputstream to playing time given in ms
368 * @remarks 389 * @remarks
369 */ 390 */
@@ -483,6 +504,8 @@ namespace addon
483 m_instanceData->toAddon.get_total_time = ADDON_GetTotalTime; 504 m_instanceData->toAddon.get_total_time = ADDON_GetTotalTime;
484 m_instanceData->toAddon.get_time = ADDON_GetTime; 505 m_instanceData->toAddon.get_time = ADDON_GetTime;
485 506
507 m_instanceData->toAddon.get_times = ADDON_GetTimes;
508
486 m_instanceData->toAddon.pos_time = ADDON_PosTime; 509 m_instanceData->toAddon.pos_time = ADDON_PosTime;
487 510
488 m_instanceData->toAddon.can_pause_stream = ADDON_CanPauseStream; 511 m_instanceData->toAddon.can_pause_stream = ADDON_CanPauseStream;
@@ -580,6 +603,11 @@ namespace addon
580 return instance->toAddon.addonInstance->GetTime(); 603 return instance->toAddon.addonInstance->GetTime();
581 } 604 }
582 605
606 // ITime
607 inline static bool ADDON_GetTimes(const AddonInstance_InputStream* instance, INPUTSTREAM_TIMES *times)
608 {
609 return instance->toAddon.addonInstance->GetTimes(*times);
610 }
583 611
584 // IPosTime 612 // IPosTime
585 inline static bool ADDON_PosTime(const AddonInstance_InputStream* instance, int ms) 613 inline static bool ADDON_PosTime(const AddonInstance_InputStream* instance, int ms)
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h
index c1a18e0..0dae06c 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h
@@ -212,6 +212,8 @@ extern "C"
212 JOYSTICK_FEATURE_TYPE_MOTOR, 212 JOYSTICK_FEATURE_TYPE_MOTOR,
213 JOYSTICK_FEATURE_TYPE_RELPOINTER, 213 JOYSTICK_FEATURE_TYPE_RELPOINTER,
214 JOYSTICK_FEATURE_TYPE_ABSPOINTER, 214 JOYSTICK_FEATURE_TYPE_ABSPOINTER,
215 JOYSTICK_FEATURE_TYPE_WHEEL,
216 JOYSTICK_FEATURE_TYPE_THROTTLE,
215 } JOYSTICK_FEATURE_TYPE; 217 } JOYSTICK_FEATURE_TYPE;
216 218
217 typedef enum JOYSTICK_FEATURE_PRIMITIVE 219 typedef enum JOYSTICK_FEATURE_PRIMITIVE
@@ -233,6 +235,14 @@ extern "C"
233 // Motor 235 // Motor
234 JOYSTICK_MOTOR_PRIMITIVE = 0, 236 JOYSTICK_MOTOR_PRIMITIVE = 0,
235 237
238 // Wheel
239 JOYSTICK_WHEEL_LEFT = 0,
240 JOYSTICK_WHEEL_RIGHT = 1,
241
242 // Throttle
243 JOYSTICK_THROTTLE_UP = 0,
244 JOYSTICK_THROTTLE_DOWN = 1,
245
236 // Maximum number of primitives 246 // Maximum number of primitives
237 JOYSTICK_PRIMITIVE_MAX = 4, 247 JOYSTICK_PRIMITIVE_MAX = 4,
238 } JOYSTICK_FEATURE_PRIMITIVE; 248 } JOYSTICK_FEATURE_PRIMITIVE;
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h
index ea70b30..3c4cab3 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h
@@ -581,6 +581,9 @@ namespace addon
581 * 3) accelerometer 581 * 3) accelerometer
582 * 4) motor 582 * 4) motor
583 * 5) relative pointer[2] 583 * 5) relative pointer[2]
584 * 6) absolute pointer
585 * 7) wheel
586 * 8) throttle
584 * 587 *
585 * [1] All three driver primitives (buttons, hats and axes) have a state that 588 * [1] All three driver primitives (buttons, hats and axes) have a state that
586 * can be represented using a single scalar value. For this reason, 589 * can be represented using a single scalar value. For this reason,
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h
index 02d39c6..eb4351e 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h
@@ -25,9 +25,9 @@
25#include "../StreamCodec.h" 25#include "../StreamCodec.h"
26 26
27#ifdef BUILD_KODI_ADDON 27#ifdef BUILD_KODI_ADDON
28#include "../DVDDemuxPacket.h" 28#include "../DemuxPacket.h"
29#else 29#else
30#include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" 30#include "cores/VideoPlayer/Interface/Addon/DemuxPacket.h"
31#endif 31#endif
32 32
33namespace kodi { namespace addon { class CInstanceVideoCodec; } } 33namespace kodi { namespace addon { class CInstanceVideoCodec; } }
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/CMakeLists.txt
new file mode 100644
index 0000000..91cef7f
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/CMakeLists.txt
@@ -0,0 +1,8 @@
1set(HEADERS General.h
2 ListItem.h
3 Window.h
4 definitions.h)
5
6if(NOT ENABLE_STATIC_LIBS)
7 core_add_library(addons_kodi-addon-dev-kit_include_kodi_gui)
8endif()
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/CMakeLists.txt
new file mode 100644
index 0000000..c7cc1dd
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/CMakeLists.txt
@@ -0,0 +1,16 @@
1set(HEADERS Button.h
2 Edit.h
3 FadeLabel.h
4 Image.h
5 Label.h
6 Progress.h
7 RadioButton.h
8 Rendering.h
9 SettingsSlider.h
10 Slider.h
11 Spin.h
12 TextBox.h)
13
14if(NOT ENABLE_STATIC_LIBS)
15 core_add_library(addons_kodi-addon-dev-kit_include_kodi_gui_controls)
16endif()
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/CMakeLists.txt
new file mode 100644
index 0000000..7227343
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs/CMakeLists.txt
@@ -0,0 +1,14 @@
1set(HEADERS ContextMenu.h
2 ExtendedProgress.h
3 FileBrowser.h
4 Keyboard.h
5 Numeric.h
6 OK.h
7 Progress.h
8 Select.h
9 TextViewer.h
10 YesNo.h)
11
12if(NOT ENABLE_STATIC_LIBS)
13 core_add_library(addons_kodi-addon-dev-kit_include_kodi_gui_dialogs)
14endif()
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h
index da02f6f..d4568e7 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h
@@ -170,6 +170,7 @@ typedef enum GAME_INPUT_EVENT_SOURCE
170{ 170{
171 GAME_INPUT_EVENT_DIGITAL_BUTTON, 171 GAME_INPUT_EVENT_DIGITAL_BUTTON,
172 GAME_INPUT_EVENT_ANALOG_BUTTON, 172 GAME_INPUT_EVENT_ANALOG_BUTTON,
173 GAME_INPUT_EVENT_AXIS,
173 GAME_INPUT_EVENT_ANALOG_STICK, 174 GAME_INPUT_EVENT_ANALOG_STICK,
174 GAME_INPUT_EVENT_ACCELEROMETER, 175 GAME_INPUT_EVENT_ACCELEROMETER,
175 GAME_INPUT_EVENT_KEY, 176 GAME_INPUT_EVENT_KEY,
@@ -299,6 +300,11 @@ typedef struct game_analog_button_event
299 float magnitude; 300 float magnitude;
300} ATTRIBUTE_PACKED game_analog_button_event; 301} ATTRIBUTE_PACKED game_analog_button_event;
301 302
303typedef struct game_axis_event
304{
305 float position;
306} ATTRIBUTE_PACKED game_axis_event;
307
302typedef struct game_analog_stick_event 308typedef struct game_analog_stick_event
303{ 309{
304 float x; 310 float x;
@@ -347,6 +353,7 @@ typedef struct game_input_event
347 { 353 {
348 struct game_digital_button_event digital_button; 354 struct game_digital_button_event digital_button;
349 struct game_analog_button_event analog_button; 355 struct game_analog_button_event analog_button;
356 struct game_axis_event axis;
350 struct game_analog_stick_event analog_stick; 357 struct game_analog_stick_event analog_stick;
351 struct game_accelerometer_event accelerometer; 358 struct game_accelerometer_event accelerometer;
352 struct game_key_event key; 359 struct game_key_event key;
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
index c264578..5ef6bdc 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
@@ -139,6 +139,7 @@ typedef struct CB_AddOn
139 char* (*GetLocalizedString)(const void* addonData, long dwCode); 139 char* (*GetLocalizedString)(const void* addonData, long dwCode);
140 char* (*GetDVDMenuLanguage)(const void* addonData); 140 char* (*GetDVDMenuLanguage)(const void* addonData);
141 void (*FreeString)(const void* addonData, char* str); 141 void (*FreeString)(const void* addonData, char* str);
142 void (*FreeStringArray)(const void* addonData, char** arr, int numElements);
142 143
143 void* (*OpenFile)(const void* addonData, const char* strFileName, unsigned int flags); 144 void* (*OpenFile)(const void* addonData, const char* strFileName, unsigned int flags);
144 void* (*OpenFileForWrite)(const void* addonData, const char* strFileName, bool bOverWrite); 145 void* (*OpenFileForWrite)(const void* addonData, const char* strFileName, bool bOverWrite);
@@ -155,7 +156,8 @@ typedef struct CB_AddOn
155 int (*GetFileChunkSize)(const void* addonData, void* file); 156 int (*GetFileChunkSize)(const void* addonData, void* file);
156 bool (*FileExists)(const void* addonData, const char *strFileName, bool bUseCache); 157 bool (*FileExists)(const void* addonData, const char *strFileName, bool bUseCache);
157 int (*StatFile)(const void* addonData, const char *strFileName, struct __stat64* buffer); 158 int (*StatFile)(const void* addonData, const char *strFileName, struct __stat64* buffer);
158 char *(*GetFileProperty)(const void* addonData, void* file, XFILE::FileProperty type, const char *name); 159 char *(*GetFilePropertyValue)(const void* addonData, void* file, XFILE::FileProperty type, const char *name);
160 char **(*GetFilePropertyValues)(const void* addonData, void* file, XFILE::FileProperty type, const char *name, int *numPorperties);
159 bool (*DeleteFile)(const void* addonData, const char *strFileName); 161 bool (*DeleteFile)(const void* addonData, const char *strFileName);
160 bool (*CanOpenDirectory)(const void* addonData, const char* strURL); 162 bool (*CanOpenDirectory)(const void* addonData, const char* strURL);
161 bool (*CreateDirectory)(const void* addonData, const char *strPath); 163 bool (*CreateDirectory)(const void* addonData, const char *strPath);
@@ -299,6 +301,16 @@ namespace ADDON
299 { 301 {
300 m_Callbacks->FreeString(m_Handle->addonData, str); 302 m_Callbacks->FreeString(m_Handle->addonData, str);
301 } 303 }
304
305 /*!
306 * @brief Free the memory used by arr including its elements
307 * @param arr The string array to free
308 * @param numElements The length of the array
309 */
310 void FreeStringArray(char** arr, int numElements)
311 {
312 m_Callbacks->FreeStringArray(m_Handle->addonData, arr, numElements);
313 }
302 314
303 /*! 315 /*!
304 * @brief Open the file with filename via XBMC's CFile. Needs to be closed by calling CloseFile() when done. 316 * @brief Open the file with filename via XBMC's CFile. Needs to be closed by calling CloseFile() when done.
@@ -468,13 +480,26 @@ namespace ADDON
468 /*! 480 /*!
469 * @brief Get a property from an open file. 481 * @brief Get a property from an open file.
470 * @param file The file to get an property for 482 * @param file The file to get an property for
471 * @param type type of the requested property. 483 * @param type Type of the requested property.
472 * @param name of the requested property / can be null. 484 * @param name Name of the requested property / can be null.
473 * @return The value of the requested property, must be FreeString'ed. 485 * @return The value of the requested property, must be FreeString'ed.
474 */ 486 */
475 char *GetFileProperty(void* file, XFILE::FileProperty type, const char *name) 487 char *GetFilePropertyValue(void* file, XFILE::FileProperty type, const char *name)
488 {
489 return m_Callbacks->GetFilePropertyValue(m_Handle->addonData, file, type, name);
490 }
491
492 /*!
493 * @brief Get multiple property values from an open file.
494 * @param file The file to get the property values for
495 * @param type Type of the requested property.
496 * @param name Name of the requested property / can be null.
497 * @param numValues Number of property values returned.
498 * @return List of values of the requested property, must be FreeStringArray'ed.
499 */
500 char **GetFilePropertyValues(void* file, XFILE::FileProperty type, const char *name, int *numValues)
476 { 501 {
477 return m_Callbacks->GetFileProperty(m_Handle->addonData, file, type, name); 502 return m_Callbacks->GetFilePropertyValues(m_Handle->addonData, file, type, name, numValues);
478 } 503 }
479 504
480 /*! 505 /*!
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt
new file mode 100644
index 0000000..939585c
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt
@@ -0,0 +1,5 @@
1set(HEADERS DllHelper.h )
2
3if(NOT ENABLE_STATIC_LIBS)
4 core_add_library(addons_kodi-addon-dev-kit_include_kodi_tools)
5endif()
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h
index 32e6b1a..db8508e 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h
@@ -41,8 +41,8 @@
41 * overview. 41 * overview.
42 */ 42 */
43 43
44#define ADDON_GLOBAL_VERSION_MAIN "1.0.11" 44#define ADDON_GLOBAL_VERSION_MAIN "1.0.12"
45#define ADDON_GLOBAL_VERSION_MAIN_MIN "1.0.11" 45#define ADDON_GLOBAL_VERSION_MAIN_MIN "1.0.12"
46#define ADDON_GLOBAL_VERSION_MAIN_XML_ID "kodi.binary.global.main" 46#define ADDON_GLOBAL_VERSION_MAIN_XML_ID "kodi.binary.global.main"
47#define ADDON_GLOBAL_VERSION_MAIN_DEPENDS "AddonBase.h" \ 47#define ADDON_GLOBAL_VERSION_MAIN_DEPENDS "AddonBase.h" \
48 "xbmc_addon_dll.h" \ 48 "xbmc_addon_dll.h" \
@@ -50,7 +50,7 @@
50 "libXBMC_addon.h" \ 50 "libXBMC_addon.h" \
51 "addon-instance/" 51 "addon-instance/"
52 52
53#define ADDON_GLOBAL_VERSION_GENERAL "1.0.2" 53#define ADDON_GLOBAL_VERSION_GENERAL "1.0.3"
54#define ADDON_GLOBAL_VERSION_GENERAL_MIN "1.0.2" 54#define ADDON_GLOBAL_VERSION_GENERAL_MIN "1.0.2"
55#define ADDON_GLOBAL_VERSION_GENERAL_XML_ID "kodi.binary.global.general" 55#define ADDON_GLOBAL_VERSION_GENERAL_XML_ID "kodi.binary.global.general"
56#define ADDON_GLOBAL_VERSION_GENERAL_DEPENDS "General.h" 56#define ADDON_GLOBAL_VERSION_GENERAL_DEPENDS "General.h"
@@ -66,8 +66,8 @@
66#define ADDON_GLOBAL_VERSION_AUDIOENGINE_XML_ID "kodi.binary.global.audioengine" 66#define ADDON_GLOBAL_VERSION_AUDIOENGINE_XML_ID "kodi.binary.global.audioengine"
67#define ADDON_GLOBAL_VERSION_AUDIOENGINE_DEPENDS "AudioEngine.h" 67#define ADDON_GLOBAL_VERSION_AUDIOENGINE_DEPENDS "AudioEngine.h"
68 68
69#define ADDON_GLOBAL_VERSION_FILESYSTEM "1.0.1" 69#define ADDON_GLOBAL_VERSION_FILESYSTEM "1.0.2"
70#define ADDON_GLOBAL_VERSION_FILESYSTEM_MIN "1.0.1" 70#define ADDON_GLOBAL_VERSION_FILESYSTEM_MIN "1.0.2"
71#define ADDON_GLOBAL_VERSION_FILESYSTEM_XML_ID "kodi.binary.global.filesystem" 71#define ADDON_GLOBAL_VERSION_FILESYSTEM_XML_ID "kodi.binary.global.filesystem"
72#define ADDON_GLOBAL_VERSION_FILESYSTEM_DEPENDS "Filesystem.h" 72#define ADDON_GLOBAL_VERSION_FILESYSTEM_DEPENDS "Filesystem.h"
73 73
@@ -91,8 +91,8 @@
91#define ADDON_INSTANCE_VERSION_AUDIOENCODER_XML_ID "kodi.binary.instance.audioencoder" 91#define ADDON_INSTANCE_VERSION_AUDIOENCODER_XML_ID "kodi.binary.instance.audioencoder"
92#define ADDON_INSTANCE_VERSION_AUDIOENCODER_DEPENDS "addon-instance/AudioEncoder.h" 92#define ADDON_INSTANCE_VERSION_AUDIOENCODER_DEPENDS "addon-instance/AudioEncoder.h"
93 93
94#define ADDON_INSTANCE_VERSION_GAME "1.0.32" 94#define ADDON_INSTANCE_VERSION_GAME "1.0.33"
95#define ADDON_INSTANCE_VERSION_GAME_MIN "1.0.32" 95#define ADDON_INSTANCE_VERSION_GAME_MIN "1.0.33"
96#define ADDON_INSTANCE_VERSION_GAME_XML_ID "kodi.binary.instance.game" 96#define ADDON_INSTANCE_VERSION_GAME_XML_ID "kodi.binary.instance.game"
97#define ADDON_INSTANCE_VERSION_GAME_DEPENDS "kodi_game_dll.h" \ 97#define ADDON_INSTANCE_VERSION_GAME_DEPENDS "kodi_game_dll.h" \
98 "kodi_game_types.h" \ 98 "kodi_game_types.h" \
@@ -103,19 +103,19 @@
103#define ADDON_INSTANCE_VERSION_IMAGEDECODER_XML_ID "kodi.binary.instance.imagedecoder" 103#define ADDON_INSTANCE_VERSION_IMAGEDECODER_XML_ID "kodi.binary.instance.imagedecoder"
104#define ADDON_INSTANCE_VERSION_IMAGEDECODER_DEPENDS "addon-instance/ImageDecoder.h" 104#define ADDON_INSTANCE_VERSION_IMAGEDECODER_DEPENDS "addon-instance/ImageDecoder.h"
105 105
106#define ADDON_INSTANCE_VERSION_INPUTSTREAM "2.0.4" 106#define ADDON_INSTANCE_VERSION_INPUTSTREAM "2.0.6"
107#define ADDON_INSTANCE_VERSION_INPUTSTREAM_MIN "2.0.4" 107#define ADDON_INSTANCE_VERSION_INPUTSTREAM_MIN "2.0.6"
108#define ADDON_INSTANCE_VERSION_INPUTSTREAM_XML_ID "kodi.binary.instance.inputstream" 108#define ADDON_INSTANCE_VERSION_INPUTSTREAM_XML_ID "kodi.binary.instance.inputstream"
109#define ADDON_INSTANCE_VERSION_INPUTSTREAM_DEPENDS "addon-instance/Inputstream.h" 109#define ADDON_INSTANCE_VERSION_INPUTSTREAM_DEPENDS "addon-instance/Inputstream.h"
110 110
111#define ADDON_INSTANCE_VERSION_PERIPHERAL "1.3.4" 111#define ADDON_INSTANCE_VERSION_PERIPHERAL "1.3.5"
112#define ADDON_INSTANCE_VERSION_PERIPHERAL_MIN "1.3.4" 112#define ADDON_INSTANCE_VERSION_PERIPHERAL_MIN "1.3.4"
113#define ADDON_INSTANCE_VERSION_PERIPHERAL_XML_ID "kodi.binary.instance.peripheral" 113#define ADDON_INSTANCE_VERSION_PERIPHERAL_XML_ID "kodi.binary.instance.peripheral"
114#define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \ 114#define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \
115 "addon-instance/PeripheralUtils.h" 115 "addon-instance/PeripheralUtils.h"
116 116
117#define ADDON_INSTANCE_VERSION_PVR "5.7.0" 117#define ADDON_INSTANCE_VERSION_PVR "5.8.0"
118#define ADDON_INSTANCE_VERSION_PVR_MIN "5.7.0" 118#define ADDON_INSTANCE_VERSION_PVR_MIN "5.8.0"
119#define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr" 119#define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr"
120#define ADDON_INSTANCE_VERSION_PVR_DEPENDS "xbmc_pvr_dll.h" \ 120#define ADDON_INSTANCE_VERSION_PVR_DEPENDS "xbmc_pvr_dll.h" \
121 "xbmc_pvr_types.h" \ 121 "xbmc_pvr_types.h" \
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h
index 7561ff6..1ba12bd 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h
@@ -61,6 +61,9 @@
61/* Set EPGTAG.iGenreType to EPG_GENRE_USE_STRING to transfer genre strings to XBMC */ 61/* Set EPGTAG.iGenreType to EPG_GENRE_USE_STRING to transfer genre strings to XBMC */
62#define EPG_GENRE_USE_STRING 0x100 62#define EPG_GENRE_USE_STRING 0x100
63 63
64/* Separator to use in strings containing different tokens, for example writers, directors, actors of an event. */
65#define EPG_STRING_TOKEN_SEPARATOR ","
66
64#ifdef __cplusplus 67#ifdef __cplusplus
65extern "C" { 68extern "C" {
66#endif 69#endif
@@ -98,15 +101,15 @@ extern "C" {
98 const char * strPlotOutline; /*!< @brief (optional) plot outline */ 101 const char * strPlotOutline; /*!< @brief (optional) plot outline */
99 const char * strPlot; /*!< @brief (optional) plot */ 102 const char * strPlot; /*!< @brief (optional) plot */
100 const char * strOriginalTitle; /*!< @brief (optional) originaltitle */ 103 const char * strOriginalTitle; /*!< @brief (optional) originaltitle */
101 const char * strCast; /*!< @brief (optional) cast */ 104 const char * strCast; /*!< @brief (optional) cast. Use EPG_STRING_TOKEN_SEPARATOR to separate different persons. */
102 const char * strDirector; /*!< @brief (optional) director */ 105 const char * strDirector; /*!< @brief (optional) director(s). Use EPG_STRING_TOKEN_SEPARATOR to separate different persons. */
103 const char * strWriter; /*!< @brief (optional) writer */ 106 const char * strWriter; /*!< @brief (optional) writer(s). Use EPG_STRING_TOKEN_SEPARATOR to separate different persons. */
104 int iYear; /*!< @brief (optional) year */ 107 int iYear; /*!< @brief (optional) year */
105 const char * strIMDBNumber; /*!< @brief (optional) IMDBNumber */ 108 const char * strIMDBNumber; /*!< @brief (optional) IMDBNumber */
106 const char * strIconPath; /*!< @brief (optional) icon path */ 109 const char * strIconPath; /*!< @brief (optional) icon path */
107 int iGenreType; /*!< @brief (optional) genre type */ 110 int iGenreType; /*!< @brief (optional) genre type */
108 int iGenreSubType; /*!< @brief (optional) genre sub type */ 111 int iGenreSubType; /*!< @brief (optional) genre sub type */
109 const char * strGenreDescription; /*!< @brief (optional) genre. Will be used only when iGenreType = EPG_GENRE_USE_STRING */ 112 const char * strGenreDescription; /*!< @brief (optional) genre. Will be used only when iGenreType == EPG_GENRE_USE_STRING. Use EPG_STRING_TOKEN_SEPARATOR to separate different genres. */
110 time_t firstAired; /*!< @brief (optional) first aired in UTC */ 113 time_t firstAired; /*!< @brief (optional) first aired in UTC */
111 int iParentalRating; /*!< @brief (optional) parental rating */ 114 int iParentalRating; /*!< @brief (optional) parental rating */
112 int iStarRating; /*!< @brief (optional) star rating */ 115 int iStarRating; /*!< @brief (optional) star rating */
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h
index 019644b..25cacb4 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h
@@ -211,14 +211,6 @@ extern "C"
211 PVR_ERROR RenameChannel(const PVR_CHANNEL& channel); 211 PVR_ERROR RenameChannel(const PVR_CHANNEL& channel);
212 212
213 /*! 213 /*!
214 * Move a channel to another channel number on the backend.
215 * @param channel The channel to move, containing the new channel number.
216 * @return PVR_ERROR_NO_ERROR if the channel has been moved successfully.
217 * @remarks Optional, and only used if bSupportsChannelSettings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
218 */
219 PVR_ERROR MoveChannel(const PVR_CHANNEL& channel);
220
221 /*!
222 * Show the channel settings dialog, if supported by the backend. 214 * Show the channel settings dialog, if supported by the backend.
223 * @param channel The channel to show the dialog for. 215 * @param channel The channel to show the dialog for.
224 * @return PVR_ERROR_NO_ERROR if the dialog has been displayed successfully. 216 * @return PVR_ERROR_NO_ERROR if the dialog has been displayed successfully.
@@ -246,7 +238,7 @@ extern "C"
246 /*! 238 /*!
247 * @return The total amount of recordings on the backend or -1 on error. 239 * @return The total amount of recordings on the backend or -1 on error.
248 * @param deleted if set return deleted recording (called if bSupportsRecordingsUndelete set to true) 240 * @param deleted if set return deleted recording (called if bSupportsRecordingsUndelete set to true)
249 * @remarks Required if bSupportsRecordings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. 241 * @remarks Required if bSupportsRecordings is set to true. Return -1 if this add-on won't provide this function.
250 */ 242 */
251 int GetRecordingsAmount(bool deleted); 243 int GetRecordingsAmount(bool deleted);
252 244
@@ -427,12 +419,6 @@ extern "C"
427 long long SeekLiveStream(long long iPosition, int iWhence = SEEK_SET); 419 long long SeekLiveStream(long long iPosition, int iWhence = SEEK_SET);
428 420
429 /*! 421 /*!
430 * @return The position in the stream that's currently being read.
431 * @remarks Optional, and only used if bHandlesInputStream is set to true. Return -1 if this add-on won't provide this function.
432 */
433 long long PositionLiveStream(void);
434
435 /*!
436 * @return The total length of the stream that's currently being read. 422 * @return The total length of the stream that's currently being read.
437 * @remarks Optional, and only used if bHandlesInputStream is set to true. Return -1 if this add-on won't provide this function. 423 * @remarks Optional, and only used if bHandlesInputStream is set to true. Return -1 if this add-on won't provide this function.
438 */ 424 */
@@ -520,12 +506,6 @@ extern "C"
520 long long SeekRecordedStream(long long iPosition, int iWhence = SEEK_SET); 506 long long SeekRecordedStream(long long iPosition, int iWhence = SEEK_SET);
521 507
522 /*! 508 /*!
523 * @return The position in the stream that's currently being read.
524 * @remarks Optional, and only used if bSupportsRecordings is set to true. Return -1 if this add-on won't provide this function.
525 */
526 long long PositionRecordedStream(void);
527
528 /*!
529 * @return The total length of the stream that's currently being read. 509 * @return The total length of the stream that's currently being read.
530 * @remarks Optional, and only used if bSupportsRecordings is set to true. Return -1 if this add-on won't provide this function. 510 * @remarks Optional, and only used if bSupportsRecordings is set to true. Return -1 if this add-on won't provide this function.
531 */ 511 */
@@ -606,25 +586,6 @@ extern "C"
606 void SetSpeed(int speed); 586 void SetSpeed(int speed);
607 587
608 /*! 588 /*!
609 * Get actual playing time from addon. With timeshift enabled this is
610 * different to live.
611 * @return time as UTC
612 */
613 time_t GetPlayingTime();
614
615 /*!
616 * Get time of oldest packet in timeshift buffer
617 * @return time as UTC
618 */
619 time_t GetBufferTimeStart();
620
621 /*!
622 * Get time of latest packet in timeshift buffer
623 * @return time as UTC
624 */
625 time_t GetBufferTimeEnd();
626
627 /*!
628 * Get the hostname of the pvr backend server 589 * Get the hostname of the pvr backend server
629 * @return hostname as ip address or alias. If backend does not 590 * @return hostname as ip address or alias. If backend does not
630 * utilize a server, return empty string. 591 * utilize a server, return empty string.
@@ -699,7 +660,6 @@ extern "C"
699 pClient->toAddon.GetChannels = GetChannels; 660 pClient->toAddon.GetChannels = GetChannels;
700 pClient->toAddon.DeleteChannel = DeleteChannel; 661 pClient->toAddon.DeleteChannel = DeleteChannel;
701 pClient->toAddon.RenameChannel = RenameChannel; 662 pClient->toAddon.RenameChannel = RenameChannel;
702 pClient->toAddon.MoveChannel = MoveChannel;
703 pClient->toAddon.OpenDialogChannelSettings = OpenDialogChannelSettings; 663 pClient->toAddon.OpenDialogChannelSettings = OpenDialogChannelSettings;
704 pClient->toAddon.OpenDialogChannelAdd = OpenDialogChannelAdd; 664 pClient->toAddon.OpenDialogChannelAdd = OpenDialogChannelAdd;
705 665
@@ -726,7 +686,6 @@ extern "C"
726 pClient->toAddon.CloseLiveStream = CloseLiveStream; 686 pClient->toAddon.CloseLiveStream = CloseLiveStream;
727 pClient->toAddon.ReadLiveStream = ReadLiveStream; 687 pClient->toAddon.ReadLiveStream = ReadLiveStream;
728 pClient->toAddon.SeekLiveStream = SeekLiveStream; 688 pClient->toAddon.SeekLiveStream = SeekLiveStream;
729 pClient->toAddon.PositionLiveStream = PositionLiveStream;
730 pClient->toAddon.LengthLiveStream = LengthLiveStream; 689 pClient->toAddon.LengthLiveStream = LengthLiveStream;
731 pClient->toAddon.SignalStatus = SignalStatus; 690 pClient->toAddon.SignalStatus = SignalStatus;
732 pClient->toAddon.GetDescrambleInfo = GetDescrambleInfo; 691 pClient->toAddon.GetDescrambleInfo = GetDescrambleInfo;
@@ -742,7 +701,6 @@ extern "C"
742 pClient->toAddon.CloseRecordedStream = CloseRecordedStream; 701 pClient->toAddon.CloseRecordedStream = CloseRecordedStream;
743 pClient->toAddon.ReadRecordedStream = ReadRecordedStream; 702 pClient->toAddon.ReadRecordedStream = ReadRecordedStream;
744 pClient->toAddon.SeekRecordedStream = SeekRecordedStream; 703 pClient->toAddon.SeekRecordedStream = SeekRecordedStream;
745 pClient->toAddon.PositionRecordedStream = PositionRecordedStream;
746 pClient->toAddon.LengthRecordedStream = LengthRecordedStream; 704 pClient->toAddon.LengthRecordedStream = LengthRecordedStream;
747 705
748 pClient->toAddon.DemuxReset = DemuxReset; 706 pClient->toAddon.DemuxReset = DemuxReset;
@@ -750,10 +708,6 @@ extern "C"
750 pClient->toAddon.DemuxFlush = DemuxFlush; 708 pClient->toAddon.DemuxFlush = DemuxFlush;
751 pClient->toAddon.DemuxRead = DemuxRead; 709 pClient->toAddon.DemuxRead = DemuxRead;
752 710
753 pClient->toAddon.GetPlayingTime = GetPlayingTime;
754 pClient->toAddon.GetBufferTimeStart = GetBufferTimeStart;
755 pClient->toAddon.GetBufferTimeEnd = GetBufferTimeEnd;
756
757 pClient->toAddon.GetBackendHostname = GetBackendHostname; 711 pClient->toAddon.GetBackendHostname = GetBackendHostname;
758 712
759 pClient->toAddon.IsTimeshifting = IsTimeshifting; 713 pClient->toAddon.IsTimeshifting = IsTimeshifting;
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h
index a7d21ed..623cb03 100644
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h
@@ -40,7 +40,7 @@
40 * and the add-on should set bHandlesDemuxing to true. 40 * and the add-on should set bHandlesDemuxing to true.
41 */ 41 */
42#ifdef USE_DEMUX 42#ifdef USE_DEMUX
43#include "DVDDemuxPacket.h" 43#include "DemuxPacket.h"
44#else 44#else
45struct DemuxPacket; 45struct DemuxPacket;
46#endif 46#endif
@@ -81,6 +81,7 @@ struct DemuxPacket;
81#define PVR_STREAM_MAX_PROPERTIES 20 81#define PVR_STREAM_MAX_PROPERTIES 20
82#define PVR_STREAM_PROPERTY_STREAMURL "streamurl" /*!< @brief the URL of the stream that should be played. */ 82#define PVR_STREAM_PROPERTY_STREAMURL "streamurl" /*!< @brief the URL of the stream that should be played. */
83#define PVR_STREAM_PROPERTY_INPUTSTREAMADDON "inputstreamaddon" /*!< @brief the name of the inputstream add-on that should be used by Kodi to play the stream denoted by PVR_STREAM_PROPERTY_STREAMURL. Leave blank to use Kodi's built-in playing capabilities. */ 83#define PVR_STREAM_PROPERTY_INPUTSTREAMADDON "inputstreamaddon" /*!< @brief the name of the inputstream add-on that should be used by Kodi to play the stream denoted by PVR_STREAM_PROPERTY_STREAMURL. Leave blank to use Kodi's built-in playing capabilities. */
84#define PVR_STREAM_PROPERTY_MIMETYPE "mimetype" /*!< @brief the Mime-Type of the stream that should be played. */
84 85
85/* using the default avformat's MAX_STREAMS value to be safe */ 86/* using the default avformat's MAX_STREAMS value to be safe */
86#define PVR_STREAM_MAX_STREAMS 20 87#define PVR_STREAM_MAX_STREAMS 20
@@ -311,7 +312,7 @@ extern "C" {
311 bool bSupportsTimers; /*!< @brief true if this add-on supports the creation and editing of timers */ 312 bool bSupportsTimers; /*!< @brief true if this add-on supports the creation and editing of timers */
312 bool bSupportsChannelGroups; /*!< @brief true if this add-on supports channel groups */ 313 bool bSupportsChannelGroups; /*!< @brief true if this add-on supports channel groups */
313 bool bSupportsChannelScan; /*!< @brief true if this add-on support scanning for new channels on the backend */ 314 bool bSupportsChannelScan; /*!< @brief true if this add-on support scanning for new channels on the backend */
314 bool bSupportsChannelSettings; /*!< @brief true if this add-on supports the following functions: DeleteChannel, RenameChannel, MoveChannel, DialogChannelSettings and DialogAddChannel */ 315 bool bSupportsChannelSettings; /*!< @brief true if this add-on supports the following functions: DeleteChannel, RenameChannel, DialogChannelSettings and DialogAddChannel */
315 bool bHandlesInputStream; /*!< @brief true if this add-on provides an input stream. false if XBMC handles the stream. */ 316 bool bHandlesInputStream; /*!< @brief true if this add-on provides an input stream. false if XBMC handles the stream. */
316 bool bHandlesDemuxing; /*!< @brief true if this add-on demultiplexes packets. */ 317 bool bHandlesDemuxing; /*!< @brief true if this add-on demultiplexes packets. */
317 bool bSupportsRecordingPlayCount; /*!< @brief true if the backend supports play count for recordings. */ 318 bool bSupportsRecordingPlayCount; /*!< @brief true if the backend supports play count for recordings. */
@@ -423,6 +424,7 @@ extern "C" {
423 char strGroupName[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (required) name of the channel group to add the channel to */ 424 char strGroupName[PVR_ADDON_NAME_STRING_LENGTH]; /*!< @brief (required) name of the channel group to add the channel to */
424 unsigned int iChannelUniqueId; /*!< @brief (required) unique id of the member */ 425 unsigned int iChannelUniqueId; /*!< @brief (required) unique id of the member */
425 unsigned int iChannelNumber; /*!< @brief (optional) channel number within the group */ 426 unsigned int iChannelNumber; /*!< @brief (optional) channel number within the group */
427 unsigned int iSubChannelNumber; /*!< @brief (optional) sub channel number within the group (ATSC) */
426 } ATTRIBUTE_PACKED PVR_CHANNEL_GROUP_MEMBER; 428 } ATTRIBUTE_PACKED PVR_CHANNEL_GROUP_MEMBER;
427 429
428 /*! 430 /*!
@@ -588,14 +590,14 @@ extern "C" {
588 } ATTRIBUTE_PACKED PVR_MENUHOOK_DATA; 590 } ATTRIBUTE_PACKED PVR_MENUHOOK_DATA;
589 591
590 /*! 592 /*!
591 * @brief times of playing stream 593 * @brief times of playing stream (Live TV and recordings)
592 */ 594 */
593 typedef struct PVR_STREAM_TIMES 595 typedef struct PVR_STREAM_TIMES
594 { 596 {
595 time_t startTime; /*!< @brief time (UTC) time elapsed refers to. Ideally start of tv show */ 597 time_t startTime; /*!< @brief For recordings, this must be zero. For Live TV, this is a reference time in units of time_t (UTC) from which time elapsed starts. Ideally start of tv show, but can be any other value. */
596 int64_t ptsStart; /*!< @brief pts of startTime */ 598 int64_t ptsStart; /*!< @brief the pts of startTime */
597 int64_t ptsBegin; /*!< @brief erliest pts player can seek back */ 599 int64_t ptsBegin; /*!< @brief earliest pts player can seek back. Value is seconds, relative to ptsStart. For recordings, this must be zero. For Live TV, this must be zero if not timeshifting and must point to begin of the timeshift buffer, otherwise. */
598 int64_t ptsEnd; /*!< @brief latest pts player can seek forward */ 600 int64_t ptsEnd; /*!< @brief latest pts player can seek forward. Value is seconds, relative to ptsStart. For recordings, this must be the total length in seconds. For Live TV, this must be zero if not timeshifting and must point to end of the timeshift buffer, otherwise. */
599 } ATTRIBUTE_PACKED PVR_STREAM_TIMES; 601 } ATTRIBUTE_PACKED PVR_STREAM_TIMES;
600 602
601 typedef struct AddonToKodiFuncTable_PVR 603 typedef struct AddonToKodiFuncTable_PVR
@@ -676,7 +678,6 @@ extern "C" {
676 void (__cdecl* CloseLiveStream)(void); 678 void (__cdecl* CloseLiveStream)(void);
677 int (__cdecl* ReadLiveStream)(unsigned char*, unsigned int); 679 int (__cdecl* ReadLiveStream)(unsigned char*, unsigned int);
678 long long (__cdecl* SeekLiveStream)(long long, int); 680 long long (__cdecl* SeekLiveStream)(long long, int);
679 long long (__cdecl* PositionLiveStream)(void);
680 long long (__cdecl* LengthLiveStream)(void); 681 long long (__cdecl* LengthLiveStream)(void);
681 PVR_ERROR (__cdecl* SignalStatus)(PVR_SIGNAL_STATUS&); 682 PVR_ERROR (__cdecl* SignalStatus)(PVR_SIGNAL_STATUS&);
682 PVR_ERROR (__cdecl* GetDescrambleInfo)(PVR_DESCRAMBLE_INFO*); 683 PVR_ERROR (__cdecl* GetDescrambleInfo)(PVR_DESCRAMBLE_INFO*);
@@ -686,7 +687,6 @@ extern "C" {
686 void (__cdecl* CloseRecordedStream)(void); 687 void (__cdecl* CloseRecordedStream)(void);
687 int (__cdecl* ReadRecordedStream)(unsigned char*, unsigned int); 688 int (__cdecl* ReadRecordedStream)(unsigned char*, unsigned int);
688 long long (__cdecl* SeekRecordedStream)(long long, int); 689 long long (__cdecl* SeekRecordedStream)(long long, int);
689 long long (__cdecl* PositionRecordedStream)(void);
690 long long (__cdecl* LengthRecordedStream)(void); 690 long long (__cdecl* LengthRecordedStream)(void);
691 void (__cdecl* DemuxReset)(void); 691 void (__cdecl* DemuxReset)(void);
692 void (__cdecl* DemuxAbort)(void); 692 void (__cdecl* DemuxAbort)(void);
@@ -697,9 +697,6 @@ extern "C" {
697 bool (__cdecl* CanSeekStream)(void); 697 bool (__cdecl* CanSeekStream)(void);
698 bool (__cdecl* SeekTime)(double, bool, double*); 698 bool (__cdecl* SeekTime)(double, bool, double*);
699 void (__cdecl* SetSpeed)(int); 699 void (__cdecl* SetSpeed)(int);
700 time_t (__cdecl* GetPlayingTime)(void);
701 time_t (__cdecl* GetBufferTimeStart)(void);
702 time_t (__cdecl* GetBufferTimeEnd)(void);
703 const char* (__cdecl* GetBackendHostname)(void); 700 const char* (__cdecl* GetBackendHostname)(void);
704 bool (__cdecl* IsTimeshifting)(void); 701 bool (__cdecl* IsTimeshifting)(void);
705 bool (__cdecl* IsRealTimeStream)(void); 702 bool (__cdecl* IsRealTimeStream)(void);
diff --git a/xbmc/filesystem/.IFileTypes.h.swp b/xbmc/filesystem/.IFileTypes.h.swp
deleted file mode 100644
index 1880359..0000000
--- a/xbmc/filesystem/.IFileTypes.h.swp
+++ /dev/null
Binary files differ
diff --git a/xbmc/filesystem/IFileTypes.h b/xbmc/filesystem/IFileTypes.h
index d5dd218..a65a178 100644
--- a/xbmc/filesystem/IFileTypes.h
+++ b/xbmc/filesystem/IFileTypes.h
@@ -78,18 +78,37 @@ typedef enum {
78enum CURLOPTIONTYPE 78enum CURLOPTIONTYPE
79{ 79{
80 CURL_OPTION_OPTION, /**< Set a general option */ 80 CURL_OPTION_OPTION, /**< Set a general option */
81 CURL_OPTION_PROTOCOL, /**< Set a protocol option */ 81 CURL_OPTION_PROTOCOL, /**< Set a protocol option (see below) */
82 CURL_OPTION_CREDENTIALS,/**< Set User and password */ 82 CURL_OPTION_CREDENTIALS,/**< Set User and password */
83 CURL_OPTION_HEADER /**< Add a Header */ 83 CURL_OPTION_HEADER /**< Add a Header */
84}; 84};
85 85
86/**
87 * The following names for CURL_OPTION_PROTOCOL are possible:
88 *
89 * accept-charset: Set the "accept-charset" header
90 * acceptencoding or encoding: Set the "accept-encoding" header
91 * active-remote: Set the "active-remote" header
92 * auth: Set the authentication method. Possible values: any, anysafe, digest, ntlm
93 * connection-timeout: Set the connection timeout in seconds
94 * cookie: Set the "cookie" header
95 * customrequest: Set a custom HTTP request like DELETE
96 * noshout: Set to true if kodi detects a stream as shoutcast by mistake.
97 * postdata: Set the post body (value needs to be base64 encoded). (Implicitly sets the request to POST)
98 * referer: Set the "referer" header
99 * user-agent: Set the "user-agent" header
100 * seekable: Set the stream seekable. 1: enable, 0: disable
101 * sslcipherlist: Set list of accepted SSL ciphers.
102 */
103
86enum FileProperty 104enum FileProperty
87{ 105{
88 FILE_PROPERTY_RESPONSE_PROTOCOL, /**< Get response protocol line */ 106 FILE_PROPERTY_RESPONSE_PROTOCOL, /**< Get response protocol line */
89 FILE_PROPERTY_RESPONSE_HEADER, /**< Get response Header value */ 107 FILE_PROPERTY_RESPONSE_HEADER, /**< Get response Header value */
90 FILE_PROPERTY_CONTENT_TYPE, /**< Get file content-type */ 108 FILE_PROPERTY_CONTENT_TYPE, /**< Get file content-type */
91 FILE_PROPERTY_CONTENT_CHARSET, /**< Get file content charset */ 109 FILE_PROPERTY_CONTENT_CHARSET, /**< Get file content charset */
92 FILE_PROPERTY_MIME_TYPE /**< Get file mime type */ 110 FILE_PROPERTY_MIME_TYPE, /**< Get file mime type */
111 FILE_PROPERTY_EFFECTIVE_URL /**< Get effective URL for redirected streams */
93}; 112};
94 113
95} 114}
diff --git a/xbmc/input/ActionIDs.h b/xbmc/input/ActionIDs.h
index b88df78..5db1ffc 100644
--- a/xbmc/input/ActionIDs.h
+++ b/xbmc/input/ActionIDs.h
@@ -80,7 +80,7 @@
80#define ACTION_CALIBRATE_SWAP_ARROWS 47 //!< select next arrow. Can b used in: settingsScreenCalibration.xml windowid=11 80#define ACTION_CALIBRATE_SWAP_ARROWS 47 //!< select next arrow. Can b used in: settingsScreenCalibration.xml windowid=11
81#define ACTION_CALIBRATE_RESET 48 //!< reset calibration to defaults. Can b used in: `settingsScreenCalibration.xml` windowid=11/settingsUICalibration.xml windowid=10 81#define ACTION_CALIBRATE_RESET 48 //!< reset calibration to defaults. Can b used in: `settingsScreenCalibration.xml` windowid=11/settingsUICalibration.xml windowid=10
82#define ACTION_ANALOG_MOVE 49 //!< analog thumbstick move. Can b used in: `slideshow.xml` windowid=2007/settingsScreenCalibration.xml windowid=11/settingsUICalibration.xml windowid=10 82#define ACTION_ANALOG_MOVE 49 //!< analog thumbstick move. Can b used in: `slideshow.xml` windowid=2007/settingsScreenCalibration.xml windowid=11/settingsUICalibration.xml windowid=10
83 //!< @note see also ACTION_ANALOG_MOVE_X, ACTION_ANALOG_MOVE_Y 83 //!< @note see also ACTION_ANALOG_MOVE_X_LEFT, ACTION_ANALOG_MOVE_X_RIGHT, ACTION_ANALOG_MOVE_Y_UP, ACTION_ANALOG_MOVE_Y_DOWN
84#define ACTION_ROTATE_PICTURE_CW 50 //!< rotate current picture clockwise during slideshow. Can be used in slideshow.xml window id=2007 84#define ACTION_ROTATE_PICTURE_CW 50 //!< rotate current picture clockwise during slideshow. Can be used in slideshow.xml window id=2007
85#define ACTION_ROTATE_PICTURE_CCW 51 //!< rotate current picture counterclockwise during slideshow. Can be used in slideshow.xml window id=2007 85#define ACTION_ROTATE_PICTURE_CCW 51 //!< rotate current picture counterclockwise during slideshow. Can be used in slideshow.xml window id=2007
86 86
@@ -102,8 +102,8 @@
102#define REMOTE_8 66 102#define REMOTE_8 66
103#define REMOTE_9 67 103#define REMOTE_9 67
104 104
105#define ACTION_PLAY 68 //!< Unused at the moment
106#define ACTION_PLAYER_PROCESS_INFO 69 //!< show player process info (video decoder, pixel format, pvr signal strength and the like 105#define ACTION_PLAYER_PROCESS_INFO 69 //!< show player process info (video decoder, pixel format, pvr signal strength and the like
106#define ACTION_PLAYER_PROGRAM_SELECT 70
107#define ACTION_SMALL_STEP_BACK 76 //!< jumps a few seconds back during playback of movie. Can b used in videoFullScreen.xml window id=2005 107#define ACTION_SMALL_STEP_BACK 76 //!< jumps a few seconds back during playback of movie. Can b used in videoFullScreen.xml window id=2005
108 108
109#define ACTION_PLAYER_FORWARD 77 //!< FF in current file played. global action, can be used anywhere 109#define ACTION_PLAYER_FORWARD 77 //!< FF in current file played. global action, can be used anywhere
@@ -228,6 +228,7 @@
228#define ACTION_PVR_PLAY_TV 189 228#define ACTION_PVR_PLAY_TV 189
229#define ACTION_PVR_PLAY_RADIO 190 229#define ACTION_PVR_PLAY_RADIO 190
230#define ACTION_PVR_SHOW_TIMER_RULE 191 230#define ACTION_PVR_SHOW_TIMER_RULE 191
231#define ACTION_CHANNEL_NUMBER_SEP 192
231 232
232#define ACTION_TOGGLE_FULLSCREEN 199 //!< switch 2 desktop resolution 233#define ACTION_TOGGLE_FULLSCREEN 199 //!< switch 2 desktop resolution
233#define ACTION_TOGGLE_WATCHED 200 //!< Toggle watched status (videos) 234#define ACTION_TOGGLE_WATCHED 200 //!< Toggle watched status (videos)
@@ -274,6 +275,8 @@
274 275
275#define ACTION_PLAYER_RESET 248 //!< Send a reset command to the active game 276#define ACTION_PLAYER_RESET 248 //!< Send a reset command to the active game
276 277
278#define ACTION_TOGGLE_FONT 249 //!< Toggle font. Used in TextViewer dialog
279
277// Voice actions 280// Voice actions
278#define ACTION_VOICE_RECOGNIZE 300 281#define ACTION_VOICE_RECOGNIZE 300
279 282
@@ -302,8 +305,10 @@
302#define ACTION_GESTURE_END 599 305#define ACTION_GESTURE_END 599
303 306
304// other, non-gesture actions 307// other, non-gesture actions
305#define ACTION_ANALOG_MOVE_X 601 //!< analog thumbstick move, horizontal axis; see ACTION_ANALOG_MOVE 308#define ACTION_ANALOG_MOVE_X_LEFT 601 //!< analog thumbstick move, horizontal axis, left; see ACTION_ANALOG_MOVE
306#define ACTION_ANALOG_MOVE_Y 602 //!< analog thumbstick move, vertical axis; see ACTION_ANALOG_MOVE 309#define ACTION_ANALOG_MOVE_X_RIGHT 602 //!< analog thumbstick move, horizontal axis, right; see ACTION_ANALOG_MOVE
310#define ACTION_ANALOG_MOVE_Y_UP 603 //!< analog thumbstick move, vertical axis, up; see ACTION_ANALOG_MOVE
311#define ACTION_ANALOG_MOVE_Y_DOWN 604 //!< analog thumbstick move, vertical axis, down; see ACTION_ANALOG_MOVE
307//@} 312//@}
308 313
309// The NOOP action can be specified to disable an input event. This is 314// The NOOP action can be specified to disable an input event. This is