summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/KodiConfig.cmake.in4
-rw-r--r--cmake/README.md2
-rw-r--r--cmake/addons/CMakeLists.txt27
-rw-r--r--cmake/addons/README.md2
-rw-r--r--cmake/addons/bootstrap/README.md1
-rw-r--r--cmake/addons/depends/common/kodi-platform/deps.txt2
-rw-r--r--cmake/addons/depends/common/kodi-platform/kodi-platform.txt1
-rw-r--r--cmake/addons/depends/common/p8-platform/p8-platform.txt1
-rw-r--r--cmake/addons/depends/common/tinyxml/CMakeLists.txt22
-rw-r--r--cmake/addons/depends/common/tinyxml/tinyxml.sha2561
-rw-r--r--cmake/addons/depends/common/tinyxml/tinyxml.txt1
-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/cpack/deb/copyright137
-rw-r--r--cmake/cpack/deb/packages/kodi.txt.in2
-rw-r--r--cmake/installdata/common/certificates.txt2
-rw-r--r--cmake/installdata/darwin_embedded/fontconfig.txt (renamed from cmake/installdata/ios/fontconfig.txt)0
-rw-r--r--cmake/installdata/darwin_embedded/packaging.txt (renamed from cmake/installdata/ios/packaging.txt)0
-rw-r--r--cmake/installdata/darwin_embedded/runtime.txt (renamed from cmake/installdata/ios/runtime.txt)0
-rw-r--r--cmake/installdata/test-reference-data.txt8
-rw-r--r--cmake/modules/FindAML.cmake49
-rw-r--r--cmake/modules/FindBluray.cmake4
-rw-r--r--cmake/modules/FindCdio.cmake38
-rw-r--r--cmake/modules/FindClangFormat.cmake11
-rw-r--r--cmake/modules/FindCpluff.cmake51
-rw-r--r--cmake/modules/FindCrossGUID.cmake9
-rw-r--r--cmake/modules/FindDav1d.cmake82
-rw-r--r--cmake/modules/FindEpollShim.cmake27
-rw-r--r--cmake/modules/FindFFMPEG.cmake29
-rw-r--r--cmake/modules/FindFlatBuffers.cmake3
-rw-r--r--cmake/modules/FindFmt.cmake9
-rw-r--r--cmake/modules/FindFriBidi.cmake3
-rw-r--r--cmake/modules/FindGIF.cmake12
-rw-r--r--cmake/modules/FindGtest.cmake84
-rw-r--r--cmake/modules/FindIso9660pp.cmake43
-rw-r--r--cmake/modules/FindLibDRM.cmake15
-rw-r--r--cmake/modules/FindLibDvd.cmake3
-rw-r--r--cmake/modules/FindLibUSB.cmake2
-rw-r--r--cmake/modules/FindMariaDBClient.cmake4
-rw-r--r--cmake/modules/FindNFS.cmake38
-rw-r--r--cmake/modules/FindOpenGLES.cmake2
-rw-r--r--cmake/modules/FindPlist.cmake19
-rw-r--r--cmake/modules/FindPython.cmake10
-rw-r--r--cmake/modules/FindSSE.cmake2
-rw-r--r--cmake/modules/FindSWIG.cmake2
-rw-r--r--cmake/modules/FindShairplay.cmake42
-rw-r--r--cmake/modules/FindSmbClient.cmake3
-rw-r--r--cmake/modules/FindSpdlog.cmake107
-rw-r--r--cmake/modules/FindUdfread.cmake78
-rw-r--r--cmake/platform/android/defines.txt2
-rw-r--r--cmake/platform/darwin_embedded/defines.txt1
-rw-r--r--cmake/platform/darwin_embedded/ios.cmake (renamed from cmake/platform/ios/ios.cmake)1
-rw-r--r--cmake/platform/darwin_embedded/tvos.cmake3
-rw-r--r--cmake/platform/freebsd/defines.txt2
-rw-r--r--cmake/platform/freebsd/gbm.cmake1
-rw-r--r--cmake/platform/ios/defines.txt1
-rw-r--r--cmake/platform/linux/aml.cmake3
-rw-r--r--cmake/platform/linux/defines.txt2
-rw-r--r--cmake/platform/linux/gbm.cmake2
-rw-r--r--cmake/platform/linux/x11.cmake19
-rw-r--r--cmake/platform/osx/defines.txt2
-rw-r--r--cmake/scripts/android/ArchSetup.cmake9
-rw-r--r--cmake/scripts/android/Install.cmake6
-rw-r--r--cmake/scripts/common/AddonHelpers.cmake53
-rw-r--r--cmake/scripts/common/AddonHelpers.dox59
-rw-r--r--cmake/scripts/common/ArchSetup.cmake26
-rw-r--r--cmake/scripts/common/CheckTargetPlatform.cmake5
-rw-r--r--cmake/scripts/common/CompilerSettings.cmake7
-rw-r--r--cmake/scripts/common/GenerateVersionedFiles.cmake3
-rw-r--r--cmake/scripts/common/HandleDepends.cmake20
-rw-r--r--cmake/scripts/common/Macros.cmake72
-rw-r--r--cmake/scripts/common/PrepareEnv.cmake17
-rw-r--r--cmake/scripts/darwin/Macros.cmake8
-rw-r--r--cmake/scripts/darwin_embedded/ArchSetup.cmake (renamed from cmake/scripts/ios/ArchSetup.cmake)50
-rw-r--r--cmake/scripts/darwin_embedded/ExtraTargets.cmake25
-rw-r--r--cmake/scripts/darwin_embedded/Install.cmake135
-rw-r--r--cmake/scripts/darwin_embedded/Macros.cmake118
-rw-r--r--cmake/scripts/darwin_embedded/PathSetup.cmake7
-rw-r--r--cmake/scripts/freebsd/ArchSetup.cmake7
-rw-r--r--cmake/scripts/ios/Install.cmake99
l---------cmake/scripts/ios/Macros.cmake1
l---------cmake/scripts/ios/PathSetup.cmake1
-rw-r--r--cmake/scripts/linux/ArchSetup.cmake40
-rw-r--r--cmake/scripts/osx/ArchSetup.cmake14
-rw-r--r--cmake/scripts/osx/Install.cmake1
-rw-r--r--cmake/scripts/osx/Macros.cmake2
-rw-r--r--cmake/scripts/windows/ArchSetup.cmake11
-rw-r--r--cmake/scripts/windowsstore/ArchSetup.cmake13
-rw-r--r--cmake/scripts/windowsstore/Macros.cmake2
-rw-r--r--cmake/treedata/android/subdirs.txt3
-rw-r--r--cmake/treedata/common/gbm/gbm.txt3
-rw-r--r--cmake/treedata/common/pvr.txt20
-rw-r--r--cmake/treedata/common/rbpi/rbpi.txt2
-rw-r--r--cmake/treedata/common/subdirs.txt13
-rw-r--r--cmake/treedata/common/tests.txt1
-rw-r--r--cmake/treedata/common/videoplayer.txt1
-rw-r--r--cmake/treedata/common/wayland/wayland.txt (renamed from cmake/treedata/optional/common/wayland.txt)6
-rw-r--r--cmake/treedata/common/x11/X.txt (renamed from cmake/treedata/optional/common/X.txt)6
-rw-r--r--cmake/treedata/darwin_embedded/ios/ios.txt2
-rw-r--r--cmake/treedata/darwin_embedded/subdirs.txt (renamed from cmake/treedata/ios/subdirs.txt)9
-rwxr-xr-xcmake/treedata/darwin_embedded/tvos/tvos.txt5
-rw-r--r--cmake/treedata/freebsd/subdirs.txt5
-rw-r--r--cmake/treedata/linux/subdirs.txt2
-rw-r--r--cmake/treedata/linux/tests.txt1
-rw-r--r--cmake/treedata/optional/common/aml.txt2
-rw-r--r--cmake/treedata/optional/common/avahi.txt1
-rw-r--r--cmake/treedata/optional/common/gbm.txt2
-rw-r--r--cmake/treedata/osx/subdirs.txt7
-rw-r--r--cmake/treedata/windows/subdirs.txt1
-rw-r--r--cmake/treedata/windowsstore/subdirs.txt1
113 files changed, 1365 insertions, 689 deletions
diff --git a/cmake/KodiConfig.cmake.in b/cmake/KodiConfig.cmake.in
index 9ec1215..a06d889 100644
--- a/cmake/KodiConfig.cmake.in
+++ b/cmake/KodiConfig.cmake.in
@@ -4,6 +4,7 @@ set(APP_NAME_UC @APP_NAME_UC@)
4set(APP_PACKAGE @APP_PACKAGE@) 4set(APP_PACKAGE @APP_PACKAGE@)
5set(APP_VERSION_MAJOR @APP_VERSION_MAJOR@) 5set(APP_VERSION_MAJOR @APP_VERSION_MAJOR@)
6set(APP_VERSION_MINOR @APP_VERSION_MINOR@) 6set(APP_VERSION_MINOR @APP_VERSION_MINOR@)
7set(APP_VERSION_CODE @APP_VERSION_CODE@)
7if(NOT @APP_NAME_UC@_PREFIX) 8if(NOT @APP_NAME_UC@_PREFIX)
8 set(@APP_NAME_UC@_PREFIX @APP_PREFIX@) 9 set(@APP_NAME_UC@_PREFIX @APP_PREFIX@)
9endif() 10endif()
@@ -17,9 +18,6 @@ if(NOT @APP_NAME_UC@_DATA_DIR)
17 set(@APP_NAME_UC@_DATA_DIR @APP_DATA_DIR@) 18 set(@APP_NAME_UC@_DATA_DIR @APP_DATA_DIR@)
18endif() 19endif()
19set(APP_RENDER_SYSTEM @APP_RENDER_SYSTEM@) 20set(APP_RENDER_SYSTEM @APP_RENDER_SYSTEM@)
20if(NOT WIN32)
21 set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@")
22endif()
23list(APPEND CMAKE_MODULE_PATH @APP_LIB_DIR@ @APP_DATA_DIR@/cmake) 21list(APPEND CMAKE_MODULE_PATH @APP_LIB_DIR@ @APP_DATA_DIR@/cmake)
24 22
25string(REPLACE ";" " " ARCH_DEFINES "@ARCH_DEFINES@") 23string(REPLACE ";" " " ARCH_DEFINES "@ARCH_DEFINES@")
diff --git a/cmake/README.md b/cmake/README.md
index 2febe48..9fd5d1b 100644
--- a/cmake/README.md
+++ b/cmake/README.md
@@ -5,7 +5,7 @@ Welcome to Kodi's CMake Based Build System. CMake is a cross-platform tool for g
5 5
6* Linux (several distros) 6* Linux (several distros)
7* Windows 7* Windows
8* macOS and iOS 8* macOS, iOS and tvOS
9* Android 9* Android
10* FreeBSD 10* FreeBSD
11 11
diff --git a/cmake/addons/CMakeLists.txt b/cmake/addons/CMakeLists.txt
index 5fc798b..3dccc01 100644
--- a/cmake/addons/CMakeLists.txt
+++ b/cmake/addons/CMakeLists.txt
@@ -80,6 +80,8 @@ if (CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
80 -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}) 80 -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION})
81endif() 81endif()
82 82
83include(${CORE_SOURCE_DIR}/cmake/scripts/common/CompilerSettings.cmake)
84
83set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} 85set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
84 -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> 86 -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
85 -DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig 87 -DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig
@@ -121,6 +123,17 @@ if(CMAKE_TOOLCHAIN_FILE)
121 message(STATUS ${BUILD_ARGS}) 123 message(STATUS ${BUILD_ARGS})
122endif() 124endif()
123 125
126# used for addons where need special folders to store there content (if
127# not set the addon define it byself).
128# e.g. Google Chromium addon where his git bring:
129# - "unable to create file" ... "Filename too long"
130# see also WARNING by Windows on: https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart
131if(THIRD_PARTY_PATH)
132 message(STATUS "Third party lib path specified")
133 message(STATUS ${THIRD_PARTY_PATH})
134 list(APPEND BUILD_ARGS -DTHIRD_PARTY_PATH=${THIRD_PARTY_PATH})
135endif()
136
124if(NOT ADDONS_TO_BUILD) 137if(NOT ADDONS_TO_BUILD)
125 set(ADDONS_TO_BUILD "all") 138 set(ADDONS_TO_BUILD "all")
126else() 139else()
@@ -243,9 +256,14 @@ foreach(addon ${addons})
243 if(idx GREATER -1 OR "${ADDONS_TO_BUILD}" STREQUAL "all") 256 if(idx GREATER -1 OR "${ADDONS_TO_BUILD}" STREQUAL "all")
244 set(ADDON_FOUND TRUE) 257 set(ADDON_FOUND TRUE)
245 # Maybe we have a regex 258 # Maybe we have a regex
246 elseif(id MATCHES "${ADDONS_TO_BUILD}") 259 else()
247 message(STATUS "Pattern ${ADDONS_TO_BUILD} matches ${id}, building addon") 260 foreach(ADDONLISTITEM ${ADDONS_TO_BUILD})
248 set(ADDON_FOUND TRUE) 261 if(id MATCHES "${ADDONLISTITEM}")
262 message(STATUS "Pattern ${ADDONLISTITEM} matches ${id}, building addon")
263 set(ADDON_FOUND TRUE)
264 break()
265 endif()
266 endforeach()
249 endif() 267 endif()
250 268
251 if(ADDON_FOUND) 269 if(ADDON_FOUND)
@@ -376,9 +394,6 @@ foreach(addon ${addons})
376 DEPENDERS build 394 DEPENDERS build
377 ALWAYS 1) 395 ALWAYS 1)
378 396
379 # add "kodi-platform" as a dependency to every addon
380 add_dependencies(${id} kodi-platform)
381
382 set(${id}_DEPENDS_DIR ${SOURCE_DIR}/depends) 397 set(${id}_DEPENDS_DIR ${SOURCE_DIR}/depends)
383 398
384 if(EXISTS ${${id}_DEPENDS_DIR}) 399 if(EXISTS ${${id}_DEPENDS_DIR})
diff --git a/cmake/addons/README.md b/cmake/addons/README.md
index dd222f5..17e6460 100644
--- a/cmake/addons/README.md
+++ b/cmake/addons/README.md
@@ -1,4 +1,4 @@
1![Kodi logo](https://raw.githubusercontent.com/xbmc/xbmc-forum/master/xbmc/images/logo-sbs-black.png) 1![Kodi logo](https://github.com/xbmc/xbmc/raw/master/docs/resources/banner_slim.png)
2# Kodi add-ons CMake based buildsystem 2# Kodi add-ons CMake based buildsystem
3This directory contains the cmake-based buildsystem for Kodi add-ons. It looks into the directory pointed to by the *ADDONS_DEFINITION_DIR* option (which defaults to the *addons* sub-directory) and parses all *.txt files recursively. Each add-on must have its own `<addon-id>.txt` file in a separate sub-directory that must follow one of the defined formats: 3This directory contains the cmake-based buildsystem for Kodi add-ons. It looks into the directory pointed to by the *ADDONS_DEFINITION_DIR* option (which defaults to the *addons* sub-directory) and parses all *.txt files recursively. Each add-on must have its own `<addon-id>.txt` file in a separate sub-directory that must follow one of the defined formats:
4 4
diff --git a/cmake/addons/bootstrap/README.md b/cmake/addons/bootstrap/README.md
index b886b5b..52ded74 100644
--- a/cmake/addons/bootstrap/README.md
+++ b/cmake/addons/bootstrap/README.md
@@ -1,3 +1,4 @@
1![Kodi logo](https://github.com/xbmc/xbmc/raw/master/docs/resources/banner_slim.png)
1# KODI ADDON DEFINITIONS BOOTSTRAPPING 2# KODI ADDON DEFINITIONS BOOTSTRAPPING
2This directory contains the cmake-based buildsystem for addon definitions 3This directory contains the cmake-based buildsystem for addon definitions
3bootstrapping which downloads the addon definitions from one or more addon 4bootstrapping which downloads the addon definitions from one or more addon
diff --git a/cmake/addons/depends/common/kodi-platform/deps.txt b/cmake/addons/depends/common/kodi-platform/deps.txt
deleted file mode 100644
index b953815..0000000
--- a/cmake/addons/depends/common/kodi-platform/deps.txt
+++ /dev/null
@@ -1,2 +0,0 @@
1tinyxml
2p8-platform
diff --git a/cmake/addons/depends/common/kodi-platform/kodi-platform.txt b/cmake/addons/depends/common/kodi-platform/kodi-platform.txt
deleted file mode 100644
index c553769..0000000
--- a/cmake/addons/depends/common/kodi-platform/kodi-platform.txt
+++ /dev/null
@@ -1 +0,0 @@
1kodi-platform https://github.com/xbmc/kodi-platform e8574b883ffa2131f2eeb96ff3724d60b21130f7
diff --git a/cmake/addons/depends/common/p8-platform/p8-platform.txt b/cmake/addons/depends/common/p8-platform/p8-platform.txt
deleted file mode 100644
index ae7a370..0000000
--- a/cmake/addons/depends/common/p8-platform/p8-platform.txt
+++ /dev/null
@@ -1 +0,0 @@
1p8-platform https://github.com/xbmc/platform.git 32190045c7eb6883c0662db2f91b4ceeab904fc2
diff --git a/cmake/addons/depends/common/tinyxml/CMakeLists.txt b/cmake/addons/depends/common/tinyxml/CMakeLists.txt
deleted file mode 100644
index ec396ee..0000000
--- a/cmake/addons/depends/common/tinyxml/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
1cmake_minimum_required(VERSION 3.1)
2project(tinyxml)
3
4set(SOURCES src/tinystr.cpp
5 src/tinyxml.cpp
6 src/tinyxmlerror.cpp
7 src/tinyxmlparser.cpp)
8
9if(WIN32)
10 add_definitions(-DWIN32 -D_LIB)
11endif()
12add_definitions(-DTIXML_USE_STL)
13
14add_library(tinyxml ${SOURCES})
15
16include_directories(${PROJECT_SOURCE_DIR}/include)
17
18set(HEADERS ${PROJECT_SOURCE_DIR}/include/tinystr.h
19 ${PROJECT_SOURCE_DIR}/include/tinyxml.h)
20
21install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
22install(TARGETS tinyxml DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
diff --git a/cmake/addons/depends/common/tinyxml/tinyxml.sha256 b/cmake/addons/depends/common/tinyxml/tinyxml.sha256
deleted file mode 100644
index 78c07c8..0000000
--- a/cmake/addons/depends/common/tinyxml/tinyxml.sha256
+++ /dev/null
@@ -1 +0,0 @@
18164c9ad48b9028667768a584d62f7760cfbfb90d0dd6214ad174403058da10c
diff --git a/cmake/addons/depends/common/tinyxml/tinyxml.txt b/cmake/addons/depends/common/tinyxml/tinyxml.txt
deleted file mode 100644
index f8e05e8..0000000
--- a/cmake/addons/depends/common/tinyxml/tinyxml.txt
+++ /dev/null
@@ -1 +0,0 @@
1tinyxml http://mirrors.kodi.tv/build-deps/sources/tinyxml-2.6.2_2.tar.gz
diff --git a/cmake/addons/depends/windowsstore/CMakeLists.txt b/cmake/addons/depends/windowsstore/CMakeLists.txt
deleted file mode 100644
index c8739c0..0000000
--- a/cmake/addons/depends/windowsstore/CMakeLists.txt
+++ /dev/null
@@ -1,52 +0,0 @@
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
deleted file mode 100644
index 9a3adbb..0000000
--- a/cmake/addons/depends/windowsstore/Install.cmake
+++ /dev/null
@@ -1,24 +0,0 @@
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
deleted file mode 100644
index 67dc594..0000000
--- a/cmake/addons/depends/windowsstore/README
+++ /dev/null
@@ -1,19 +0,0 @@
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
deleted file mode 100644
index db6f782..0000000
--- a/cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt
+++ /dev/null
@@ -1 +0,0 @@
1p8-platform https://github.com/afedchin/platform.git win10
diff --git a/cmake/addons/depends/windowsstore/prebuilt/README b/cmake/addons/depends/windowsstore/prebuilt/README
deleted file mode 100644
index a0c70d6..0000000
--- a/cmake/addons/depends/windowsstore/prebuilt/README
+++ /dev/null
@@ -1,21 +0,0 @@
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/cpack/deb/copyright b/cmake/cpack/deb/copyright
index 3033afd..3a3916c 100644
--- a/cmake/cpack/deb/copyright
+++ b/cmake/cpack/deb/copyright
@@ -2362,6 +2362,33 @@ LZO Library - LZO real-time data compression library
2362 You should have received a copy of the GNU General Public License 2362 You should have received a copy of the GNU General Public License
2363 along with this program. If not, see <http://www.gnu.org/licenses/>. 2363 along with this program. If not, see <http://www.gnu.org/licenses/>.
2364 2364
2365dav1d - AV1 cross-platform decoder
2366<https://code.videolan.org/videolan/dav1d>
2367
2368 Copyright © 2018-2019, VideoLAN and dav1d authors
2369 All rights reserved.
2370
2371 Redistribution and use in source and binary forms, with or without
2372 modification, are permitted provided that the following conditions are met:
2373
2374 1. Redistributions of source code must retain the above copyright notice, this
2375 list of conditions and the following disclaimer.
2376
2377 2. Redistributions in binary form must reproduce the above copyright notice,
2378 this list of conditions and the following disclaimer in the documentation
2379 and/or other materials provided with the distribution.
2380
2381 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
2382 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2383 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2384 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
2385 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2386 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2387 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2388 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2389 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2390 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2391
2365Licenses: 2392Licenses:
2366 2393
2367License: GPL 2394License: GPL
@@ -2908,3 +2935,113 @@ We are required to state that
2908 CompuServe Incorporated." 2935 CompuServe Incorporated."
2909 2936
2910-- End of IJG License -- 2937-- End of IJG License --
2938
2939License: Alliance for Open Media Patent License 1.0
2940
29411. License Terms.
2942
29431.1. Patent License. Subject to the terms and conditions of this License, each
2944 Licensor, on behalf of itself and successors in interest and assigns,
2945 grants Licensee a non-sublicensable, perpetual, worldwide, non-exclusive,
2946 no-charge, royalty-free, irrevocable (except as expressly stated in this
2947 License) patent license to its Necessary Claims to make, use, sell, offer
2948 for sale, import or distribute any Implementation.
2949
29501.2. Conditions.
2951
29521.2.1. Availability. As a condition to the grant of rights to Licensee to make,
2953 sell, offer for sale, import or distribute an Implementation under
2954 Section 1.1, Licensee must make its Necessary Claims available under
2955 this License, and must reproduce this License with any Implementation
2956 as follows:
2957
2958 a. For distribution in source code, by including this License in the
2959 root directory of the source code with its Implementation.
2960
2961 b. For distribution in any other form (including binary, object form,
2962 and/or hardware description code (e.g., HDL, RTL, Gate Level Netlist,
2963 GDSII, etc.)), by including this License in the documentation, legal
2964 notices, and/or other written materials provided with the
2965 Implementation.
2966
29671.2.2. Additional Conditions. This license is directly from Licensor to
2968 Licensee. Licensee acknowledges as a condition of benefiting from it
2969 that no rights from Licensor are received from suppliers, distributors,
2970 or otherwise in connection with this License.
2971
29721.3. Defensive Termination. If any Licensee, its Affiliates, or its agents
2973 initiates patent litigation or files, maintains, or voluntarily
2974 participates in a lawsuit against another entity or any person asserting
2975 that any Implementation infringes Necessary Claims, any patent licenses
2976 granted under this License directly to the Licensee are immediately
2977 terminated as of the date of the initiation of action unless 1) that suit
2978 was in response to a corresponding suit regarding an Implementation first
2979 brought against an initiating entity, or 2) that suit was brought to
2980 enforce the terms of this License (including intervention in a third-party
2981 action by a Licensee).
2982
29831.4. Disclaimers. The Reference Implementation and Specification are provided
2984 "AS IS" and without warranty. The entire risk as to implementing or
2985 otherwise using the Reference Implementation or Specification is assumed
2986 by the implementer and user. Licensor expressly disclaims any warranties
2987 (express, implied, or otherwise), including implied warranties of
2988 merchantability, non-infringement, fitness for a particular purpose, or
2989 title, related to the material. IN NO EVENT WILL LICENSOR BE LIABLE TO
2990 ANY OTHER PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL,
2991 INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF
2992 ACTION OF ANY KIND WITH RESPECT TO THIS LICENSE, WHETHER BASED ON BREACH
2993 OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND WHETHER OR
2994 NOT THE OTHER PARTRY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2995
29962. Definitions.
2997
29982.1. Affiliate. “Affiliate” means an entity that directly or indirectly
2999 Controls, is Controlled by, or is under common Control of that party.
3000
30012.2. Control. “Control” means direct or indirect control of more than 50% of
3002 the voting power to elect directors of that corporation, or for any other
3003 entity, the power to direct management of such entity.
3004
30052.3. Decoder. "Decoder" means any decoder that conforms fully with all
3006 non-optional portions of the Specification.
3007
30082.4. Encoder. "Encoder" means any encoder that produces a bitstream that can
3009 be decoded by a Decoder only to the extent it produces such a bitstream.
3010
30112.5. Final Deliverable. “Final Deliverable” means the final version of a
3012 deliverable approved by the Alliance for Open Media as a Final
3013 Deliverable.
3014
30152.6. Implementation. "Implementation" means any implementation, including the
3016 Reference Implementation, that is an Encoder and/or a Decoder. An
3017 Implementation also includes components of an Implementation only to the
3018 extent they are used as part of an Implementation.
3019
30202.7. License. “License” means this license.
3021
30222.8. Licensee. “Licensee” means any person or entity who exercises patent
3023 rights granted under this License.
3024
30252.9. Licensor. "Licensor" means (i) any Licensee that makes, sells, offers
3026 for sale, imports or distributes any Implementation, or (ii) a person
3027 or entity that has a licensing obligation to the Implementation as a
3028 result of its membership and/or participation in the Alliance for Open
3029 Media working group that developed the Specification.
3030
30312.10. Necessary Claims. "Necessary Claims" means all claims of patents or
3032 patent applications, (a) that currently or at any time in the future,
3033 are owned or controlled by the Licensor, and (b) (i) would be an
3034 Essential Claim as defined by the W3C Policy as of February 5, 2004
3035 (https://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential)
3036 as if the Specification was a W3C Recommendation; or (ii) are infringed
3037 by the Reference Implementation.
3038
30392.11. Reference Implementation. “Reference Implementation” means an Encoder
3040 and/or Decoder released by the Alliance for Open Media as a Final
3041 Deliverable.
3042
30432.12. Specification. “Specification” means the specification designated by
3044 the Alliance for Open Media as a Final Deliverable for which this
3045 License was issued.
3046
3047-- End of Alliance for Open Media Patent License 1.0 License -- \ No newline at end of file
diff --git a/cmake/cpack/deb/packages/kodi.txt.in b/cmake/cpack/deb/packages/kodi.txt.in
index 4776622..78df46a 100644
--- a/cmake/cpack/deb/packages/kodi.txt.in
+++ b/cmake/cpack/deb/packages/kodi.txt.in
@@ -15,7 +15,7 @@ PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION video 15PACKAGE_SECTION video
16PACKAGE_PRIORITY optional 16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS 17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl4 | libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging | python-pil, python-simplejson, libass9 | libass5 | libass4, libgif5 | libgif7, libnfs8 | libnfs4 | libnfs1, libbluray1 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1 18PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl4 | libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python3-pil, python3-simplejson, libass9 | libass5 | libass4, libgif5 | libgif7, libnfs8 | libnfs4 | libnfs1, libbluray1 | libbluray2, libshairplay0, libvorbisfile3, libaacs0, libcec4, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1
19PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1 19PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1
20PACKAGE_SUGGESTS @APP_NAME_LC@-pvr-mythtv, @APP_NAME_LC@-pvr-vuplus, @APP_NAME_LC@-pvr-vdr-vnsi, @APP_NAME_LC@-pvr-njoy, @APP_NAME_LC@-pvr-nextpvr, @APP_NAME_LC@-pvr-mediaportal-tvserver, @APP_NAME_LC@-pvr-tvheadend-hts, @APP_NAME_LC@-pvr-dvbviewer, @APP_NAME_LC@-pvr-argustv, @APP_NAME_LC@-pvr-iptvsimple, @APP_NAME_LC@-audioencoder-vorbis, @APP_NAME_LC@-audioencoder-flac, @APP_NAME_LC@-audioencoder-lame 20PACKAGE_SUGGESTS @APP_NAME_LC@-pvr-mythtv, @APP_NAME_LC@-pvr-vuplus, @APP_NAME_LC@-pvr-vdr-vnsi, @APP_NAME_LC@-pvr-njoy, @APP_NAME_LC@-pvr-nextpvr, @APP_NAME_LC@-pvr-mediaportal-tvserver, @APP_NAME_LC@-pvr-tvheadend-hts, @APP_NAME_LC@-pvr-dvbviewer, @APP_NAME_LC@-pvr-argustv, @APP_NAME_LC@-pvr-iptvsimple, @APP_NAME_LC@-audioencoder-vorbis, @APP_NAME_LC@-audioencoder-flac, @APP_NAME_LC@-audioencoder-lame
21PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone 21PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone
diff --git a/cmake/installdata/common/certificates.txt b/cmake/installdata/common/certificates.txt
index 14e74a7..e802c04 100644
--- a/cmake/installdata/common/certificates.txt
+++ b/cmake/installdata/common/certificates.txt
@@ -1 +1 @@
tools/depends/target/openssl/cacert.pem system/certs \ No newline at end of file system/certs/*
diff --git a/cmake/installdata/ios/fontconfig.txt b/cmake/installdata/darwin_embedded/fontconfig.txt
index 1f1bd9d..1f1bd9d 100644
--- a/cmake/installdata/ios/fontconfig.txt
+++ b/cmake/installdata/darwin_embedded/fontconfig.txt
diff --git a/cmake/installdata/ios/packaging.txt b/cmake/installdata/darwin_embedded/packaging.txt
index 3d5ae4a..3d5ae4a 100644
--- a/cmake/installdata/ios/packaging.txt
+++ b/cmake/installdata/darwin_embedded/packaging.txt
diff --git a/cmake/installdata/ios/runtime.txt b/cmake/installdata/darwin_embedded/runtime.txt
index 3bb5467..3bb5467 100644
--- a/cmake/installdata/ios/runtime.txt
+++ b/cmake/installdata/darwin_embedded/runtime.txt
diff --git a/cmake/installdata/test-reference-data.txt b/cmake/installdata/test-reference-data.txt
index b6c94a7..91738ba 100644
--- a/cmake/installdata/test-reference-data.txt
+++ b/cmake/installdata/test-reference-data.txt
@@ -1,10 +1,18 @@
1xbmc/utils/test/CXBMCTinyXML-test.xml 1xbmc/utils/test/CXBMCTinyXML-test.xml
2xbmc/utils/test/data/language/Spanish/strings.po 2xbmc/utils/test/data/language/Spanish/strings.po
3xbmc/filesystem/test/extendedlocalheader.zip
3xbmc/filesystem/test/reffile.txt 4xbmc/filesystem/test/reffile.txt
4xbmc/filesystem/test/reffile.txt.rar 5xbmc/filesystem/test/reffile.txt.rar
5xbmc/filesystem/test/reffile.txt.zip 6xbmc/filesystem/test/reffile.txt.zip
6xbmc/filesystem/test/refRARnormal.rar 7xbmc/filesystem/test/refRARnormal.rar
7xbmc/filesystem/test/refRARstored.rar 8xbmc/filesystem/test/refRARstored.rar
9xbmc/filesystem/test/data/httpdirectory/apache-default.html
10xbmc/filesystem/test/data/httpdirectory/apache-fancy.html
11xbmc/filesystem/test/data/httpdirectory/apache-html.html
12xbmc/filesystem/test/data/httpdirectory/basic.html
13xbmc/filesystem/test/data/httpdirectory/basic-multiline.html
14xbmc/filesystem/test/data/httpdirectory/lighttp-default.html
15xbmc/filesystem/test/data/httpdirectory/nginx-default.html
8xbmc/network/test/data/test.html 16xbmc/network/test/data/test.html
9xbmc/network/test/data/test.png 17xbmc/network/test/data/test.png
10xbmc/network/test/data/test-ranges.txt 18xbmc/network/test/data/test-ranges.txt
diff --git a/cmake/modules/FindAML.cmake b/cmake/modules/FindAML.cmake
deleted file mode 100644
index 89d1fd9..0000000
--- a/cmake/modules/FindAML.cmake
+++ /dev/null
@@ -1,49 +0,0 @@
1#.rst:
2# FindAML
3# -------
4# Finds the AML codec
5#
6# This will define the following variables::
7#
8# AML_FOUND - system has AML
9# AML_INCLUDE_DIRS - the AML include directory
10# AML_DEFINITIONS - the AML definitions
11#
12# and the following imported targets::
13#
14# AML::AML - The AML codec
15
16find_path(AML_INCLUDE_DIR codec_error.h
17 PATH_SUFFIXES amcodec)
18
19include(FindPackageHandleStandardArgs)
20find_package_handle_standard_args(AML
21 REQUIRED_VARS AML_INCLUDE_DIR)
22
23include(CheckCSourceCompiles)
24set(CMAKE_REQUIRED_INCLUDES ${AML_INCLUDE_DIR})
25check_c_source_compiles("#include <amcodec/codec.h>
26
27 int main()
28 {
29 int i = VIDEO_DEC_FORMAT_VP9;
30 return 0;
31 }
32 " AML_HAS_VP9)
33
34if(AML_FOUND)
35 set(AML_INCLUDE_DIRS ${AML_INCLUDE_DIR})
36 set(AML_DEFINITIONS -DHAS_LIBAMCODEC=1)
37 if(AML_HAS_VP9)
38 list(APPEND AML_DEFINITIONS -DHAS_LIBAMCODEC_VP9=1)
39 endif()
40
41 if(NOT TARGET AML::AML)
42 add_library(AML::AML UNKNOWN IMPORTED)
43 set_target_properties(AML::AML PROPERTIES
44 INTERFACE_INCLUDE_DIRECTORIES "${AML_INCLUDE_DIR}"
45 INTERFACE_COMPILE_DEFINITIONS HAS_LIBAMCODEC=1)
46 endif()
47endif()
48
49mark_as_advanced(AMLCODEC_INCLUDE_DIR)
diff --git a/cmake/modules/FindBluray.cmake b/cmake/modules/FindBluray.cmake
index 58a9a91..34bc50e 100644
--- a/cmake/modules/FindBluray.cmake
+++ b/cmake/modules/FindBluray.cmake
@@ -48,6 +48,10 @@ if(BLURAY_FOUND)
48 list(APPEND BLURAY_DEFINITIONS -DHAVE_LIBBLURAY_BDJ=1) 48 list(APPEND BLURAY_DEFINITIONS -DHAVE_LIBBLURAY_BDJ=1)
49 endif() 49 endif()
50 50
51 if(${BLURAY_LIBRARY} MATCHES ".+\.a$" AND PC_BLURAY_STATIC_LIBRARIES)
52 list(APPEND BLURAY_LIBRARIES ${PC_BLURAY_STATIC_LIBRARIES})
53 endif()
54
51 if(NOT TARGET Bluray::Bluray) 55 if(NOT TARGET Bluray::Bluray)
52 add_library(Bluray::Bluray UNKNOWN IMPORTED) 56 add_library(Bluray::Bluray UNKNOWN IMPORTED)
53 if(BLURAY_LIBRARY) 57 if(BLURAY_LIBRARY)
diff --git a/cmake/modules/FindCdio.cmake b/cmake/modules/FindCdio.cmake
index 91ba7bc..465ecc6 100644
--- a/cmake/modules/FindCdio.cmake
+++ b/cmake/modules/FindCdio.cmake
@@ -8,47 +8,27 @@
8# CDIO_FOUND - system has cdio 8# CDIO_FOUND - system has cdio
9# CDIO_INCLUDE_DIRS - the cdio include directory 9# CDIO_INCLUDE_DIRS - the cdio include directory
10# CDIO_LIBRARIES - the cdio libraries 10# CDIO_LIBRARIES - the cdio libraries
11#
12# and the following imported targets::
13#
14# CDIO::CDIO - The cdio library
15 11
16if(PKG_CONFIG_FOUND) 12if(PKG_CONFIG_FOUND)
17 pkg_check_modules(PC_CDIO libcdio>=0.78 libiso9660 QUIET) 13 pkg_check_modules(PC_CDIO libcdio>=0.80 QUIET)
18endif() 14endif()
19 15
20find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h 16find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h
21 PATHS ${PC_CDIO_libcdio_INCLUDEDIR} 17 PATHS ${PC_CDIO_INCLUDEDIR})
22 ${PC_CDIO_libiso9660_INCLUDEDIR})
23find_library(CDIO_LIBRARY NAMES cdio libcdio
24 PATHS ${CDIO_libcdio_LIBDIR} ${CDIO_libiso9660_LIBDIR})
25 18
26if(NOT WIN32) 19find_library(CDIO_LIBRARY NAMES cdio libcdio
27 find_path(ISO9660_INCLUDE_DIR NAMES cdio/iso9660.h 20 PATHS ${PC_CDIO_LIBDIR})
28 PATHS ${PC_CDIO_libcdio_INCLUDEDIR}
29 ${PC_CDIO_libiso9660_INCLUDEDIR})
30 find_library(ISO9660_LIBRARY NAMES iso9660
31 PATHS ${CDIO_libcdio_LIBDIR} ${CDIO_libiso9660_LIBDIR})
32 list(APPEND ISO9660_VARS ISO9660_INCLUDE_DIR ISO9660_LIBRARY)
33endif()
34 21
35set(CDIO_VERSION ${PC_CDIO_libcdio_VERSION}) 22set(CDIO_VERSION ${PC_CDIO_VERSION})
36 23
37include(FindPackageHandleStandardArgs) 24include(FindPackageHandleStandardArgs)
38find_package_handle_standard_args(Cdio 25find_package_handle_standard_args(Cdio
39 REQUIRED_VARS CDIO_LIBRARY CDIO_INCLUDE_DIR ${ISO9660_VARS} 26 REQUIRED_VARS CDIO_LIBRARY CDIO_INCLUDE_DIR
40 VERSION_VAR CDIO_VERSION) 27 VERSION_VAR CDIO_VERSION)
41 28
42if(CDIO_FOUND) 29if(CDIO_FOUND)
43 set(CDIO_LIBRARIES ${CDIO_LIBRARY} ${ISO9660_LIBRARY}) 30 set(CDIO_LIBRARIES ${CDIO_LIBRARY})
44 set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR} ${ISO9660_INCLUDE_DIR}) 31 set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR})
45
46 if(NOT TARGET CDIO::CDIO)
47 add_library(CDIO::CDIO UNKNOWN IMPORTED)
48 set_target_properties(CDIO::CDIO PROPERTIES
49 IMPORTED_LOCATION "${CDIO_LIBRARY}"
50 INTERFACE_INCLUDE_DIRECTORIES "${CDIO_INCLUDE_DIR}")
51 endif()
52endif() 32endif()
53 33
54mark_as_advanced(CDIO_INCLUDE_DIR CDIO_LIBRARY ISO9660_INCLUDE_DIR ISO9660_LIBRARY) 34mark_as_advanced(CDIO_INCLUDE_DIR CDIO_LIBRARY)
diff --git a/cmake/modules/FindClangFormat.cmake b/cmake/modules/FindClangFormat.cmake
new file mode 100644
index 0000000..7220d31
--- /dev/null
+++ b/cmake/modules/FindClangFormat.cmake
@@ -0,0 +1,11 @@
1#.rst:
2# FindClangFormat
3# ----------
4# Finds clang-format
5
6find_program(CLANG_FORMAT_EXECUTABLE clang-format)
7
8include(FindPackageHandleStandardArgs)
9find_package_handle_standard_args(ClangFormat REQUIRED_VARS CLANG_FORMAT_EXECUTABLE)
10
11mark_as_advanced(CLANG_FORMAT_EXECUTABLE)
diff --git a/cmake/modules/FindCpluff.cmake b/cmake/modules/FindCpluff.cmake
deleted file mode 100644
index 9e29e17..0000000
--- a/cmake/modules/FindCpluff.cmake
+++ /dev/null
@@ -1,51 +0,0 @@
1# - Builds Cpluff as external project
2# Once done this will define
3#
4# CPLUFF_FOUND - system has cpluff
5# CPLUFF_INCLUDE_DIRS - the cpluff include directories
6#
7# and link Kodi against the cpluff libraries.
8
9find_package(EXPAT REQUIRED)
10if(CORE_SYSTEM_NAME MATCHES windows)
11 add_subdirectory(${CMAKE_SOURCE_DIR}/lib/cpluff)
12 set(CPLUFF_LIBRARIES $<TARGET_FILE:libcpluff> ${EXPAT_LIBRARIES})
13else()
14 string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}")
15 get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY)
16 set(ldflags "-L${expat_dir}")
17
18 # iOS: Without specifying -arch, configure tries to use /bin/cpp as C-preprocessor
19 # http://stackoverflow.com/questions/38836754/cant-cross-compile-c-library-for-arm-ios
20 if(CORE_SYSTEM_NAME STREQUAL ios)
21 set(cppflags "-arch ${CPU}")
22 endif()
23
24 ExternalProject_Add(libcpluff SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/cpluff
25 BUILD_IN_SOURCE 1
26 PREFIX ${CORE_BUILD_DIR}/cpluff
27 CONFIGURE_COMMAND AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} CC=${CMAKE_C_COMPILER} ${CMAKE_SOURCE_DIR}/lib/cpluff/configure
28 --disable-nls
29 --enable-static
30 --disable-shared
31 --with-pic
32 --prefix=<INSTALL_DIR>
33 --libdir=<INSTALL_DIR>/lib
34 --host=${ARCH}
35 CFLAGS=${defines}
36 CPPFLAGS=${cppflags}
37 LDFLAGS=${ldflags}
38 BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libcpluff.a)
39 ExternalProject_Add_Step(libcpluff autoreconf
40 DEPENDEES download update patch
41 DEPENDERS configure
42 COMMAND rm -f config.status
43 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
44 WORKING_DIRECTORY <SOURCE_DIR>)
45
46 set(CPLUFF_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a ${EXPAT_LIBRARIES})
47endif()
48set(CPLUFF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/include)
49set(CPLUFF_FOUND 1)
50mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_LIBRARIES)
51set_target_properties(libcpluff PROPERTIES FOLDER "External Projects")
diff --git a/cmake/modules/FindCrossGUID.cmake b/cmake/modules/FindCrossGUID.cmake
index 7384747..613c2a4 100644
--- a/cmake/modules/FindCrossGUID.cmake
+++ b/cmake/modules/FindCrossGUID.cmake
@@ -34,9 +34,6 @@ if(ENABLE_INTERNAL_CROSSGUID)
34 <SOURCE_DIR> && 34 <SOURCE_DIR> &&
35 ${CMAKE_COMMAND} -E copy 35 ${CMAKE_COMMAND} -E copy
36 ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/FindUUID.cmake 36 ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/FindUUID.cmake
37 <SOURCE_DIR> &&
38 ${CMAKE_COMMAND} -E copy
39 ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/FindCXX11.cmake
40 <SOURCE_DIR> 37 <SOURCE_DIR>
41 BUILD_BYPRODUCTS ${CROSSGUID_LIBRARY}) 38 BUILD_BYPRODUCTS ${CROSSGUID_LIBRARY})
42 set_target_properties(crossguid PROPERTIES FOLDER "External Projects") 39 set_target_properties(crossguid PROPERTIES FOLDER "External Projects")
@@ -49,7 +46,7 @@ if(ENABLE_INTERNAL_CROSSGUID)
49 set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) 46 set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY})
50 set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) 47 set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR})
51else() 48else()
52 find_path(CROSSGUID_INCLUDE_DIR NAMES guid.h) 49 find_path(CROSSGUID_INCLUDE_DIR NAMES guid.hpp guid.h)
53 50
54 find_library(CROSSGUID_LIBRARY_RELEASE NAMES crossguid) 51 find_library(CROSSGUID_LIBRARY_RELEASE NAMES crossguid)
55 find_library(CROSSGUID_LIBRARY_DEBUG NAMES crossguidd) 52 find_library(CROSSGUID_LIBRARY_DEBUG NAMES crossguidd)
@@ -65,6 +62,10 @@ else()
65 set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) 62 set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY})
66 set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) 63 set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR})
67 64
65 if(EXISTS "${CROSSGUID_INCLUDE_DIR}/guid.hpp")
66 set(CROSSGUID_DEFINITIONS -DHAVE_NEW_CROSSGUID)
67 endif()
68
68 add_custom_target(crossguid) 69 add_custom_target(crossguid)
69 set_target_properties(crossguid PROPERTIES FOLDER "External Projects") 70 set_target_properties(crossguid PROPERTIES FOLDER "External Projects")
70 endif() 71 endif()
diff --git a/cmake/modules/FindDav1d.cmake b/cmake/modules/FindDav1d.cmake
new file mode 100644
index 0000000..7625afa
--- /dev/null
+++ b/cmake/modules/FindDav1d.cmake
@@ -0,0 +1,82 @@
1#.rst:
2# FindDav1d
3# --------
4# Finds the dav1d library
5#
6# This will define the following variables::
7#
8# DAV1D_FOUND - system has dav1d
9# DAV1D_INCLUDE_DIRS - the dav1d include directories
10# DAV1D_LIBRARIES - the dav1d libraries
11
12if(PKG_CONFIG_FOUND)
13 pkg_check_modules(PC_DAV1D dav1d QUIET)
14endif()
15
16find_library(DAV1D_LIBRARY NAMES dav1d libdav1d
17 PATHS ${PC_DAV1D_LIBDIR})
18
19find_path(DAV1D_INCLUDE_DIR NAMES dav1d/dav1d.h
20 PATHS ${PC_DAV1D_INCLUDEDIR})
21
22set(DAV1D_VERSION ${PC_DAV1D_VERSION})
23
24if(ENABLE_INTERNAL_DAV1D)
25 include(ExternalProject)
26
27 # Extract version
28 file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/dav1d/DAV1D-VERSION VER)
29
30 string(REGEX MATCH "VERSION=[^ ]*$.*" DAV1D_VER "${VER}")
31 list(GET DAV1D_VER 0 DAV1D_VER)
32 string(SUBSTRING "${DAV1D_VER}" 8 -1 DAV1D_VER)
33
34 # allow user to override the download URL with a local tarball
35 # needed for offline build envs
36 if(DAV1D_URL)
37 get_filename_component(DAV1D_URL "${DAV1D_URL}" ABSOLUTE)
38 else()
39 set(DAV1D_URL http://mirrors.kodi.tv/build-deps/sources/dav1d-${DAV1D_VER}.tar.gz)
40 endif()
41
42 if(VERBOSE)
43 message(STATUS "DAV1D_URL: ${DAV1D_URL}")
44 endif()
45
46 set(DAV1D_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libdav1d.a)
47 set(DAV1D_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include)
48 set(DAV1D_VERSION ${DAV1D_VER})
49
50 externalproject_add(dav1d
51 URL ${DAV1D_URL}
52 DOWNLOAD_NAME dav1d-${DAV1D_VER}.tar.gz
53 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
54 PREFIX ${CORE_BUILD_DIR}/dav1d
55 CONFIGURE_COMMAND meson
56 --buildtype=release
57 --default-library=static
58 --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
59 --libdir=lib
60 -Denable_asm=true
61 -Denable_tools=false
62 -Denable_examples=false
63 -Denable_tests=false
64 ../dav1d
65 BUILD_COMMAND ninja
66 INSTALL_COMMAND ninja install
67 BUILD_BYPRODUCTS ${DAV1D_LIBRARY})
68
69 set_target_properties(dav1d PROPERTIES FOLDER "External Projects")
70endif()
71
72include(FindPackageHandleStandardArgs)
73find_package_handle_standard_args(Dav1d
74 REQUIRED_VARS DAV1D_LIBRARY DAV1D_INCLUDE_DIR
75 VERSION_VAR DAV1D_VERSION)
76
77if(DAV1D_FOUND)
78 set(DAV1D_INCLUDE_DIRS ${DAV1D_INCLUDE_DIR})
79 set(DAV1D_LIBRARIES ${DAV1D_LIBRARY})
80endif()
81
82mark_as_advanced(DAV1D_INCLUDE_DIR DAV1D_LIBRARY)
diff --git a/cmake/modules/FindEpollShim.cmake b/cmake/modules/FindEpollShim.cmake
new file mode 100644
index 0000000..61366d8
--- /dev/null
+++ b/cmake/modules/FindEpollShim.cmake
@@ -0,0 +1,27 @@
1# FindEpollShim
2# -------------
3# Finds the epoll-shim library
4#
5# This will define the following variables::
6#
7# EPOLLSHIM_FOUND - the system has epoll-shim
8# EPOLLSHIM_INCLUDE_DIR - the epoll-shim include directory
9# EPOLLSHIM_LIBRARY - the epoll-shim library
10
11if(PKG_CONFIG_FOUND)
12 pkg_check_modules(PC_EPOLLSHIM epoll-shim QUIET)
13endif()
14
15find_path(EPOLLSHIM_INCLUDE_DIR NAMES sys/epoll.h PATHS ${PC_EPOLLSHIM_INCLUDE_DIRS})
16find_library(EPOLLSHIM_LIBRARY NAMES epoll-shim PATHS ${PC_EPOLLSHIM_LIBDIR})
17
18include(FindPackageHandleStandardArgs)
19find_package_handle_standard_args(EpollShim
20 REQUIRED_VARS EPOLLSHIM_LIBRARY EPOLLSHIM_INCLUDE_DIR)
21
22if(EPOLLSHIM_FOUND)
23 set(EPOLLSHIM_INCLUDE_DIRS ${EPOLLSHIM_INCLUDE_DIR})
24 set(EPOLLSHIM_LIBRARIES ${EPOLLSHIM_LIBRARY})
25endif()
26
27mark_as_advanced(EPOLLSHIM_INCLUDE_DIR EPOLLSHIM_LIBRARY)
diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake
index ef74671..81d2697 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 4.0) 36set(REQUIRED_FFMPEG_VERSION 4.3)
37set(_avcodec_ver ">=58.18.100") 37set(_avcodec_ver ">=58.91.100")
38set(_avfilter_ver ">=7.16.100") 38set(_avfilter_ver ">=7.85.100")
39set(_avformat_ver ">=58.12.100") 39set(_avformat_ver ">=58.45.100")
40set(_avutil_ver ">=56.14.100") 40set(_avutil_ver ">=56.51.100")
41set(_swscale_ver ">=5.1.100") 41set(_swscale_ver ">=5.7.100")
42set(_swresample_ver ">=3.1.100") 42set(_swresample_ver ">=3.7.100")
43set(_postproc_ver ">=55.1.100") 43set(_postproc_ver ">=55.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,
@@ -229,10 +229,16 @@ if(NOT FFMPEG_FOUND)
229 message(STATUS "FFMPEG_URL: ${FFMPEG_URL}") 229 message(STATUS "FFMPEG_URL: ${FFMPEG_URL}")
230 endif() 230 endif()
231 231
232 if (NOT DAV1D_FOUND)
233 message(STATUS "dav1d not found, internal ffmpeg build will be missing AV1 support!")
234 endif()
235
232 set(FFMPEG_OPTIONS -DENABLE_CCACHE=${ENABLE_CCACHE} 236 set(FFMPEG_OPTIONS -DENABLE_CCACHE=${ENABLE_CCACHE}
233 -DCCACHE_PROGRAM=${CCACHE_PROGRAM} 237 -DCCACHE_PROGRAM=${CCACHE_PROGRAM}
234 -DENABLE_VAAPI=${ENABLE_VAAPI} 238 -DENABLE_VAAPI=${ENABLE_VAAPI}
235 -DENABLE_VDPAU=${ENABLE_VDPAU}) 239 -DENABLE_VDPAU=${ENABLE_VDPAU}
240 -DENABLE_DAV1D=${DAV1D_FOUND}
241 -DEXTRA_FLAGS=${FFMPEG_EXTRA_FLAGS})
236 242
237 if(KODI_DEPENDSBUILD) 243 if(KODI_DEPENDSBUILD)
238 set(CROSS_ARGS -DDEPENDS_PATH=${DEPENDS_PATH} 244 set(CROSS_ARGS -DDEPENDS_PATH=${DEPENDS_PATH}
@@ -265,6 +271,7 @@ if(NOT FFMPEG_FOUND)
265 -DCMAKE_EXE_LINKER_FLAGS=${LINKER_FLAGS} 271 -DCMAKE_EXE_LINKER_FLAGS=${LINKER_FLAGS}
266 ${CROSS_ARGS} 272 ${CROSS_ARGS}
267 ${FFMPEG_OPTIONS} 273 ${FFMPEG_OPTIONS}
274 -DPKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig
268 PATCH_COMMAND ${CMAKE_COMMAND} -E copy 275 PATCH_COMMAND ${CMAKE_COMMAND} -E copy
269 ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/CMakeLists.txt 276 ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/CMakeLists.txt
270 <SOURCE_DIR> && 277 <SOURCE_DIR> &&
@@ -272,6 +279,10 @@ if(NOT FFMPEG_FOUND)
272 ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake 279 ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake
273 <SOURCE_DIR>) 280 <SOURCE_DIR>)
274 281
282 if (ENABLE_INTERNAL_DAV1D)
283 add_dependencies(ffmpeg dav1d)
284 endif()
285
275 find_program(BASH_COMMAND bash) 286 find_program(BASH_COMMAND bash)
276 if(NOT BASH_COMMAND) 287 if(NOT BASH_COMMAND)
277 message(FATAL_ERROR "Internal FFmpeg requires bash.") 288 message(FATAL_ERROR "Internal FFmpeg requires bash.")
diff --git a/cmake/modules/FindFlatBuffers.cmake b/cmake/modules/FindFlatBuffers.cmake
index 6f7e6a2..5ca67c5 100644
--- a/cmake/modules/FindFlatBuffers.cmake
+++ b/cmake/modules/FindFlatBuffers.cmake
@@ -11,7 +11,7 @@
11 11
12if(ENABLE_INTERNAL_FLATBUFFERS) 12if(ENABLE_INTERNAL_FLATBUFFERS)
13 include(ExternalProject) 13 include(ExternalProject)
14 file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/native/flatbuffers-native/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$") 14 file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/native/flatbuffers/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$")
15 string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" FLATBUFFERS_VER "${VER}") 15 string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" FLATBUFFERS_VER "${VER}")
16 16
17 # Allow user to override the download URL with a local tarball 17 # Allow user to override the download URL with a local tarball
@@ -43,7 +43,6 @@ if(ENABLE_INTERNAL_FLATBUFFERS)
43 -DFLATBUFFERS_BUILD_GRPCTEST=OFF 43 -DFLATBUFFERS_BUILD_GRPCTEST=OFF
44 -DFLATBUFFERS_BUILD_SHAREDLIB=OFF 44 -DFLATBUFFERS_BUILD_SHAREDLIB=OFF
45 "${EXTRA_ARGS}" 45 "${EXTRA_ARGS}"
46 PATCH_COMMAND patch -p1 < ${CORE_SOURCE_DIR}/tools/depends/native/flatbuffers-native/0001-Fix-compiler-warning.patch
47 BUILD_BYPRODUCTS ${FLATBUFFERS_FLATC_EXECUTABLE}) 46 BUILD_BYPRODUCTS ${FLATBUFFERS_FLATC_EXECUTABLE})
48 set_target_properties(flatbuffers PROPERTIES FOLDER "External Projects" 47 set_target_properties(flatbuffers PROPERTIES FOLDER "External Projects"
49 INTERFACE_INCLUDE_DIRECTORIES ${FLATBUFFERS_INCLUDE_DIR}) 48 INTERFACE_INCLUDE_DIRECTORIES ${FLATBUFFERS_INCLUDE_DIR})
diff --git a/cmake/modules/FindFmt.cmake b/cmake/modules/FindFmt.cmake
index 47cf8be..b426d8c 100644
--- a/cmake/modules/FindFmt.cmake
+++ b/cmake/modules/FindFmt.cmake
@@ -39,6 +39,8 @@ if(ENABLE_INTERNAL_FMT)
39 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download 39 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
40 PREFIX ${CORE_BUILD_DIR}/fmt 40 PREFIX ${CORE_BUILD_DIR}/fmt
41 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} 41 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
42 -DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}
43 -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
42 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} 44 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
43 -DCMAKE_INSTALL_LIBDIR=lib 45 -DCMAKE_INSTALL_LIBDIR=lib
44 -DFMT_DOC=OFF 46 -DFMT_DOC=OFF
@@ -57,12 +59,7 @@ if(ENABLE_INTERNAL_FMT)
57 59
58else() 60else()
59 61
60if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) 62find_package(FMT 6.1.2 CONFIG REQUIRED QUIET)
61 # TODO: fix windows fmt package to include fmt-config.cmake and fmt-config-version.cmake
62 set(FMT_VERSION 3.0.1)
63else()
64 find_package(FMT 3.0.1 CONFIG REQUIRED QUIET)
65endif()
66 63
67if(PKG_CONFIG_FOUND) 64if(PKG_CONFIG_FOUND)
68 pkg_check_modules(PC_FMT libfmt QUIET) 65 pkg_check_modules(PC_FMT libfmt QUIET)
diff --git a/cmake/modules/FindFriBidi.cmake b/cmake/modules/FindFriBidi.cmake
index 91f3994..7a135e7 100644
--- a/cmake/modules/FindFriBidi.cmake
+++ b/cmake/modules/FindFriBidi.cmake
@@ -17,7 +17,8 @@ if(PKG_CONFIG_FOUND)
17 pkg_check_modules(PC_FRIBIDI fribidi QUIET) 17 pkg_check_modules(PC_FRIBIDI fribidi QUIET)
18endif() 18endif()
19 19
20find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h 20find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi.h
21 PATH_SUFFIXES fribidi
21 PATHS ${PC_FRIBIDI_INCLUDEDIR}) 22 PATHS ${PC_FRIBIDI_INCLUDEDIR})
22find_library(FRIBIDI_LIBRARY NAMES fribidi libfribidi 23find_library(FRIBIDI_LIBRARY NAMES fribidi libfribidi
23 PATHS ${PC_FRIBIDI_LIBDIR}) 24 PATHS ${PC_FRIBIDI_LIBDIR})
diff --git a/cmake/modules/FindGIF.cmake b/cmake/modules/FindGIF.cmake
index 1c616e0..7564a58 100644
--- a/cmake/modules/FindGIF.cmake
+++ b/cmake/modules/FindGIF.cmake
@@ -16,15 +16,9 @@
16find_path(GIF_INCLUDE_DIR gif_lib.h) 16find_path(GIF_INCLUDE_DIR gif_lib.h)
17 17
18include(FindPackageHandleStandardArgs) 18include(FindPackageHandleStandardArgs)
19if(NOT WIN32) 19find_library(GIF_LIBRARY NAMES gif)
20 find_library(GIF_LIBRARY NAMES gif) 20find_package_handle_standard_args(GIF
21 find_package_handle_standard_args(GIF 21 REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR)
22 REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR)
23else()
24 # Dynamically loaded DLL
25 find_package_handle_standard_args(GIF
26 REQUIRED_VARS GIF_INCLUDE_DIR)
27endif()
28 22
29if(GIF_FOUND) 23if(GIF_FOUND)
30 set(GIF_LIBRARIES ${GIF_LIBRARY}) 24 set(GIF_LIBRARIES ${GIF_LIBRARY})
diff --git a/cmake/modules/FindGtest.cmake b/cmake/modules/FindGtest.cmake
new file mode 100644
index 0000000..b59554b
--- /dev/null
+++ b/cmake/modules/FindGtest.cmake
@@ -0,0 +1,84 @@
1#.rst:
2# FindGtest
3# --------
4# Finds the gtest library
5#
6# This will define the following variables::
7#
8# GTEST_FOUND - system has gtest
9# GTEST_INCLUDE_DIRS - the gtest include directories
10# GTEST_LIBRARIES - the gtest libraries
11#
12# and the following imported targets:
13#
14# Gtest::Gtest - The gtest library
15
16if(ENABLE_INTERNAL_GTEST)
17 include(ExternalProject)
18
19 file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/googletest/Makefile VER)
20 string(REGEX MATCH "VERSION=[^ ]*" GTEST_VERSION "${VER}")
21 list(GET GTEST_VERSION 0 GTEST_VERSION)
22 string(SUBSTRING "${GTEST_VERSION}" 8 -1 GTEST_VERSION)
23
24 # allow user to override the download URL with a local tarball
25 # needed for offline build envs
26 if(GTEST_URL)
27 get_filename_component(GTEST_URL "${GTEST_URL}" ABSOLUTE)
28 else()
29 set(GTEST_URL http://mirrors.kodi.tv/build-deps/sources/googletest-${GTEST_VERSION}.tar.gz)
30 endif()
31
32 if(VERBOSE)
33 message(STATUS "GTEST_URL: ${GTEST_URL}")
34 endif()
35
36 set(GTEST_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libgtest.a)
37 set(GTEST_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include)
38
39 externalproject_add(gtest
40 URL ${GTEST_URL}
41 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
42 PREFIX ${CORE_BUILD_DIR}/gtest
43 INSTALL_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
44 CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DBUILD_GMOCK=OFF -DINSTALL_GTEST=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> -DCMAKE_INSTALL_LIBDIR=lib
45 BUILD_BYPRODUCTS ${GTEST_LIBRARY})
46 set_target_properties(gtest PROPERTIES FOLDER "External Projects")
47else()
48 if(PKG_CONFIG_FOUND)
49 pkg_check_modules(PC_GTEST gtest>=1.10.0 QUIET)
50 set(GTEST_VERSION ${PC_GTEST_VERSION})
51 elseif(WIN32)
52 set(GTEST_VERSION 1.10.0)
53 endif()
54
55 find_path(GTEST_INCLUDE_DIR NAMES gtest/gtest.h
56 PATHS ${PC_GTEST_INCLUDEDIR})
57
58 find_library(GTEST_LIBRARY_RELEASE NAMES gtest
59 PATHS ${PC_GTEST_LIBDIR})
60 find_library(GTEST_LIBRARY_DEBUG NAMES gtestd
61 PATHS ${PC_GTEST_LIBDIR})
62
63 include(SelectLibraryConfigurations)
64 select_library_configurations(GTEST)
65endif()
66
67include(FindPackageHandleStandardArgs)
68find_package_handle_standard_args(Gtest
69 REQUIRED_VARS GTEST_LIBRARY GTEST_INCLUDE_DIR
70 VERSION_VAR GTEST_VERSION)
71
72if(GTEST_FOUND)
73 set(GTEST_LIBRARIES ${GTEST_LIBRARY})
74 set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR})
75endif()
76
77if(NOT TARGET Gtest::Gtest)
78 add_library(Gtest::Gtest UNKNOWN IMPORTED)
79 set_target_properties(Gtest::Gtest PROPERTIES
80 IMPORTED_LOCATION "${GTEST_LIBRARY}"
81 INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIR}")
82endif()
83
84mark_as_advanced(GTEST_INCLUDE_DIR GTEST_LIBRARY)
diff --git a/cmake/modules/FindIso9660pp.cmake b/cmake/modules/FindIso9660pp.cmake
new file mode 100644
index 0000000..5f84b55
--- /dev/null
+++ b/cmake/modules/FindIso9660pp.cmake
@@ -0,0 +1,43 @@
1#.rst:
2# FindIso9660pp
3# --------
4# Finds the iso9660++ library
5#
6# This will define the following variables::
7#
8# ISO9660PP_FOUND - system has iso9660++
9# ISO9660PP_INCLUDE_DIRS - the iso9660++ include directory
10# ISO9660PP_LIBRARIES - the iso9660++ libraries
11# ISO9660PP_DEFINITIONS - the iso9660++ definitions
12
13if(PKG_CONFIG_FOUND)
14 pkg_check_modules(PC_ISO9660PP libiso9660++>=2.1.0 QUIET)
15 pkg_check_modules(PC_ISO9660 libiso9660>=2.1.0 QUIET)
16endif()
17
18find_path(ISO9660PP_INCLUDE_DIR NAMES cdio++/iso9660.hpp
19 PATHS ${PC_ISO9660PP_INCLUDEDIR})
20
21find_library(ISO9660PP_LIBRARY NAMES libiso9660++ iso9660++
22 PATHS ${PC_ISO9660PP_LIBDIR})
23
24find_path(ISO9660_INCLUDE_DIR NAMES cdio/iso9660.h
25 PATHS ${PC_ISO9660_INCLUDEDIR})
26
27find_library(ISO9660_LIBRARY NAMES libiso9660 iso9660
28 PATHS ${PC_ISO9660_LIBDIR})
29
30set(ISO9660PP_VERSION ${PC_ISO9660PP_VERSION})
31
32include(FindPackageHandleStandardArgs)
33find_package_handle_standard_args(Iso9660pp
34 REQUIRED_VARS ISO9660PP_LIBRARY ISO9660PP_INCLUDE_DIR ISO9660_LIBRARY ISO9660_INCLUDE_DIR
35 VERSION_VAR ISO9660PP_VERSION)
36
37if(ISO9660PP_FOUND)
38 set(ISO9660PP_LIBRARIES ${ISO9660PP_LIBRARY} ${ISO9660_LIBRARY})
39 set(ISO9660PP_INCLUDE_DIRS ${ISO9660PP_INCLUDE_DIR} ${ISO9660_INCLUDE_DIR})
40 set(ISO9660PP_DEFINITIONS -DHAS_ISO9660PP=1)
41endif()
42
43mark_as_advanced(ISO9660PP_INCLUDE_DIR ISO9660PP_LIBRARY ISO9660_INCLUDE_DIR ISO9660_LIBRARY)
diff --git a/cmake/modules/FindLibDRM.cmake b/cmake/modules/FindLibDRM.cmake
index 4b39de3..0d680f2 100644
--- a/cmake/modules/FindLibDRM.cmake
+++ b/cmake/modules/FindLibDRM.cmake
@@ -8,6 +8,7 @@
8# LIBDRM_FOUND - system has LibDRM 8# LIBDRM_FOUND - system has LibDRM
9# LIBDRM_INCLUDE_DIRS - the LibDRM include directory 9# LIBDRM_INCLUDE_DIRS - the LibDRM include directory
10# LIBDRM_LIBRARIES - the LibDRM libraries 10# LIBDRM_LIBRARIES - the LibDRM libraries
11# LIBDRM_DEFINITIONS - the LibDRM definitions
11# 12#
12# and the following imported targets:: 13# and the following imported targets::
13# 14#
@@ -30,9 +31,23 @@ find_package_handle_standard_args(LibDRM
30 REQUIRED_VARS LIBDRM_LIBRARY LIBDRM_INCLUDE_DIR 31 REQUIRED_VARS LIBDRM_LIBRARY LIBDRM_INCLUDE_DIR
31 VERSION_VAR LIBDRM_VERSION) 32 VERSION_VAR LIBDRM_VERSION)
32 33
34include(CheckCSourceCompiles)
35set(CMAKE_REQUIRED_INCLUDES ${LIBDRM_INCLUDE_DIR})
36check_c_source_compiles("#include <drm_mode.h>
37
38 int main()
39 {
40 struct hdr_output_metadata test;
41 return test.metadata_type;
42 }
43 " LIBDRM_HAS_HDR_OUTPUT_METADATA)
44
33if(LIBDRM_FOUND) 45if(LIBDRM_FOUND)
34 set(LIBDRM_LIBRARIES ${LIBDRM_LIBRARY}) 46 set(LIBDRM_LIBRARIES ${LIBDRM_LIBRARY})
35 set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR}) 47 set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR})
48 if(LIBDRM_HAS_HDR_OUTPUT_METADATA)
49 set(LIBDRM_DEFINITIONS -DHAVE_HDR_OUTPUT_METADATA=1)
50 endif()
36 51
37 if(NOT TARGET LIBDRM::LIBDRM) 52 if(NOT TARGET LIBDRM::LIBDRM)
38 add_library(LIBDRM::LIBDRM UNKNOWN IMPORTED) 53 add_library(LIBDRM::LIBDRM UNKNOWN IMPORTED)
diff --git a/cmake/modules/FindLibDvd.cmake b/cmake/modules/FindLibDvd.cmake
index bd08b94..44e7e92 100644
--- a/cmake/modules/FindLibDvd.cmake
+++ b/cmake/modules/FindLibDvd.cmake
@@ -89,6 +89,8 @@ else()
89 set(HOST_ARCH aarch64-linux-android) 89 set(HOST_ARCH aarch64-linux-android)
90 elseif(ARCH STREQUAL i486-linux) 90 elseif(ARCH STREQUAL i486-linux)
91 set(HOST_ARCH i686-linux-android) 91 set(HOST_ARCH i686-linux-android)
92 elseif(ARCH STREQUAL x86_64)
93 set(HOST_ARCH x86_64-linux-android)
92 endif() 94 endif()
93 elseif(CORE_SYSTEM_NAME STREQUAL windowsstore) 95 elseif(CORE_SYSTEM_NAME STREQUAL windowsstore)
94 set(LIBDVD_ADDITIONAL_ARGS "-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}" "-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}") 96 set(LIBDVD_ADDITIONAL_ARGS "-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}" "-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}")
@@ -233,6 +235,7 @@ else()
233 set(LIBDVD_TARGET_DIR dlls) 235 set(LIBDVD_TARGET_DIR dlls)
234 endif() 236 endif()
235 copy_file_to_buildtree(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/bin/libdvdnav.dll DIRECTORY ${LIBDVD_TARGET_DIR}) 237 copy_file_to_buildtree(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/bin/libdvdnav.dll DIRECTORY ${LIBDVD_TARGET_DIR})
238 add_dependencies(export-files dvdnav)
236 endif() 239 endif()
237 240
238 set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include) 241 set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include)
diff --git a/cmake/modules/FindLibUSB.cmake b/cmake/modules/FindLibUSB.cmake
index 17cf6ec..7bf3a92 100644
--- a/cmake/modules/FindLibUSB.cmake
+++ b/cmake/modules/FindLibUSB.cmake
@@ -24,7 +24,7 @@ find_library(LIBUSB_LIBRARY NAMES usb
24set(LIBUSB_VERSION ${PC_LIBUSB_VERSION}) 24set(LIBUSB_VERSION ${PC_LIBUSB_VERSION})
25 25
26include(FindPackageHandleStandardArgs) 26include(FindPackageHandleStandardArgs)
27find_package_handle_standard_args(LIBUSB 27find_package_handle_standard_args(LibUSB
28 REQUIRED_VARS LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR 28 REQUIRED_VARS LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR
29 VERSION_VAR LIBUSB_VERSION) 29 VERSION_VAR LIBUSB_VERSION)
30 30
diff --git a/cmake/modules/FindMariaDBClient.cmake b/cmake/modules/FindMariaDBClient.cmake
index 7530ab5..374aeeb 100644
--- a/cmake/modules/FindMariaDBClient.cmake
+++ b/cmake/modules/FindMariaDBClient.cmake
@@ -28,11 +28,11 @@ endif()
28 28
29find_path(MARIADBCLIENT_INCLUDE_DIR NAMES mariadb/mysql.h mariadb/server/mysql.h 29find_path(MARIADBCLIENT_INCLUDE_DIR NAMES mariadb/mysql.h mariadb/server/mysql.h
30 PATHS ${PC_MARIADBCLIENT_INCLUDEDIR}) 30 PATHS ${PC_MARIADBCLIENT_INCLUDEDIR})
31find_library(MARIADBCLIENT_LIBRARY_RELEASE NAMES mariadbclient mariadb 31find_library(MARIADBCLIENT_LIBRARY_RELEASE NAMES mariadbclient mariadb libmariadb
32 PATHS ${PC_MARIADBCLIENT_LIBDIR} 32 PATHS ${PC_MARIADBCLIENT_LIBDIR}
33 PATH_SUFFIXES mariadb 33 PATH_SUFFIXES mariadb
34 ${EXTRA_FIND_ARGS}) 34 ${EXTRA_FIND_ARGS})
35find_library(MARIADBCLIENT_LIBRARY_DEBUG NAMES mariadbclient mariadb 35find_library(MARIADBCLIENT_LIBRARY_DEBUG NAMES mariadbclient mariadb libmariadbd
36 PATHS ${PC_MARIADBCLIENT_LIBDIR} 36 PATHS ${PC_MARIADBCLIENT_LIBDIR}
37 PATH_SUFFIXES mariadb 37 PATH_SUFFIXES mariadb
38 ${EXTRA_FIND_ARGS}) 38 ${EXTRA_FIND_ARGS})
diff --git a/cmake/modules/FindNFS.cmake b/cmake/modules/FindNFS.cmake
index c2414a1..d62d4e6 100644
--- a/cmake/modules/FindNFS.cmake
+++ b/cmake/modules/FindNFS.cmake
@@ -36,6 +36,44 @@ if(NFS_FOUND)
36 set(NFS_INCLUDE_DIRS ${NFS_INCLUDE_DIR}) 36 set(NFS_INCLUDE_DIRS ${NFS_INCLUDE_DIR})
37 set(NFS_DEFINITIONS -DHAS_FILESYSTEM_NFS=1) 37 set(NFS_DEFINITIONS -DHAS_FILESYSTEM_NFS=1)
38 38
39 set(CMAKE_REQUIRED_INCLUDES "${NFS_INCLUDE_DIR}")
40 set(CMAKE_REQUIRED_LIBRARIES ${NFS_LIBRARY})
41 if(CMAKE_SYSTEM_NAME MATCHES "Windows")
42 set(NFS_CXX_INCLUDE "#include <Winsock2.h>")
43 set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "ws2_32.lib")
44 endif()
45
46# Check for nfs_set_timeout
47 check_cxx_source_compiles("
48 ${NFS_CXX_INCLUDE}
49 #include <nfsc/libnfs.h>
50 int main()
51 {
52 nfs_set_timeout(NULL, 0);
53 }
54 " NFS_SET_TIMEOUT)
55
56 if(NFS_SET_TIMEOUT)
57 list(APPEND NFS_DEFINITIONS -DHAS_NFS_SET_TIMEOUT)
58 endif()
59
60# Check for mount_getexports_timeout
61 check_cxx_source_compiles("
62 ${NFS_CXX_INCLUDE}
63 #include <nfsc/libnfs.h>
64 int main()
65 {
66 mount_getexports_timeout(NULL, 0);
67 }
68 " NFS_MOUNT_GETEXPORTS_TIMEOUT)
69
70 if(NFS_MOUNT_GETEXPORTS_TIMEOUT)
71 list(APPEND NFS_DEFINITIONS -DHAS_NFS_MOUNT_GETEXPORTS_TIMEOUT)
72 endif()
73
74 unset(CMAKE_REQUIRED_INCLUDES)
75 unset(CMAKE_REQUIRED_LIBRARIES)
76
39 if(NOT TARGET NFS::NFS) 77 if(NOT TARGET NFS::NFS)
40 add_library(NFS::NFS UNKNOWN IMPORTED) 78 add_library(NFS::NFS UNKNOWN IMPORTED)
41 if(NFS_LIBRARY) 79 if(NFS_LIBRARY)
diff --git a/cmake/modules/FindOpenGLES.cmake b/cmake/modules/FindOpenGLES.cmake
index 0191d9e..43a1367 100644
--- a/cmake/modules/FindOpenGLES.cmake
+++ b/cmake/modules/FindOpenGLES.cmake
@@ -18,7 +18,7 @@ if(PKG_CONFIG_FOUND)
18 pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET) 18 pkg_check_modules(PC_OPENGLES ${_brcmprefix}glesv2 QUIET)
19endif() 19endif()
20 20
21if(NOT CORE_SYSTEM_NAME STREQUAL ios) 21if(NOT CORE_SYSTEM_NAME STREQUAL darwin_embedded)
22 find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h 22 find_path(OPENGLES_INCLUDE_DIR GLES2/gl2.h
23 PATHS ${PC_OPENGLES_INCLUDEDIR}) 23 PATHS ${PC_OPENGLES_INCLUDEDIR})
24 find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2 24 find_library(OPENGLES_gl_LIBRARY NAMES ${_brcmprefix}GLESv2
diff --git a/cmake/modules/FindPlist.cmake b/cmake/modules/FindPlist.cmake
index cd143e9..2c86b74 100644
--- a/cmake/modules/FindPlist.cmake
+++ b/cmake/modules/FindPlist.cmake
@@ -23,20 +23,13 @@ find_path(PLIST_INCLUDE_DIR plist/plist.h
23 23
24set(PLIST_VERSION ${PC_PLIST_VERSION}) 24set(PLIST_VERSION ${PC_PLIST_VERSION})
25 25
26find_library(PLIST_LIBRARY NAMES plist libplist
27 PATHS ${PC_PLIST_LIBDIR})
28
26include(FindPackageHandleStandardArgs) 29include(FindPackageHandleStandardArgs)
27if(NOT WIN32) 30find_package_handle_standard_args(Plist
28 find_library(PLIST_LIBRARY NAMES plist 31 REQUIRED_VARS PLIST_LIBRARY PLIST_INCLUDE_DIR
29 PATHS ${PC_PLIST_LIBDIR}) 32 VERSION_VAR PLIST_VERSION)
30
31 find_package_handle_standard_args(Plist
32 REQUIRED_VARS PLIST_LIBRARY PLIST_INCLUDE_DIR
33 VERSION_VAR PLIST_VERSION)
34else()
35 # Dynamically loaded DLL
36 find_package_handle_standard_args(Plist
37 REQUIRED_VARS PLIST_INCLUDE_DIR
38 VERSION_VAR PLIST_VERSION)
39endif()
40 33
41if(PLIST_FOUND) 34if(PLIST_FOUND)
42 set(PLIST_LIBRARIES ${PLIST_LIBRARY}) 35 set(PLIST_LIBRARIES ${PLIST_LIBRARY})
diff --git a/cmake/modules/FindPython.cmake b/cmake/modules/FindPython.cmake
index 213b17c..e39d4e5 100644
--- a/cmake/modules/FindPython.cmake
+++ b/cmake/modules/FindPython.cmake
@@ -6,12 +6,12 @@
6# PYTHON_LIBRARIES - The python libraries 6# PYTHON_LIBRARIES - The python libraries
7 7
8if(PKG_CONFIG_FOUND) 8if(PKG_CONFIG_FOUND)
9 pkg_check_modules(PC_PYTHON python>=2.7 QUIET) 9 pkg_check_modules(PC_PYTHON python3>=3.5 QUIET)
10endif() 10endif()
11 11
12find_program(PYTHON_EXECUTABLE python ONLY_CMAKE_FIND_ROOT_PATH) 12find_program(PYTHON_EXECUTABLE python3 ONLY_CMAKE_FIND_ROOT_PATH)
13find_library(PYTHON_LIBRARY NAMES python2.7 PATHS ${PC_PYTHON_LIBDIR}) 13find_library(PYTHON_LIBRARY NAMES python3.8 python3.7 python3.6 python3.5 PATHS ${PC_PYTHON_LIBDIR})
14find_path(PYTHON_INCLUDE_DIR NAMES Python.h PATHS ${PC_PYTHON_INCLUDE_DIRS} ${DEPENDS_PATH}/include/python2.7) 14find_path(PYTHON_INCLUDE_DIR NAMES Python.h PATHS ${PC_PYTHON_INCLUDE_DIRS} PATH_SUFFIXES python3.8 python3.7 python3.6 python3.5)
15 15
16if(KODI_DEPENDSBUILD) 16if(KODI_DEPENDSBUILD)
17 find_library(FFI_LIBRARY ffi REQUIRED) 17 find_library(FFI_LIBRARY ffi REQUIRED)
@@ -25,7 +25,7 @@ if(KODI_DEPENDSBUILD)
25 25
26 set(PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${FFI_LIBRARY} ${EXPAT_LIBRARY} ${INTL_LIBRARY} ${GMP_LIBRARY} ${PYTHON_DEP_LIBRARIES}) 26 set(PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${FFI_LIBRARY} ${EXPAT_LIBRARY} ${INTL_LIBRARY} ${GMP_LIBRARY} ${PYTHON_DEP_LIBRARIES})
27else() 27else()
28 find_package(PythonLibs 2.7 REQUIRED) 28 find_package(PythonLibs 3.5 REQUIRED)
29 list(APPEND PYTHON_LIBRARIES ${PC_PYTHON_STATIC_LIBRARIES}) 29 list(APPEND PYTHON_LIBRARIES ${PC_PYTHON_STATIC_LIBRARIES})
30endif() 30endif()
31 31
diff --git a/cmake/modules/FindSSE.cmake b/cmake/modules/FindSSE.cmake
index 08e3630..d9d5c7a 100644
--- a/cmake/modules/FindSSE.cmake
+++ b/cmake/modules/FindSSE.cmake
@@ -141,6 +141,7 @@ include(FindPackageHandleStandardArgs)
141find_package_handle_standard_args(SSE 141find_package_handle_standard_args(SSE
142 REQUIRED_VARS _SSE_TRUE _SSE_OK 142 REQUIRED_VARS _SSE_TRUE _SSE_OK
143 FAIL_MESSAGE "Could not find hardware support for SSE") 143 FAIL_MESSAGE "Could not find hardware support for SSE")
144set(FPHSA_NAME_MISMATCHED ON)
144find_package_handle_standard_args(SSE2 145find_package_handle_standard_args(SSE2
145 REQUIRED_VARS _SSE2_TRUE _SSE2_OK 146 REQUIRED_VARS _SSE2_TRUE _SSE2_OK
146 FAIL_MESSAGE "Could not find hardware support for SSE2") 147 FAIL_MESSAGE "Could not find hardware support for SSE2")
@@ -162,6 +163,7 @@ find_package_handle_standard_args(AVX
162find_package_handle_standard_args(AVX2 163find_package_handle_standard_args(AVX2
163 REQUIRED_VARS _AVX2_TRUE _AVX2_OK 164 REQUIRED_VARS _AVX2_TRUE _AVX2_OK
164 FAIL_MESSAGE "Could not find hardware support for AVX2") 165 FAIL_MESSAGE "Could not find hardware support for AVX2")
166unset(FPHSA_NAME_MISMATCHED)
165 167
166mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND SSE4_2_FOUND AVX_FOUND AVX2_FOUND) 168mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND SSE4_2_FOUND AVX_FOUND AVX2_FOUND)
167 169
diff --git a/cmake/modules/FindSWIG.cmake b/cmake/modules/FindSWIG.cmake
index f9b27c2..fba544b 100644
--- a/cmake/modules/FindSWIG.cmake
+++ b/cmake/modules/FindSWIG.cmake
@@ -8,7 +8,7 @@
8# SWIG_FOUND - system has SWIG 8# SWIG_FOUND - system has SWIG
9# SWIG_EXECUTABLE - the SWIG executable 9# SWIG_EXECUTABLE - the SWIG executable
10 10
11find_program(SWIG_EXECUTABLE NAMES swig3.0 swig2.0 swig 11find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig
12 PATH_SUFFIXES swig) 12 PATH_SUFFIXES swig)
13if(SWIG_EXECUTABLE) 13if(SWIG_EXECUTABLE)
14 execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib 14 execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
diff --git a/cmake/modules/FindShairplay.cmake b/cmake/modules/FindShairplay.cmake
index bbb3372..506cffd 100644
--- a/cmake/modules/FindShairplay.cmake
+++ b/cmake/modules/FindShairplay.cmake
@@ -17,32 +17,26 @@
17find_path(SHAIRPLAY_INCLUDE_DIR shairplay/raop.h) 17find_path(SHAIRPLAY_INCLUDE_DIR shairplay/raop.h)
18 18
19include(FindPackageHandleStandardArgs) 19include(FindPackageHandleStandardArgs)
20if(NOT WIN32) 20find_library(SHAIRPLAY_LIBRARY NAMES shairplay libshairplay)
21 find_library(SHAIRPLAY_LIBRARY NAMES shairplay) 21
22 22if(SHAIRPLAY_INCLUDE_DIR AND SHAIRPLAY_LIBRARY)
23 if(SHAIRPLAY_INCLUDE_DIR AND SHAIRPLAY_LIBRARY) 23 include(CheckCSourceCompiles)
24 include(CheckCSourceCompiles) 24 set(CMAKE_REQUIRED_INCLUDES ${SHAIRPLAY_INCLUDE_DIR})
25 set(CMAKE_REQUIRED_INCLUDES ${SHAIRPLAY_INCLUDE_DIRS}) 25 set(CMAKE_REQUIRED_LIBRARIES ${SHAIRPLAY_LIBRARIES})
26 set(CMAKE_REQUIRED_LIBRARIES ${SHAIRPLAY_LIBRARIES}) 26 check_c_source_compiles("#include <shairplay/raop.h>
27 check_c_source_compiles("#include <shairplay/raop.h> 27
28 28 int main()
29 int main() 29 {
30 { 30 struct raop_callbacks_s foo;
31 struct raop_callbacks_s foo; 31 foo.cls;
32 foo.cls; 32 return 0;
33 return 0; 33 }
34 } 34 " HAVE_SHAIRPLAY_CALLBACK_CLS)
35 " HAVE_SHAIRPLAY_CALLBACK_CLS)
36 endif()
37
38 find_package_handle_standard_args(Shairplay
39 REQUIRED_VARS SHAIRPLAY_LIBRARY SHAIRPLAY_INCLUDE_DIR HAVE_SHAIRPLAY_CALLBACK_CLS)
40else()
41 # Dynamically loaded DLL
42 find_package_handle_standard_args(Shairplay
43 REQUIRED_VARS SHAIRPLAY_INCLUDE_DIR)
44endif() 35endif()
45 36
37find_package_handle_standard_args(Shairplay
38 REQUIRED_VARS SHAIRPLAY_LIBRARY SHAIRPLAY_INCLUDE_DIR HAVE_SHAIRPLAY_CALLBACK_CLS)
39
46if(SHAIRPLAY_FOUND) 40if(SHAIRPLAY_FOUND)
47 set(SHAIRPLAY_LIBRARIES ${SHAIRPLAY_LIBRARY}) 41 set(SHAIRPLAY_LIBRARIES ${SHAIRPLAY_LIBRARY})
48 set(SHAIRPLAY_INCLUDE_DIRS ${SHAIRPLAY_INCLUDE_DIR}) 42 set(SHAIRPLAY_INCLUDE_DIRS ${SHAIRPLAY_INCLUDE_DIR})
diff --git a/cmake/modules/FindSmbClient.cmake b/cmake/modules/FindSmbClient.cmake
index 70492ff..fde48ab 100644
--- a/cmake/modules/FindSmbClient.cmake
+++ b/cmake/modules/FindSmbClient.cmake
@@ -32,6 +32,9 @@ find_package_handle_standard_args(SmbClient
32 32
33if(SMBCLIENT_FOUND) 33if(SMBCLIENT_FOUND)
34 set(SMBCLIENT_LIBRARIES ${SMBCLIENT_LIBRARY}) 34 set(SMBCLIENT_LIBRARIES ${SMBCLIENT_LIBRARY})
35 if(${SMBCLIENT_LIBRARY} MATCHES ".+\.a$" AND PC_SMBCLIENT_STATIC_LIBRARIES)
36 list(APPEND SMBCLIENT_LIBRARIES ${PC_SMBCLIENT_STATIC_LIBRARIES})
37 endif()
35 set(SMBCLIENT_INCLUDE_DIRS ${SMBCLIENT_INCLUDE_DIR}) 38 set(SMBCLIENT_INCLUDE_DIRS ${SMBCLIENT_INCLUDE_DIR})
36 set(SMBCLIENT_DEFINITIONS -DHAS_FILESYSTEM_SMB=1) 39 set(SMBCLIENT_DEFINITIONS -DHAS_FILESYSTEM_SMB=1)
37 40
diff --git a/cmake/modules/FindSpdlog.cmake b/cmake/modules/FindSpdlog.cmake
new file mode 100644
index 0000000..270e486
--- /dev/null
+++ b/cmake/modules/FindSpdlog.cmake
@@ -0,0 +1,107 @@
1# FindSpdlog
2# -------
3# Finds the Spdlog library
4#
5# This will define the following variables:
6#
7# SPDLOG_FOUND - system has Spdlog
8# SPDLOG_INCLUDE_DIRS - the Spdlog include directory
9# SPDLOG_LIBRARIES - the Spdlog libraries
10# SPDLOG_DEFINITIONS - the Spdlog compile definitions
11#
12# and the following imported targets:
13#
14# Spdlog::Spdlog - The Spdlog library
15
16if(ENABLE_INTERNAL_SPDLOG)
17 include(ExternalProject)
18 file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/libspdlog/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$")
19 string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" SPDLOG_VERSION "${VER}")
20
21 # allow user to override the download URL with a local tarball
22 # needed for offline build envs
23 if(SPDLOG_URL)
24 get_filename_component(SPDLOG_URL "${SPDLOG_URL}" ABSOLUTE)
25 else()
26 set(SPDLOG_URL http://mirrors.kodi.tv/build-deps/sources/spdlog-${SPDLOG_VERSION}.tar.gz)
27 endif()
28 if(VERBOSE)
29 message(STATUS "SPDLOG_URL: ${SPDLOG_URL}")
30 endif()
31
32 if(APPLE)
33 set(EXTRA_ARGS "-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}")
34 endif()
35
36 set(SPDLOG_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libspdlog.a)
37 set(SPDLOG_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include)
38
39 externalproject_add(spdlog
40 URL ${SPDLOG_URL}
41 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
42 PATCH_COMMAND patch -p1 -i ${CMAKE_SOURCE_DIR}/tools/depends/target/libspdlog/0001-fix_fmt_version.patch
43 PREFIX ${CORE_BUILD_DIR}/spdlog
44 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
45 -DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}
46 -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
47 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
48 -DCMAKE_INSTALL_LIBDIR=lib
49 -DSPDLOG_BUILD_EXAMPLE=OFF
50 -DSPDLOG_BUILD_TESTS=OFF
51 -DSPDLOG_BUILD_BENCH=OFF
52 -DSPDLOG_FMT_EXTERNAL=ON
53 -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
54 "${EXTRA_ARGS}"
55 BUILD_BYPRODUCTS ${SPDLOG_LIBRARY})
56 set_target_properties(spdlog PROPERTIES FOLDER "External Projects")
57
58 if(ENABLE_INTERNAL_FMT)
59 add_dependencies(spdlog fmt)
60 endif()
61else()
62 find_package(spdlog 1.5.0 CONFIG REQUIRED QUIET)
63
64 if(PKG_CONFIG_FOUND)
65 pkg_check_modules(PC_SPDLOG spdlog QUIET)
66 set(SPDLOG_VERSION ${PC_SPDLOG_VERSION})
67 endif()
68
69 find_path(SPDLOG_INCLUDE_DIR NAMES spdlog/spdlog.h
70 PATHS ${PC_SPDLOG_INCLUDEDIR})
71
72 find_library(SPDLOG_LIBRARY_RELEASE NAMES spdlog
73 PATHS ${PC_SPDLOG_LIBDIR})
74 find_library(SPDLOG_LIBRARY_DEBUG NAMES spdlogd
75 PATHS ${PC_SPDLOG_LIBDIR})
76
77 include(SelectLibraryConfigurations)
78 select_library_configurations(SPDLOG)
79endif()
80
81include(FindPackageHandleStandardArgs)
82find_package_handle_standard_args(Spdlog
83 REQUIRED_VARS SPDLOG_LIBRARY SPDLOG_INCLUDE_DIR
84 VERSION_VAR SPDLOG_VERSION)
85
86if(SPDLOG_FOUND)
87 set(SPDLOG_LIBRARIES ${SPDLOG_LIBRARY})
88 set(SPDLOG_INCLUDE_DIRS ${SPDLOG_INCLUDE_DIR})
89 set(SPDLOG_DEFINITIONS -DSPDLOG_FMT_EXTERNAL
90 -DSPDLOG_DEBUG_ON
91 -DSPDLOG_NO_ATOMIC_LEVELS
92 -DSPDLOG_ENABLE_PATTERN_PADDING)
93 if(WIN32)
94 list(APPEND SPDLOG_DEFINITIONS -DSPDLOG_WCHAR_FILENAMES
95 -DSPDLOG_WCHAR_TO_UTF8_SUPPORT)
96 endif()
97
98 if(NOT TARGET Spdlog::Spdlog)
99 add_library(Spdlog::Spdlog UNKNOWN IMPORTED)
100 set_target_properties(Spdlog::Spdlog PROPERTIES
101 IMPORTED_LOCATION "${SPDLOG_LIBRARY}"
102 INTERFACE_INCLUDE_DIRECTORIES "${SPDLOG_INCLUDE_DIR}"
103 INTERFACE_COMPILE_DEFINITIONS "${SPDLOG_DEFINITIONS}")
104 endif()
105endif()
106
107mark_as_advanced(SPDLOG_INCLUDE_DIR SPDLOG_LIBRARY)
diff --git a/cmake/modules/FindUdfread.cmake b/cmake/modules/FindUdfread.cmake
new file mode 100644
index 0000000..20fb322
--- /dev/null
+++ b/cmake/modules/FindUdfread.cmake
@@ -0,0 +1,78 @@
1#.rst:
2# FindUdfread
3# --------
4# Finds the udfread library
5#
6# This will define the following variables::
7#
8# UDFREAD_FOUND - system has udfread
9# UDFREAD_INCLUDE_DIRS - the udfread include directory
10# UDFREAD_LIBRARIES - the udfread libraries
11# UDFREAD_DEFINITIONS - the udfread definitions
12
13if(PKG_CONFIG_FOUND)
14 pkg_check_modules(PC_UDFREAD udfread>=1.0.0 QUIET)
15endif()
16
17find_path(UDFREAD_INCLUDE_DIR NAMES udfread/udfread.h
18 PATHS ${PC_UDFREAD_INCLUDEDIR})
19
20find_library(UDFREAD_LIBRARY NAMES udfread libudfread
21 PATHS ${PC_UDFREAD_LIBDIR})
22
23set(UDFREAD_VERSION ${PC_UDFREAD_VERSION})
24
25if(ENABLE_INTERNAL_UDFREAD)
26 include(ExternalProject)
27
28 # Extract version
29 file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/libudfread/UDFREAD-VERSION VER)
30
31 string(REGEX MATCH "VERSION=[^ ]*$.*" UDFREAD_VER "${VER}")
32 list(GET UDFREAD_VER 0 UDFREAD_VER)
33 string(SUBSTRING "${UDFREAD_VER}" 8 -1 UDFREAD_VER)
34
35 # allow user to override the download URL with a local tarball
36 # needed for offline build envs
37 if(UDFREAD_URL)
38 get_filename_component(UDFREAD_URL "${UDFREAD_URL}" ABSOLUTE)
39 else()
40 set(UDFREAD_URL http://mirrors.kodi.tv/build-deps/sources/libudfread-${UDFREAD_VER}.tar.gz)
41 endif()
42
43 if(VERBOSE)
44 message(STATUS "UDFREAD_URL: ${UDFREAD_URL}")
45 endif()
46
47 set(UDFREAD_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libudfread.a)
48 set(UDFREAD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include)
49 set(UDFREAD_VERSION ${UDFREAD_VER})
50
51 externalproject_add(udfread
52 URL ${UDFREAD_URL}
53 DOWNLOAD_NAME libudfread-${UDFREAD_VER}.tar.gz
54 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
55 PREFIX ${CORE_BUILD_DIR}/libudfread
56 CONFIGURE_COMMAND autoreconf -vif &&
57 ./configure
58 --enable-static
59 --disable-shared
60 --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
61 BUILD_BYPRODUCTS ${UDFREAD_LIBRARY}
62 BUILD_IN_SOURCE 1)
63
64 set_target_properties(udfread PROPERTIES FOLDER "External Projects")
65endif()
66
67include(FindPackageHandleStandardArgs)
68find_package_handle_standard_args(Udfread
69 REQUIRED_VARS UDFREAD_LIBRARY UDFREAD_INCLUDE_DIR
70 VERSION_VAR UDFREAD_VERSION)
71
72if(UDFREAD_FOUND)
73 set(UDFREAD_LIBRARIES ${UDFREAD_LIBRARY})
74 set(UDFREAD_INCLUDE_DIRS ${UDFREAD_INCLUDE_DIR})
75 set(UDFREAD_DEFINITIONS -DHAS_UDFREAD=1)
76endif()
77
78mark_as_advanced(UDFREAD_INCLUDE_DIR UDFREAD_LIBRARY)
diff --git a/cmake/platform/android/defines.txt b/cmake/platform/android/defines.txt
index fa103d0..4b70e59 100644
--- a/cmake/platform/android/defines.txt
+++ b/cmake/platform/android/defines.txt
@@ -1 +1 @@
-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID -DTARGET_POSIX -DTARGET_LINUX -DTARGET_ANDROID
diff --git a/cmake/platform/darwin_embedded/defines.txt b/cmake/platform/darwin_embedded/defines.txt
new file mode 100644
index 0000000..603d749
--- /dev/null
+++ b/cmake/platform/darwin_embedded/defines.txt
@@ -0,0 +1 @@
-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_EMBEDDED
diff --git a/cmake/platform/ios/ios.cmake b/cmake/platform/darwin_embedded/ios.cmake
index 75c9b7b..4c377b7 100644
--- a/cmake/platform/ios/ios.cmake
+++ b/cmake/platform/darwin_embedded/ios.cmake
@@ -1,2 +1,3 @@
1set(PLATFORM_REQUIRED_DEPS OpenGLES) 1set(PLATFORM_REQUIRED_DEPS OpenGLES)
2set(APP_RENDER_SYSTEM gles) 2set(APP_RENDER_SYSTEM gles)
3list(APPEND PLATFORM_DEFINES -DTARGET_DARWIN_IOS)
diff --git a/cmake/platform/darwin_embedded/tvos.cmake b/cmake/platform/darwin_embedded/tvos.cmake
new file mode 100644
index 0000000..b29ed32
--- /dev/null
+++ b/cmake/platform/darwin_embedded/tvos.cmake
@@ -0,0 +1,3 @@
1set(PLATFORM_REQUIRED_DEPS OpenGLES)
2set(APP_RENDER_SYSTEM gles)
3list(APPEND PLATFORM_DEFINES -DTARGET_DARWIN_TVOS)
diff --git a/cmake/platform/freebsd/defines.txt b/cmake/platform/freebsd/defines.txt
index 9483597..bd23e57 100644
--- a/cmake/platform/freebsd/defines.txt
+++ b/cmake/platform/freebsd/defines.txt
@@ -1 +1 @@
-DTARGET_POSIX -DTARGET_FREEBSD -D_LINUX -DTARGET_POSIX -DTARGET_FREEBSD
diff --git a/cmake/platform/freebsd/gbm.cmake b/cmake/platform/freebsd/gbm.cmake
index b273a06..2d20731 100644
--- a/cmake/platform/freebsd/gbm.cmake
+++ b/cmake/platform/freebsd/gbm.cmake
@@ -1 +1,2 @@
1include(cmake/platform/linux/gbm.cmake) 1include(cmake/platform/linux/gbm.cmake)
2list(APPEND PLATFORM_REQUIRED_DEPS EpollShim)
diff --git a/cmake/platform/ios/defines.txt b/cmake/platform/ios/defines.txt
deleted file mode 100644
index d0989ea..0000000
--- a/cmake/platform/ios/defines.txt
+++ /dev/null
@@ -1 +0,0 @@
1-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS -D_LINUX
diff --git a/cmake/platform/linux/aml.cmake b/cmake/platform/linux/aml.cmake
deleted file mode 100644
index a151226..0000000
--- a/cmake/platform/linux/aml.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
1set(PLATFORM_REQUIRED_DEPS OpenGLES AML EGL LibInput Xkbcommon)
2set(APP_RENDER_SYSTEM gles)
3list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS)
diff --git a/cmake/platform/linux/defines.txt b/cmake/platform/linux/defines.txt
index 3fe9c5c..88d2e6e 100644
--- a/cmake/platform/linux/defines.txt
+++ b/cmake/platform/linux/defines.txt
@@ -1 +1 @@
-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -fPIC -DTARGET_POSIX -DTARGET_LINUX -fPIC
diff --git a/cmake/platform/linux/gbm.cmake b/cmake/platform/linux/gbm.cmake
index e5b44ad..75b23f3 100644
--- a/cmake/platform/linux/gbm.cmake
+++ b/cmake/platform/linux/gbm.cmake
@@ -14,4 +14,4 @@ else()
14endif() 14endif()
15 15
16# __GBM__ is needed by eglplatform.h in case it is included before gbm.h 16# __GBM__ is needed by eglplatform.h in case it is included before gbm.h
17list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS -D__GBM__=1 -DPLATFORM_SETTINGS_FILE=gbm.xml) 17list(APPEND PLATFORM_DEFINES -DMESA_EGL_NO_X11_HEADERS -DEGL_NO_X11 -D__GBM__=1 -DPLATFORM_SETTINGS_FILE=gbm.xml)
diff --git a/cmake/platform/linux/x11.cmake b/cmake/platform/linux/x11.cmake
index 72d9640..5d7f3d4 100644
--- a/cmake/platform/linux/x11.cmake
+++ b/cmake/platform/linux/x11.cmake
@@ -1,4 +1,17 @@
1set(PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM) 1set(PLATFORM_REQUIRED_DEPS EGL X XRandR LibDRM)
2set(PLATFORM_OPTIONAL_DEPS VAAPI VDPAU GLX) 2set(PLATFORM_OPTIONAL_DEPS VAAPI)
3set(APP_RENDER_SYSTEM gl) 3
4set(X11_RENDER_SYSTEM "" CACHE STRING "Render system to use with X11: \"gl\" or \"gles\"")
5
6if(X11_RENDER_SYSTEM STREQUAL "gl")
7 list(APPEND PLATFORM_REQUIRED_DEPS OpenGl)
8 list(APPEND PLATFORM_OPTIONAL_DEPS GLX VDPAU)
9 set(APP_RENDER_SYSTEM gl)
10elseif(X11_RENDER_SYSTEM STREQUAL "gles")
11 list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES)
12 set(APP_RENDER_SYSTEM gles)
13else()
14 message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the X11 windowing system. Please set X11_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".")
15endif()
16
4list(APPEND PLATFORM_DEFINES -DPLATFORM_SETTINGS_FILE=x11.xml) \ No newline at end of file 17list(APPEND PLATFORM_DEFINES -DPLATFORM_SETTINGS_FILE=x11.xml) \ No newline at end of file
diff --git a/cmake/platform/osx/defines.txt b/cmake/platform/osx/defines.txt
index 33b009e..8ebb2ba 100644
--- a/cmake/platform/osx/defines.txt
+++ b/cmake/platform/osx/defines.txt
@@ -1 +1 @@
-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX
diff --git a/cmake/scripts/android/ArchSetup.cmake b/cmake/scripts/android/ArchSetup.cmake
index 69bb88d..1e529de 100644
--- a/cmake/scripts/android/ArchSetup.cmake
+++ b/cmake/scripts/android/ArchSetup.cmake
@@ -2,7 +2,7 @@ if(NOT CMAKE_TOOLCHAIN_FILE)
2 message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${CMAKE_SOURCE_DIR}/cmake/README.md") 2 message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${CMAKE_SOURCE_DIR}/cmake/README.md")
3endif() 3endif()
4 4
5set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID) 5set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -DTARGET_ANDROID)
6set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_LARGEFILE64_SOURCE 6set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_LARGEFILE64_SOURCE
7 -D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64=1) 7 -D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64=1)
8 8
@@ -10,6 +10,7 @@ set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_LARGEFILE64_SOURCE
10set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/android/activity/XBMCApp.cpp) 10set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/android/activity/XBMCApp.cpp)
11 11
12set(PLATFORM_DIR platform/linux) 12set(PLATFORM_DIR platform/linux)
13set(PLATFORMDEFS_DIR platform/posix)
13if(WITH_ARCH) 14if(WITH_ARCH)
14 set(ARCH ${WITH_ARCH}) 15 set(ARCH ${WITH_ARCH})
15else() 16else()
@@ -26,16 +27,18 @@ else()
26 elseif(CPU STREQUAL i686) 27 elseif(CPU STREQUAL i686)
27 set(ARCH i486-linux) 28 set(ARCH i486-linux)
28 set(NEON False) 29 set(NEON False)
30 elseif(CPU STREQUAL x86_64)
31 set(ARCH x86_64)
32 set(NEON False)
29 else() 33 else()
30 message(SEND_ERROR "Unknown CPU: ${CPU}") 34 message(SEND_ERROR "Unknown CPU: ${CPU}")
31 endif() 35 endif()
32endif() 36endif()
33 37
34# Additional SYSTEM_DEFINES 38# Additional SYSTEM_DEFINES
35list(APPEND SYSTEM_DEFINES -DHAS_ZEROCONF -DHAS_LINUX_NETWORK) 39list(APPEND SYSTEM_DEFINES -DHAS_ZEROCONF)
36 40
37set(ENABLE_X11 OFF CACHE BOOL "" FORCE) 41set(ENABLE_X11 OFF CACHE BOOL "" FORCE)
38set(ENABLE_AML OFF CACHE BOOL "" FORCE)
39set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) 42set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE)
40set(ENABLE_MDNS OFF CACHE BOOL "" FORCE) 43set(ENABLE_MDNS OFF CACHE BOOL "" FORCE)
41 44
diff --git a/cmake/scripts/android/Install.cmake b/cmake/scripts/android/Install.cmake
index a121295..5b7b411 100644
--- a/cmake/scripts/android/Install.cmake
+++ b/cmake/scripts/android/Install.cmake
@@ -107,7 +107,7 @@ add_custom_target(bundle
107 ${CMAKE_BINARY_DIR}/tools/android/packaging/media 107 ${CMAKE_BINARY_DIR}/tools/android/packaging/media
108 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tools/android/packaging/xbmc/res 108 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tools/android/packaging/xbmc/res
109 ${CMAKE_BINARY_DIR}/tools/android/packaging/xbmc/res 109 ${CMAKE_BINARY_DIR}/tools/android/packaging/xbmc/res
110 COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/lib/python2.7 ${libdir}/python2.7 110 COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/lib/python${PYTHON_VERSION} ${libdir}/python${PYTHON_VERSION}
111 COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/share/${APP_NAME_LC} ${datadir}/${APP_NAME_LC} 111 COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/share/${APP_NAME_LC} ${datadir}/${APP_NAME_LC}
112 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}> 112 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}>
113 ${libdir}/${APP_NAME_LC}/$<TARGET_FILE_NAME:${APP_NAME_LC}>) 113 ${libdir}/${APP_NAME_LC}/$<TARGET_FILE_NAME:${APP_NAME_LC}>)
@@ -153,13 +153,12 @@ foreach(lib IN LISTS required_dyload dyload_optional ITEMS Shairplay)
153 endif() 153 endif()
154endforeach() 154endforeach()
155add_bundle_file(${ASS_LIBRARY} ${libdir} "") 155add_bundle_file(${ASS_LIBRARY} ${libdir} "")
156add_bundle_file(${BLURAY_LIBRARY} ${libdir} "") 156add_bundle_file(${SHAIRPLAY_LIBRARY} ${libdir} "")
157add_bundle_file(${SMBCLIENT_LIBRARY} ${libdir} "") 157add_bundle_file(${SMBCLIENT_LIBRARY} ${libdir} "")
158 158
159# Main targets from Makefile.in 159# Main targets from Makefile.in
160if(CPU MATCHES i686) 160if(CPU MATCHES i686)
161 set(CPU x86) 161 set(CPU x86)
162 set(ARCH x86)
163endif() 162endif()
164foreach(target apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb apk-clean apk-sign) 163foreach(target apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb apk-clean apk-sign)
165 add_custom_target(${target} 164 add_custom_target(${target}
@@ -168,7 +167,6 @@ foreach(target apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb apk-clean
168 CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} 167 CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
169 CC=${CMAKE_C_COMPILER} 168 CC=${CMAKE_C_COMPILER}
170 CPU=${CPU} 169 CPU=${CPU}
171 ARCH=${ARCH}
172 HOST=${HOST} 170 HOST=${HOST}
173 TOOLCHAIN=${TOOLCHAIN} 171 TOOLCHAIN=${TOOLCHAIN}
174 PREFIX=${prefix} 172 PREFIX=${prefix}
diff --git a/cmake/scripts/common/AddonHelpers.cmake b/cmake/scripts/common/AddonHelpers.cmake
index 2f3f302..c541ad7 100644
--- a/cmake/scripts/common/AddonHelpers.cmake
+++ b/cmake/scripts/common/AddonHelpers.cmake
@@ -92,6 +92,7 @@ macro (build_addon target prefix libs)
92 endforeach() 92 endforeach()
93 endif() 93 endif()
94 94
95 message(STATUS "Addon dependency check ...")
95 # Set defines used in addon.xml.in and read from versions.h to set add-on 96 # Set defines used in addon.xml.in and read from versions.h to set add-on
96 # version parts automatically 97 # version parts automatically
97 file(STRINGS ${KODI_INCLUDE_DIR}/versions.h BIN_ADDON_PARTS) 98 file(STRINGS ${KODI_INCLUDE_DIR}/versions.h BIN_ADDON_PARTS)
@@ -108,7 +109,8 @@ macro (build_addon target prefix libs)
108 if("${include_name}" MATCHES "_DEPENDS") 109 if("${include_name}" MATCHES "_DEPENDS")
109 # Use start definition name as base for other value type 110 # Use start definition name as base for other value type
110 list(GET loop_var 0 list_name) 111 list(GET loop_var 0 list_name)
111 string(REPLACE "_DEPENDS" "" depends_name ${list_name}) 112 string(REPLACE "_DEPENDS" "_MIN" depends_minver ${list_name})
113 string(REPLACE "_DEPENDS" "" depends_ver ${list_name})
112 string(REPLACE "_DEPENDS" "_XML_ID" xml_entry_name ${list_name}) 114 string(REPLACE "_DEPENDS" "_XML_ID" xml_entry_name ${list_name})
113 string(REPLACE "_DEPENDS" "_USED" used_type_name ${list_name}) 115 string(REPLACE "_DEPENDS" "_USED" used_type_name ${list_name})
114 116
@@ -120,16 +122,14 @@ macro (build_addon target prefix libs)
120 foreach(src_file ${USED_SOURCES}) 122 foreach(src_file ${USED_SOURCES})
121 file(STRINGS ${src_file} BIN_ADDON_SRC_PARTS) 123 file(STRINGS ${src_file} BIN_ADDON_SRC_PARTS)
122 foreach(loop_var ${BIN_ADDON_SRC_PARTS}) 124 foreach(loop_var ${BIN_ADDON_SRC_PARTS})
123 string(FIND "${loop_var}" "#include" matchres) 125 string(REGEX MATCH "^[ \t]*#[ \t]*(include|import)[ \t]*[<\"](kodi\/)?(.+)[\">]" include_name "${loop_var}")
124 if("${matchres}" EQUAL 0) 126 if(include_name AND CMAKE_MATCH_3 MATCHES ^${depend_header})
125 string(REPLACE " " ";" loop_var "${loop_var}") 127 get_directory_property(CURRENT_DEFS COMPILE_DEFINITIONS)
126 list(GET loop_var 1 include_name) 128 if(NOT used_type_name IN_LIST CURRENT_DEFS)
127 string(REGEX REPLACE "[<>\"]|kodi/" "" include_name "${include_name}") 129 set(ADDON_DEPENDS "${ADDON_DEPENDS}\n<import addon=\"${${xml_entry_name}}\" minversion=\"${${depends_minver}}\" version=\"${${depends_ver}}\"/>")
128 if(include_name MATCHES ${depend_header}) 130 # Inform with them the addon header about used type, if not present before
129 set(ADDON_DEPENDS "${ADDON_DEPENDS}\n<import addon=\"${${xml_entry_name}}\" version=\"${${depends_name}}\"/>")
130 # Inform with them the addon header about used type
131 add_definitions(-D${used_type_name}) 131 add_definitions(-D${used_type_name})
132 message(STATUS "Added usage definition: ${used_type_name}") 132 message(STATUS " - Added API usage definition: ${used_type_name} (Version: \"${${depends_ver}}\", Min. Version: \"${${depends_minver}}\")")
133 set(FOUND_HEADER_USAGE 1) 133 set(FOUND_HEADER_USAGE 1)
134 endif() 134 endif()
135 endif() 135 endif()
@@ -276,6 +276,18 @@ macro (build_addon target prefix libs)
276 install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${target} 276 install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${target}
277 COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) 277 COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG})
278 endif() 278 endif()
279 if(${prefix}_ADDITIONAL_BINARY_EXE)
280 install(PROGRAMS ${${prefix}_ADDITIONAL_BINARY_EXE} DESTINATION ${target}
281 COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG})
282 endif()
283 if(${prefix}_ADDITIONAL_BINARY_PARTS)
284 install(FILES ${${prefix}_ADDITIONAL_BINARY_PARTS} DESTINATION ${target}
285 COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG})
286 endif()
287 if(${prefix}_ADDITIONAL_BINARY_DIRS)
288 install(DIRECTORY ${${prefix}_ADDITIONAL_BINARY_DIRS} DESTINATION ${target} USE_SOURCE_PERMISSIONS
289 COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG})
290 endif()
279 else() # NOT WIN32 291 else() # NOT WIN32
280 if(NOT CPACK_PACKAGE_DIRECTORY) 292 if(NOT CPACK_PACKAGE_DIRECTORY)
281 set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}) 293 set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR})
@@ -296,6 +308,18 @@ macro (build_addon target prefix libs)
296 install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${target} 308 install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${target}
297 COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) 309 COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG})
298 endif() 310 endif()
311 if(${prefix}_ADDITIONAL_BINARY_EXE)
312 install(PROGRAMS ${${prefix}_ADDITIONAL_BINARY_EXE} DESTINATION ${target}
313 COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG})
314 endif()
315 if(${prefix}_ADDITIONAL_BINARY_PARTS)
316 install(FILES ${${prefix}_ADDITIONAL_BINARY_PARTS} DESTINATION ${target}
317 COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG})
318 endif()
319 if(${prefix}_ADDITIONAL_BINARY_DIRS)
320 install(DIRECTORY ${${prefix}_ADDITIONAL_BINARY_DIRS} DESTINATION ${target} USE_SOURCE_PERMISSIONS
321 COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG})
322 endif()
299 endif() 323 endif()
300 add_cpack_workaround(${target} ${${prefix}_VERSION} ${ext}) 324 add_cpack_workaround(${target} ${${prefix}_VERSION} ${ext})
301 else() 325 else()
@@ -339,6 +363,15 @@ macro (build_addon target prefix libs)
339 if(${prefix}_ADDITIONAL_BINARY) 363 if(${prefix}_ADDITIONAL_BINARY)
340 install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target}) 364 install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target})
341 endif() 365 endif()
366 if(${prefix}_ADDITIONAL_BINARY_EXE)
367 install(PROGRAMS ${${prefix}_ADDITIONAL_BINARY_EXE} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target})
368 endif()
369 if(${prefix}_ADDITIONAL_BINARY_PARTS)
370 install(FILES ${${prefix}_ADDITIONAL_BINARY_PARTS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target})
371 endif()
372 if(${prefix}_ADDITIONAL_BINARY_DIRS)
373 install(DIRECTORY ${${prefix}_ADDITIONAL_BINARY_DIRS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target} USE_SOURCE_PERMISSIONS)
374 endif()
342 endif() 375 endif()
343 if(${APP_NAME_UC}_BUILD_DIR) 376 if(${APP_NAME_UC}_BUILD_DIR)
344 file(GLOB_RECURSE files ${CMAKE_CURRENT_SOURCE_DIR}/${target}/*) 377 file(GLOB_RECURSE files ${CMAKE_CURRENT_SOURCE_DIR}/${target}/*)
diff --git a/cmake/scripts/common/AddonHelpers.dox b/cmake/scripts/common/AddonHelpers.dox
new file mode 100644
index 0000000..d3acec0
--- /dev/null
+++ b/cmake/scripts/common/AddonHelpers.dox
@@ -0,0 +1,59 @@
1/*!
2\addtogroup cpp_cmake
3
4Kodi which uses it as a library for its binary addons has a special build
5system for this.
6
7To implement this, a CMake macro brought by Kodi is used, this is
8"build_addon (...)". This processes various definitions passed by the addon to
9process the construction.
10
11
12--------------------------------------------------------------------------------
13
14<b>Here a minmal example of the for addon used CMakeLists.txt:</b>
15
16~~~~~~~~~~~~~{.cmake}
17cmake_minimum_required(VERSION 3.5)
18project(example.addon)
19
20set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})
21
22find_package(Kodi REQUIRED)
23
24include_directories(${KODI_INCLUDE_DIR}
25
26set(DEPLIBS ) # Here empty
27set(EXAMPLE_SOURCES src/main.cpp)
28set(EXAMPLE_HEADERS src/main.h)
29
30build_addon((example.addon EXAMPLE DEPLIBS)
31
32include(CPack)
33~~~~~~~~~~~~~
34
35
36--------------------------------------------------------------------------------
37
38This is a list of special variables that can be passed to the macro.
39The parts defined with "*" must be given the second name given to the macro.
40
41Here to define the necessary creation and installation files on addon CMakeLists.txt:
42| Name | Description
43|-----------------------------|-------------------------------------------------
44| *_SOURCES | List of source code files to be complicated.
45| *_HEADERS | List of used source code header files.
46| *_CUSTOM_BINARY | For special cases where an already created library from an external source is inserted, the <b>"* _SOURCES"</b> and <b>"* _HEADERS"</b> are unused in this case.<br>This is currently used primarily on game addons.
47| *_CUSTOM_DATA | To add additional required data from a folder, which are stored in the shared folder of the addon.<br>With a "/" at the end of the content given to the folder is used, without the folder itself.
48| *_ADDITIONAL_BINARY | In case the additional library has to be installed for the addon, the path or CMake name can be given here.
49| *_ADDITIONAL_BINARY_EXE | In case you need to addon an additional application you can give the path or CMake name, it will be in the same folder as the addon library.<br>The mode bits are set there as EXE.
50| *_ADDITIONAL_BINARY_DIRS | To add complete folders additionally to folders containing the addon library.<br>With a "/" at the end of the content given to the folder is used, without the folder itself.
51
52External creation Options, given by `-D...`:
53| Name | Description
54|-----------------------------|-------------------------------------------------
55| PACKAGE_ZIP | To create a package as a ZIP file. This is also used to install locally addon together.<br>Default is OFF.
56| PACKAGE_TGZ | To create a package as a TGZ file.<br>Default is OFF.
57| BUILD_SHARED_LIBS | To define if addon library is shared or static.<br>Default is ON to have shared.
58| USE_LTO | Use link time optimization.<br>Default is OFF.
59*/
diff --git a/cmake/scripts/common/ArchSetup.cmake b/cmake/scripts/common/ArchSetup.cmake
index 07ce6d4..2e1eb12 100644
--- a/cmake/scripts/common/ArchSetup.cmake
+++ b/cmake/scripts/common/ArchSetup.cmake
@@ -18,24 +18,7 @@ include(CheckCXXSourceCompiles)
18include(CheckSymbolExists) 18include(CheckSymbolExists)
19include(CheckFunctionExists) 19include(CheckFunctionExists)
20include(CheckIncludeFile) 20include(CheckIncludeFile)
21 21include(CheckTypeSize)
22# Macro to check if a given type exists in a given header
23# Arguments:
24# header the header to check
25# type the type to check for existence
26# var the compiler definition to set if type exists
27# On return:
28# If type was found, the definition is added to SYSTEM_DEFINES
29macro(check_type header type var)
30 check_cxx_source_compiles("#include <${header}>
31 int main()
32 {
33 ${type} s;
34 }" ${var})
35 if(${var})
36 list(APPEND SYSTEM_DEFINES -D${var}=1)
37 endif()
38endmacro()
39 22
40# Macro to check if a given builtin function exists 23# Macro to check if a given builtin function exists
41# Arguments: 24# Arguments:
@@ -95,17 +78,12 @@ endif()
95include(${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake) 78include(${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake)
96 79
97message(STATUS "Core system type: ${CORE_SYSTEM_NAME}") 80message(STATUS "Core system type: ${CORE_SYSTEM_NAME}")
98message(STATUS "Platform: ${PLATFORM}") 81message(STATUS "Platform: ${CORE_PLATFORM_NAME}")
99message(STATUS "CPU: ${CPU}, ARCH: ${ARCH}") 82message(STATUS "CPU: ${CPU}, ARCH: ${ARCH}")
100message(STATUS "Cross-Compiling: ${CMAKE_CROSSCOMPILING}") 83message(STATUS "Cross-Compiling: ${CMAKE_CROSSCOMPILING}")
101message(STATUS "Execute build artefacts on host: ${CORE_HOST_IS_TARGET}") 84message(STATUS "Execute build artefacts on host: ${CORE_HOST_IS_TARGET}")
102message(STATUS "Depends based build: ${KODI_DEPENDSBUILD}") 85message(STATUS "Depends based build: ${KODI_DEPENDSBUILD}")
103 86
104check_type(string std::u16string HAVE_STD__U16_STRING)
105check_type(string std::u32string HAVE_STD__U32_STRING)
106check_type(string char16_t HAVE_CHAR16_T)
107check_type(string char32_t HAVE_CHAR32_T)
108check_type(stdint.h uint_least16_t HAVE_STDINT_H)
109check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE) 87check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE)
110check_symbol_exists(PRIdMAX inttypes.h HAVE_INTTYPES_H) 88check_symbol_exists(PRIdMAX inttypes.h HAVE_INTTYPES_H)
111check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH) 89check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH)
diff --git a/cmake/scripts/common/CheckTargetPlatform.cmake b/cmake/scripts/common/CheckTargetPlatform.cmake
index 526e4bd..d776085 100644
--- a/cmake/scripts/common/CheckTargetPlatform.cmake
+++ b/cmake/scripts/common/CheckTargetPlatform.cmake
@@ -29,7 +29,10 @@ function(check_target_platform dir target_platform build)
29 string(SUBSTRING ${platform} 1 ${platform_length} platform) 29 string(SUBSTRING ${platform} 1 ${platform_length} platform)
30 30
31 # check if the current platform does not match the extracted platform 31 # check if the current platform does not match the extracted platform
32 if(NOT ${platform} STREQUAL ${target_platform}) 32 if(${platform} STREQUAL ${target_platform})
33 set(${build} FALSE)
34 break()
35 elseif(NOT ${platform} STREQUAL ${target_platform})
33 set(${build} TRUE) 36 set(${build} TRUE)
34 endif() 37 endif()
35 endif() 38 endif()
diff --git a/cmake/scripts/common/CompilerSettings.cmake b/cmake/scripts/common/CompilerSettings.cmake
new file mode 100644
index 0000000..b4e7e89
--- /dev/null
+++ b/cmake/scripts/common/CompilerSettings.cmake
@@ -0,0 +1,7 @@
1# Languages and global compiler settings
2if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 14)
3 set(CMAKE_CXX_STANDARD 14)
4endif()
5set(CMAKE_CXX_STANDARD_REQUIRED ON)
6set(CMAKE_CXX_EXTENSIONS OFF)
7set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp")
diff --git a/cmake/scripts/common/GenerateVersionedFiles.cmake b/cmake/scripts/common/GenerateVersionedFiles.cmake
index 1d324db..d54b524 100644
--- a/cmake/scripts/common/GenerateVersionedFiles.cmake
+++ b/cmake/scripts/common/GenerateVersionedFiles.cmake
@@ -24,9 +24,6 @@ foreach(loop_var ${ADDON_XML_IN_FILE})
24 string(REPLACE ${CORE_SOURCE_DIR} ${CMAKE_BINARY_DIR} dest_dir ${source_dir}) 24 string(REPLACE ${CORE_SOURCE_DIR} ${CMAKE_BINARY_DIR} dest_dir ${source_dir})
25 file(MAKE_DIRECTORY ${dest_dir}) 25 file(MAKE_DIRECTORY ${dest_dir})
26 26
27 # copy everything except addon.xml.in to build folder
28 file(COPY "${source_dir}" DESTINATION "${CMAKE_BINARY_DIR}/addons" REGEX ".xml.in" EXCLUDE)
29
30 configure_file(${source_dir}/addon.xml.in ${dest_dir}/addon.xml @ONLY) 27 configure_file(${source_dir}/addon.xml.in ${dest_dir}/addon.xml @ONLY)
31 28
32 unset(source_dir) 29 unset(source_dir)
diff --git a/cmake/scripts/common/HandleDepends.cmake b/cmake/scripts/common/HandleDepends.cmake
index 40e382b..7cacd25 100644
--- a/cmake/scripts/common/HandleDepends.cmake
+++ b/cmake/scripts/common/HandleDepends.cmake
@@ -68,8 +68,8 @@ function(add_addon_depends addon searchpath)
68 -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} 68 -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME}
69 -DENABLE_STATIC=1 69 -DENABLE_STATIC=1
70 -DBUILD_SHARED_LIBS=0) 70 -DBUILD_SHARED_LIBS=0)
71 # windows store args 71 # windows args
72 if (CMAKE_SYSTEM_NAME STREQUAL WindowsStore) 72 if (CMAKE_SYSTEM_NAME STREQUAL WindowsStore OR CMAKE_SYSTEM_NAME STREQUAL Windows)
73 list(APPEND BUILD_ARGS -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} 73 list(APPEND BUILD_ARGS -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
74 -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}) 74 -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION})
75 endif() 75 endif()
@@ -78,8 +78,10 @@ function(add_addon_depends addon searchpath)
78 # make sure we create strings, not lists 78 # make sure we create strings, not lists
79 set(TMP_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_DEFINES}") 79 set(TMP_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_DEFINES}")
80 set(TMP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_DEFINES}") 80 set(TMP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_DEFINES}")
81 set(TMP_EXE_LINKER_FLAGS "-L${OUTPUT_DIR}/lib ${CMAKE_EXE_LINKER_FLAGS}")
81 list(APPEND BUILD_ARGS -DCMAKE_C_FLAGS=${TMP_C_FLAGS} 82 list(APPEND BUILD_ARGS -DCMAKE_C_FLAGS=${TMP_C_FLAGS}
82 -DCMAKE_CXX_FLAGS=${TMP_CXX_FLAGS}) 83 -DCMAKE_CXX_FLAGS=${TMP_CXX_FLAGS}
84 -DCMAKE_EXE_LINKER_FLAGS=${TMP_EXE_LINKER_FLAGS})
83 endif() 85 endif()
84 86
85 if(CMAKE_TOOLCHAIN_FILE) 87 if(CMAKE_TOOLCHAIN_FILE)
@@ -88,6 +90,17 @@ function(add_addon_depends addon searchpath)
88 message(${BUILD_ARGS}) 90 message(${BUILD_ARGS})
89 endif() 91 endif()
90 92
93 # used for addons where need special folders to store there content (if
94 # not set the addon define it byself).
95 # e.g. Google Chromium addon where his git bring:
96 # - "unable to create file" ... "Filename too long"
97 # see also WARNING by Windows on: https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart
98 if(THIRD_PARTY_PATH)
99 message(STATUS "Third party lib path specified")
100 message(STATUS ${THIRD_PARTY_PATH})
101 list(APPEND BUILD_ARGS -DTHIRD_PARTY_PATH=${THIRD_PARTY_PATH})
102 endif()
103
91 set(PATCH_COMMAND) 104 set(PATCH_COMMAND)
92 105
93 # if there's a CMakeLists.txt use it to prepare the build 106 # if there's a CMakeLists.txt use it to prepare the build
@@ -215,7 +228,6 @@ function(add_addon_depends addon searchpath)
215 -DOUTPUT_DIR=${OUTPUT_DIR} 228 -DOUTPUT_DIR=${OUTPUT_DIR}
216 -DCMAKE_PREFIX_PATH=${OUTPUT_DIR} 229 -DCMAKE_PREFIX_PATH=${OUTPUT_DIR}
217 -DCMAKE_INSTALL_PREFIX=${OUTPUT_DIR} 230 -DCMAKE_INSTALL_PREFIX=${OUTPUT_DIR}
218 -DCMAKE_EXE_LINKER_FLAGS=-L${OUTPUT_DIR}/lib
219 -DCMAKE_INCLUDE_PATH=${OUTPUT_DIR}/include) 231 -DCMAKE_INCLUDE_PATH=${OUTPUT_DIR}/include)
220 endif() 232 endif()
221 233
diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake
index eefd7c8..f7327e3 100644
--- a/cmake/scripts/common/Macros.cmake
+++ b/cmake/scripts/common/Macros.cmake
@@ -111,26 +111,6 @@ function(core_add_test_library name)
111 endforeach() 111 endforeach()
112endfunction() 112endfunction()
113 113
114# Add an addon callback library
115# Arguments:
116# name name of the library to add
117# Implicit arguments:
118# SOURCES the sources of the library
119# HEADERS the headers of the library (only for IDE support)
120# OTHERS other library related files (only for IDE support)
121# On return:
122# Library target is defined and added to LIBRARY_FILES
123function(core_add_addon_library name)
124 get_filename_component(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} NAME)
125 list(APPEND SOURCES lib${name}.cpp)
126 core_add_shared_library(${name} OUTPUT_DIRECTORY addons/${DIRECTORY})
127 set_target_properties(${name} PROPERTIES FOLDER addons)
128 target_include_directories(${name} PRIVATE
129 ${CMAKE_CURRENT_SOURCE_DIR}
130 ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi
131 ${CMAKE_SOURCE_DIR}/xbmc)
132endfunction()
133
134# Add an dl-loaded shared library 114# Add an dl-loaded shared library
135# Arguments: 115# Arguments:
136# name name of the library to add 116# name name of the library to add
@@ -386,25 +366,6 @@ function(core_require_dep)
386 endforeach() 366 endforeach()
387endfunction() 367endfunction()
388 368
389# add required dyloaded dependencies of main application
390# Arguments:
391# dep_list One or many dependency specifications (see split_dependency_specification)
392# for syntax). The dependency name is used uppercased as variable prefix.
393# On return:
394# dependency added to ${SYSTEM_INCLUDES}, ${dep}_SONAME is set up
395function(core_require_dyload_dep)
396 foreach(depspec ${ARGN})
397 split_dependency_specification(${depspec} dep version)
398 find_package_with_ver(${dep} ${version} REQUIRED)
399 string(TOUPPER ${dep} depup)
400 list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS})
401 list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS})
402 find_soname(${depup} REQUIRED)
403 export_dep()
404 set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE)
405 endforeach()
406endfunction()
407
408# helper macro for optional deps 369# helper macro for optional deps
409macro(setup_enable_switch) 370macro(setup_enable_switch)
410 string(TOUPPER ${dep} depup) 371 string(TOUPPER ${dep} depup)
@@ -450,39 +411,6 @@ function(core_optional_dep)
450 set(final_message ${final_message} PARENT_SCOPE) 411 set(final_message ${final_message} PARENT_SCOPE)
451endfunction() 412endfunction()
452 413
453# add optional dyloaded dependencies of main application
454# Arguments:
455# dep_list One or many dependency specifications (see split_dependency_specification)
456# for syntax). The dependency name is used uppercased as variable prefix.
457# On return:
458# dependency optionally added to ${SYSTEM_INCLUDES}, ${DEP_DEFINES}, ${dep}_SONAME is set up
459function(core_optional_dyload_dep)
460 foreach(depspec ${ARGN})
461 set(_required False)
462 split_dependency_specification(${depspec} dep version)
463 setup_enable_switch()
464 if(${enable_switch} STREQUAL AUTO)
465 find_package_with_ver(${dep} ${version})
466 elseif(${${enable_switch}})
467 find_package_with_ver(${dep} ${version} REQUIRED)
468 set(_required True)
469 endif()
470
471 if(${depup}_FOUND)
472 list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS})
473 find_soname(${depup} REQUIRED)
474 list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS})
475 set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE)
476 export_dep()
477 set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE)
478 elseif(_required)
479 message(FATAL_ERROR "${depup} enabled but not found")
480 else()
481 set(final_message ${final_message} "${depup} enabled: No" PARENT_SCOPE)
482 endif()
483 endforeach()
484endfunction()
485
486function(core_file_read_filtered result filepattern) 414function(core_file_read_filtered result filepattern)
487 # Reads STRINGS from text files 415 # Reads STRINGS from text files
488 # with comments filtered out 416 # with comments filtered out
diff --git a/cmake/scripts/common/PrepareEnv.cmake b/cmake/scripts/common/PrepareEnv.cmake
index 753dca1..559788f 100644
--- a/cmake/scripts/common/PrepareEnv.cmake
+++ b/cmake/scripts/common/PrepareEnv.cmake
@@ -34,6 +34,14 @@ endif()
34 34
35set(PLATFORM_TAG ${CORE_SYSTEM_NAME}) 35set(PLATFORM_TAG ${CORE_SYSTEM_NAME})
36 36
37# The CPU variable is given either by ./tools/depends or by the
38# ./cmake/scripts/common/ArchSetup.cmake (which refers to the Kodi building
39# itself). However, this file is only used by addons, so CPU can not always
40# be defined, so in this case, if empty, the base CPU will be used.
41if(NOT CPU)
42 set(CPU ${CMAKE_SYSTEM_PROCESSOR})
43endif()
44
37if(CORE_SYSTEM_NAME STREQUAL android) 45if(CORE_SYSTEM_NAME STREQUAL android)
38 if (CPU MATCHES "v7a") 46 if (CPU MATCHES "v7a")
39 set(PLATFORM_TAG ${PLATFORM_TAG}-armv7) 47 set(PLATFORM_TAG ${PLATFORM_TAG}-armv7)
@@ -41,13 +49,14 @@ if(CORE_SYSTEM_NAME STREQUAL android)
41 set(PLATFORM_TAG ${PLATFORM_TAG}-aarch64) 49 set(PLATFORM_TAG ${PLATFORM_TAG}-aarch64)
42 elseif (CPU MATCHES "i686") 50 elseif (CPU MATCHES "i686")
43 set(PLATFORM_TAG ${PLATFORM_TAG}-i686) 51 set(PLATFORM_TAG ${PLATFORM_TAG}-i686)
52 elseif (CPU MATCHES "x86_64")
53 set(PLATFORM_TAG ${PLATFORM_TAG}-x86_64)
44 else() 54 else()
45 message(FATAL_ERROR "Unsupported architecture") 55 message(FATAL_ERROR "Unsupported architecture")
46 endif() 56 endif()
47elseif(CORE_SYSTEM_NAME STREQUAL ios) 57elseif(CORE_SYSTEM_NAME STREQUAL darwin_embedded)
48 if (CPU MATCHES armv7) 58 set(PLATFORM_TAG ${CORE_PLATFORM_NAME})
49 set(PLATFORM_TAG ${PLATFORM_TAG}-armv7) 59 if (CPU MATCHES arm64)
50 elseif (CPU MATCHES arm64)
51 set(PLATFORM_TAG ${PLATFORM_TAG}-aarch64) 60 set(PLATFORM_TAG ${PLATFORM_TAG}-aarch64)
52 else() 61 else()
53 message(FATAL_ERROR "Unsupported architecture") 62 message(FATAL_ERROR "Unsupported architecture")
diff --git a/cmake/scripts/darwin/Macros.cmake b/cmake/scripts/darwin/Macros.cmake
new file mode 100644
index 0000000..9a805c4
--- /dev/null
+++ b/cmake/scripts/darwin/Macros.cmake
@@ -0,0 +1,8 @@
1macro(enable_arc)
2 if(CMAKE_GENERATOR STREQUAL Xcode)
3 set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES)
4 else()
5 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fobjc-arc")
6 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc")
7 endif()
8endmacro()
diff --git a/cmake/scripts/ios/ArchSetup.cmake b/cmake/scripts/darwin_embedded/ArchSetup.cmake
index b6c626f..7160da9 100644
--- a/cmake/scripts/ios/ArchSetup.cmake
+++ b/cmake/scripts/darwin_embedded/ArchSetup.cmake
@@ -1,33 +1,33 @@
1if(NOT CMAKE_TOOLCHAIN_FILE) 1if(NOT CMAKE_TOOLCHAIN_FILE)
2 message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for ios. See ${CMAKE_SOURCE_DIR}/cmake/README.md") 2 message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for ios/tvos. See ${CMAKE_SOURCE_DIR}/cmake/README.md")
3endif() 3endif()
4 4
5set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/XBMCApplication.mm) 5set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/${CORE_PLATFORM_NAME_LC}/XBMCApplication.mm)
6set(PLATFORM_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/${CORE_PLATFORM_NAME_LC}/Info.plist.in)
6 7
7set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS) 8set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_EMBEDDED)
9if(CORE_PLATFORM_NAME_LC STREQUAL tvos)
10 list(APPEND ARCH_DEFINES -DTARGET_DARWIN_TVOS)
11else()
12 list(APPEND ARCH_DEFINES -DTARGET_DARWIN_IOS)
13endif()
8set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE 14set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
9 -D__STDC_CONSTANT_MACROS) 15 -D__STDC_CONSTANT_MACROS -DHAS_IOS_NETWORK -DHAS_ZEROCONF)
10set(PLATFORM_DIR platform/linux) 16set(PLATFORM_DIR platform/darwin)
17set(PLATFORMDEFS_DIR platform/posix)
11set(CMAKE_SYSTEM_NAME Darwin) 18set(CMAKE_SYSTEM_NAME Darwin)
12if(WITH_ARCH) 19if(WITH_ARCH)
13 set(ARCH ${WITH_ARCH}) 20 set(ARCH ${WITH_ARCH})
14else() 21else()
15 if(CPU STREQUAL armv7) 22 if(CPU STREQUAL arm64)
16 set(CMAKE_OSX_ARCHITECTURES ${CPU})
17 set(ARCH arm)
18 set(NEON True)
19 elseif(CPU STREQUAL arm64)
20 set(CMAKE_OSX_ARCHITECTURES ${CPU})
21 set(ARCH aarch64) 23 set(ARCH aarch64)
22 set(NEON True)
23 else() 24 else()
24 message(SEND_ERROR "Unknown CPU: ${CPU}") 25 message(SEND_ERROR "Unknown CPU: ${CPU}")
25 endif() 26 endif()
27 set(CMAKE_OSX_ARCHITECTURES ${CPU})
28 set(NEON True)
26endif() 29endif()
27 30
28# Additional SYSTEM_DEFINES
29list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK -DHAS_ZEROCONF)
30
31list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) 31list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX})
32 32
33list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo" 33list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo"
@@ -36,24 +36,28 @@ list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo"
36 "-framework CFNetwork" "-framework CoreGraphics" 36 "-framework CFNetwork" "-framework CoreGraphics"
37 "-framework Foundation" "-framework UIKit" 37 "-framework Foundation" "-framework UIKit"
38 "-framework CoreMedia" "-framework AVFoundation" 38 "-framework CoreMedia" "-framework AVFoundation"
39 "-framework VideoToolbox") 39 "-framework VideoToolbox" "-lresolv" "-ObjC"
40 "-framework AVKit" "-framework GameController")
40 41
41set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) 42set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE)
42 43
43set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "9.0") 44# AppleTV already has built-in AirPlay support
44set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") 45if(CORE_PLATFORM_NAME_LC STREQUAL tvos)
45 46 set(ENABLE_AIRTUNES OFF CACHE BOOL "" FORCE)
47endif()
46set(CMAKE_XCODE_ATTRIBUTE_INLINES_ARE_PRIVATE_EXTERN OFF) 48set(CMAKE_XCODE_ATTRIBUTE_INLINES_ARE_PRIVATE_EXTERN OFF)
47set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN OFF) 49set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN OFF)
48set(CMAKE_XCODE_ATTRIBUTE_COPY_PHASE_STRIP OFF) 50set(CMAKE_XCODE_ATTRIBUTE_COPY_PHASE_STRIP OFF)
49 51
52include(cmake/scripts/darwin/Macros.cmake)
53enable_arc()
54
50# Xcode strips dead code by default which breaks wrapping 55# Xcode strips dead code by default which breaks wrapping
51set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING OFF) 56set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING OFF)
52 57
53# Unify output directories for iOS packaging scripts 58option(ENABLE_XCODE_ADDONBUILD "Enable Xcode automatic addon building?" OFF)
54if(NOT CMAKE_GENERATOR MATCHES Xcode) 59
55 set(CORE_BUILD_CONFIG "${CORE_BUILD_CONFIG}-iphoneos") 60# Unify output directories for iOS/tvOS packaging scripts
56endif()
57set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG}) 61set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG})
58foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) 62foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
59 string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) 63 string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
diff --git a/cmake/scripts/darwin_embedded/ExtraTargets.cmake b/cmake/scripts/darwin_embedded/ExtraTargets.cmake
new file mode 100644
index 0000000..2b9980a
--- /dev/null
+++ b/cmake/scripts/darwin_embedded/ExtraTargets.cmake
@@ -0,0 +1,25 @@
1if(CORE_PLATFORM_NAME_LC STREQUAL tvos)
2 # top shelf extension
3 set(TOPSHELF_EXTENSION_NAME "${APP_NAME_LC}-topshelf")
4 set(TOPSHELF_BUNDLE_EXTENSION appex)
5 set(TOPSHELF_DIR "${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/tvos/TopShelf")
6 # same path as the output Info.plist, taken from cmGlobalXCodeGenerator::ComputeInfoPListLocation()
7 set(ENTITLEMENTS_OUT_PATH "${CMAKE_BINARY_DIR}/CMakeFiles/${TOPSHELF_EXTENSION_NAME}.dir/TopShelf.entitlements")
8
9 set(SOURCES
10 ${TOPSHELF_DIR}/ServiceProvider.m
11 ${TOPSHELF_DIR}/../tvosShared.m)
12 set(HEADERS
13 ${TOPSHELF_DIR}/ServiceProvider.h
14 ${TOPSHELF_DIR}/../tvosShared.h)
15 add_executable(${TOPSHELF_EXTENSION_NAME} MACOSX_BUNDLE ${SOURCES} ${HEADERS})
16
17 configure_file(${TOPSHELF_DIR}/TopShelf.entitlements.in ${ENTITLEMENTS_OUT_PATH} @ONLY)
18 set_target_properties(${TOPSHELF_EXTENSION_NAME} PROPERTIES BUNDLE_EXTENSION ${TOPSHELF_BUNDLE_EXTENSION}
19 MACOSX_BUNDLE_INFO_PLIST ${TOPSHELF_DIR}/Info.plist.in
20 XCODE_PRODUCT_TYPE com.apple.product-type.tv-app-extension
21 XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${ENTITLEMENTS_OUT_PATH})
22 target_link_libraries(${TOPSHELF_EXTENSION_NAME} "-framework TVServices" "-framework Foundation")
23
24 add_dependencies(${APP_NAME_LC} ${TOPSHELF_EXTENSION_NAME})
25endif()
diff --git a/cmake/scripts/darwin_embedded/Install.cmake b/cmake/scripts/darwin_embedded/Install.cmake
new file mode 100644
index 0000000..af18277
--- /dev/null
+++ b/cmake/scripts/darwin_embedded/Install.cmake
@@ -0,0 +1,135 @@
1# IOS/TVOS packaging
2if(CORE_PLATFORM_NAME_LC STREQUAL tvos)
3 # asset catalog
4 set(ASSET_CATALOG "${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/tvos/Assets.xcassets")
5 set(ASSET_CATALOG_ASSETS Assets)
6 set(ASSET_CATALOG_LAUNCH_IMAGE LaunchImage)
7
8 message("generating missing asset catalog images...")
9 execute_process(COMMAND ${CMAKE_SOURCE_DIR}/tools/darwin/Support/GenerateMissingImages-tvos.py "${ASSET_CATALOG}" ${ASSET_CATALOG_ASSETS} ${ASSET_CATALOG_LAUNCH_IMAGE})
10
11 target_sources(${APP_NAME_LC} PRIVATE "${ASSET_CATALOG}")
12 set_source_files_properties("${ASSET_CATALOG}" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") # adds to Copy Bundle Resources build phase
13
14 # entitlements
15 set(ENTITLEMENTS_OUT_PATH "${CMAKE_BINARY_DIR}/CMakeFiles/${APP_NAME_LC}.dir/Kodi.entitlements")
16 configure_file(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/tvos/Kodi.entitlements.in ${ENTITLEMENTS_OUT_PATH} @ONLY)
17
18 set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME ${ASSET_CATALOG_ASSETS}
19 XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME ${ASSET_CATALOG_LAUNCH_IMAGE}
20 XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${ENTITLEMENTS_OUT_PATH})
21
22else()
23 set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/media/splash.jpg
24 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png
25 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png
26 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png
27 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png
28 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png
29 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png
30 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png
31 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png
32 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png
33 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png
34 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png
35 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png
36 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png
37 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png)
38
39 target_sources(${APP_NAME_LC} PRIVATE ${BUNDLE_RESOURCES})
40 foreach(file IN LISTS BUNDLE_RESOURCES)
41 set_source_files_properties(${file} PROPERTIES MACOSX_PACKAGE_LOCATION .)
42 endforeach()
43
44 target_sources(${APP_NAME_LC} PRIVATE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchScreen.storyboard)
45 set_source_files_properties(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchScreen.storyboard PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
46
47endif()
48
49# setup code signing
50# dev team ID / identity (certificate)
51set(DEVELOPMENT_TEAM "" CACHE STRING "Development Team")
52set(CODE_SIGN_IDENTITY $<IF:$<BOOL:${DEVELOPMENT_TEAM}>,iPhone\ Developer,> CACHE STRING "Code Sign Identity")
53
54# app provisioning profile
55set(CODE_SIGN_STYLE_APP Automatic)
56set(PROVISIONING_PROFILE_APP "" CACHE STRING "Provisioning profile name for the Kodi app")
57if(PROVISIONING_PROFILE_APP)
58 set(CODE_SIGN_STYLE_APP Manual)
59endif()
60
61# top shelf provisioning profile
62if(CORE_PLATFORM_NAME_LC STREQUAL tvos)
63 set(CODE_SIGN_STYLE_TOPSHELF Automatic)
64 set(PROVISIONING_PROFILE_TOPSHELF "" CACHE STRING "Provisioning profile name for the Top Shelf")
65 if(PROVISIONING_PROFILE_TOPSHELF)
66 set(CODE_SIGN_STYLE_TOPSHELF Manual)
67 endif()
68 set_target_properties(${TOPSHELF_EXTENSION_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${CODE_SIGN_IDENTITY}"
69 XCODE_ATTRIBUTE_CODE_SIGN_STYLE ${CODE_SIGN_STYLE_TOPSHELF}
70 XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "${DEVELOPMENT_TEAM}"
71 XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "${PROVISIONING_PROFILE_TOPSHELF}")
72 # copy extension inside PlugIns dir of the app bundle
73 add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD
74 COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory $<TARGET_BUNDLE_DIR:${TOPSHELF_EXTENSION_NAME}>
75 $<TARGET_BUNDLE_DIR:${APP_NAME_LC}>/PlugIns/${TOPSHELF_EXTENSION_NAME}.${TOPSHELF_BUNDLE_EXTENSION}
76 MAIN_DEPENDENCY ${TOPSHELF_EXTENSION_NAME})
77endif()
78set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${CODE_SIGN_IDENTITY}"
79 XCODE_ATTRIBUTE_CODE_SIGN_STYLE ${CODE_SIGN_STYLE_APP}
80 XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "${DEVELOPMENT_TEAM}"
81 XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "${PROVISIONING_PROFILE_APP}")
82
83# Create xcode target that allows to build binary-addons.
84if(ADDONS_TO_BUILD)
85 set(_addons "ADDONS=${ADDONS_TO_BUILD}")
86endif()
87add_custom_target(binary-addons
88 COMMAND $(MAKE) -C ${CMAKE_SOURCE_DIR}/tools/depends/target/binary-addons clean
89 COMMAND $(MAKE) -C ${CMAKE_SOURCE_DIR}/tools/depends/target/binary-addons VERBOSE=1 V=99
90 INSTALL_PREFIX="${CMAKE_BINARY_DIR}/addons" CROSS_COMPILING=yes ${_addons})
91if(ENABLE_XCODE_ADDONBUILD)
92 add_dependencies(${APP_NAME_LC} binary-addons)
93endif()
94unset(_addons)
95
96add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD
97 # TODO: Remove in sync with CopyRootFiles-darwin_embedded expecting the ".bin" file
98 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}>
99 $<TARGET_FILE_DIR:${APP_NAME_LC}>/${APP_NAME}.bin
100
101 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h
102 ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h
103 COMMAND "ACTION=build"
104 "APP_NAME=${APP_NAME}"
105 "XBMC_DEPENDS=${DEPENDS_PATH}"
106 ${CMAKE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-darwin_embedded.command
107 COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}"
108 "PYTHON_VERSION=${PYTHON_VERSION}"
109 ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-darwin_embedded.command
110 COMMAND ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-dylibs2frameworks.command
111 COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}"
112 "NATIVEPREFIX=${NATIVEPREFIX}"
113 ${CMAKE_SOURCE_DIR}/tools/darwin/Support/Codesign.command
114)
115
116if(CORE_PLATFORM_NAME_LC STREQUAL tvos)
117 add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD
118 COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/share/${APP_NAME_LC} $<TARGET_FILE_DIR:${APP_NAME_LC}>/AppData/AppHome
119 )
120endif()
121
122set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..)
123configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh.in
124 ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh @ONLY)
125
126if(CORE_PLATFORM_NAME_LC STREQUAL ios)
127 configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/darwin_embedded/migrate_to_kodi.sh.in
128 ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded/migrate_to_kodi.sh @ONLY)
129endif()
130
131add_custom_target(deb
132 COMMAND sh ./mkdeb-darwin_embedded.sh ${CORE_BUILD_CONFIG}
133 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded)
134add_dependencies(deb ${APP_NAME_LC})
135
diff --git a/cmake/scripts/darwin_embedded/Macros.cmake b/cmake/scripts/darwin_embedded/Macros.cmake
new file mode 100644
index 0000000..91f2d86
--- /dev/null
+++ b/cmake/scripts/darwin_embedded/Macros.cmake
@@ -0,0 +1,118 @@
1function(core_link_library lib wraplib)
2 if(CMAKE_GENERATOR MATCHES "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL Ninja)
3 set(wrapper_obj cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o)
4 elseif(CMAKE_GENERATOR MATCHES "Xcode")
5 set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o)
6 else()
7 message(FATAL_ERROR "Unsupported generator in core_link_library")
8 endif()
9
10 set(export -bundle -undefined dynamic_lookup
11 -Wl,-alias_list,${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/wrapper.def
12 ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${wrapper_obj})
13 set(extension ${CMAKE_SHARED_MODULE_SUFFIX})
14 set(check_arg "")
15 if(TARGET ${lib})
16 set(target ${lib})
17 set(link_lib $<TARGET_FILE:${lib}>)
18 set(check_arg ${ARGV2})
19 set(data_arg ${ARGV3})
20
21 # iOS: EFFECTIVE_PLATFORM_NAME is not resolved
22 # http://public.kitware.com/pipermail/cmake/2016-March/063049.html
23 if(CORE_SYSTEM_NAME STREQUAL darwin_embedded)
24 get_target_property(dir ${lib} BINARY_DIR)
25 set(link_lib ${dir}/${CORE_BUILD_CONFIG}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
26 endif()
27 else()
28 set(target ${ARGV2})
29 set(link_lib ${lib})
30 set(check_arg ${ARGV3})
31 set(data_arg ${ARGV4})
32 endif()
33 if(check_arg STREQUAL export)
34 set(export ${export}
35 -Wl,--version-script=${ARGV3})
36 elseif(check_arg STREQUAL extras)
37 foreach(arg ${data_arg})
38 list(APPEND export ${arg})
39 endforeach()
40 elseif(check_arg STREQUAL archives)
41 set(extra_libs ${data_arg})
42 endif()
43 get_filename_component(dir ${wraplib} DIRECTORY)
44
45 # We can't simply pass the linker flags to the args section of the custom command
46 # because cmake will add quotes around it (and the linker will fail due to those).
47 # We need to do this handstand first ...
48 string(REPLACE " " ";" CUSTOM_COMMAND_ARGS_LDFLAGS ${CMAKE_SHARED_LINKER_FLAGS})
49
50 add_custom_command(OUTPUT ${wraplib}-${ARCH}${extension}
51 COMMAND ${CMAKE_COMMAND} -E make_directory ${dir}
52 COMMAND ${CMAKE_C_COMPILER}
53 ARGS ${CUSTOM_COMMAND_ARGS_LDFLAGS} ${export} -Wl,-force_load ${link_lib} ${extra_libs}
54 -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${extension}
55 DEPENDS ${target} wrapper.def wrapper
56 VERBATIM)
57
58 get_filename_component(libname ${wraplib} NAME_WE)
59 add_custom_target(wrap_${libname} ALL DEPENDS ${wraplib}-${ARCH}${extension})
60 set_target_properties(wrap_${libname} PROPERTIES FOLDER lib/wrapped)
61 add_dependencies(${APP_NAME_LC}-libraries wrap_${libname})
62
63 set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${extension} CACHE STRING "" FORCE)
64endfunction()
65
66function(find_soname lib)
67 cmake_parse_arguments(arg "REQUIRED" "" "" ${ARGN})
68
69 string(TOLOWER ${lib} liblow)
70 if(${lib}_LDFLAGS)
71 set(link_lib "${${lib}_LDFLAGS}")
72 else()
73 set(link_lib "${${lib}_LIBRARIES}")
74 endif()
75
76 execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs
77 COMMAND fgrep libraries:
78 COMMAND sed "s/[^=]*=\\(.*\\)/\\1/"
79 COMMAND sed "s/:/ /g"
80 ERROR_QUIET
81 OUTPUT_VARIABLE cc_lib_path
82 OUTPUT_STRIP_TRAILING_WHITESPACE)
83 execute_process(COMMAND echo ${link_lib}
84 COMMAND sed "s/-L[ ]*//g"
85 COMMAND sed "s/-l[^ ]*//g"
86 ERROR_QUIET
87 OUTPUT_VARIABLE env_lib_path
88 OUTPUT_STRIP_TRAILING_WHITESPACE)
89
90 foreach(path ${cc_lib_path} ${env_lib_path})
91 if(IS_DIRECTORY ${path})
92 execute_process(COMMAND ls -- ${path}/lib${liblow}.dylib
93 ERROR_QUIET
94 OUTPUT_VARIABLE lib_file
95 OUTPUT_STRIP_TRAILING_WHITESPACE)
96 else()
97 set(lib_file ${path})
98 endif()
99 if(lib_file)
100 # we want the path/name that is embedded in the dylib
101 execute_process(COMMAND otool -L ${lib_file}
102 COMMAND grep -v lib${liblow}.dylib
103 COMMAND grep ${liblow}
104 COMMAND awk "{V=1; print $V}"
105 ERROR_QUIET
106 OUTPUT_VARIABLE filename
107 OUTPUT_STRIP_TRAILING_WHITESPACE)
108 get_filename_component(${lib}_SONAME "${filename}" NAME)
109 if(VERBOSE)
110 message(STATUS "${lib} soname: ${${lib}_SONAME}")
111 endif()
112 endif()
113 endforeach()
114 if(arg_REQUIRED AND NOT ${lib}_SONAME)
115 message(FATAL_ERROR "Could not find dynamically loadable library ${lib}")
116 endif()
117 set(${lib}_SONAME ${${lib}_SONAME} PARENT_SCOPE)
118endfunction()
diff --git a/cmake/scripts/darwin_embedded/PathSetup.cmake b/cmake/scripts/darwin_embedded/PathSetup.cmake
new file mode 100644
index 0000000..efaca0b
--- /dev/null
+++ b/cmake/scripts/darwin_embedded/PathSetup.cmake
@@ -0,0 +1,7 @@
1set(BUNDLE_IDENTIFIER_DESC "Bundle ID")
2if(CORE_PLATFORM_NAME_LC STREQUAL tvos)
3 string(CONCAT BUNDLE_IDENTIFIER_DESC "${BUNDLE_IDENTIFIER_DESC}" " (app, top shelf, group ID)")
4endif()
5set(PLATFORM_BUNDLE_IDENTIFIER "${APP_PACKAGE}-${CORE_PLATFORM_NAME_LC}" CACHE STRING "${BUNDLE_IDENTIFIER_DESC}")
6list(APPEND final_message "Bundle ID: ${PLATFORM_BUNDLE_IDENTIFIER}")
7include(cmake/scripts/osx/PathSetup.cmake)
diff --git a/cmake/scripts/freebsd/ArchSetup.cmake b/cmake/scripts/freebsd/ArchSetup.cmake
index 3d5599c..7da6c51 100644
--- a/cmake/scripts/freebsd/ArchSetup.cmake
+++ b/cmake/scripts/freebsd/ArchSetup.cmake
@@ -1,7 +1,8 @@
1set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_FREEBSD) 1set(ARCH_DEFINES -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 -DHAS_OSS)
4set(PLATFORM_DIR platform/linux) 4set(PLATFORM_DIR platform/linux)
5set(PLATFORMDEFS_DIR platform/posix)
5set(SYSTEM_LDFLAGS -L/usr/local/lib) 6set(SYSTEM_LDFLAGS -L/usr/local/lib)
6if(WITH_ARCH) 7if(WITH_ARCH)
7 set(ARCH ${WITH_ARCH}) 8 set(ARCH ${WITH_ARCH})
@@ -30,4 +31,4 @@ if(NOT ENABLE_ALSA)
30endif() 31endif()
31 32
32# Additional SYSTEM_DEFINES 33# Additional SYSTEM_DEFINES
33list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK) 34list(APPEND SYSTEM_DEFINES -DHAS_POSIX_NETWORK -DHAS_FREEBSD_NETWORK)
diff --git a/cmake/scripts/ios/Install.cmake b/cmake/scripts/ios/Install.cmake
deleted file mode 100644
index 7668e7c..0000000
--- a/cmake/scripts/ios/Install.cmake
+++ /dev/null
@@ -1,99 +0,0 @@
1# IOS packaging
2
3set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1100-Landscape-2436h@3x.png
4 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1100-Portrait-2436h@3x.png
5 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-1792h@2x.png
6 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2224h@2x.png
7 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2224h@2x.png
8 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2388h@2x.png
9 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2388h@2x.png
10 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Landscape-2688h@3x.png
11 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-1792h@2x.png
12 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-1200-Portrait-2688h@3x.png
13 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-568h@2x.png
14 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-568h@2x.png
15 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-Landscape@2x~ipad.png
16 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700-Portrait@2x~ipad.png
17 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-700@2x.png
18 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-667h@2x.png
19 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-Landscape-736h@3x.png
20 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-800-Portrait-736h@3x.png
21 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-Landscape@2x~ipad.png
22 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage-Portrait@2x~ipad.png
23 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchImage@2x.png
24 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png
25 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png
26 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png
27 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png
28 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png
29 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png
30 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png
31 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png
32 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png
33 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png
34 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png
35 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png
36 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png
37 ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png)
38
39target_sources(${APP_NAME_LC} PRIVATE ${BUNDLE_RESOURCES})
40foreach(file IN LISTS BUNDLE_RESOURCES)
41 set_source_files_properties(${file} PROPERTIES MACOSX_PACKAGE_LOCATION .)
42endforeach()
43
44target_sources(${APP_NAME_LC} PRIVATE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings)
45set_source_files_properties(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings PROPERTIES MACOSX_PACKAGE_LOCATION "./English.lproj")
46
47# Options for code signing propagated as env vars to Codesign.command via Xcode
48set(IOS_CODE_SIGN_IDENTITY "" CACHE STRING "Code Sign Identity")
49if(IOS_CODE_SIGN_IDENTITY)
50 set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED TRUE
51 XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${IOS_CODE_SIGN_IDENTITY})
52endif()
53
54add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD
55 # TODO: Remove in sync with CopyRootFiles-ios expecting the ".bin" file
56 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}>
57 $<TARGET_FILE_DIR:${APP_NAME_LC}>/${APP_NAME}.bin
58
59 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h
60 ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h
61 COMMAND "ACTION=build"
62 "TARGET_BUILD_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.."
63 "TARGET_NAME=${APP_NAME}.app"
64 "APP_NAME=${APP_NAME}"
65 "PRODUCT_NAME=${APP_NAME}"
66 "WRAPPER_EXTENSION=app"
67 "SRCROOT=${CMAKE_BINARY_DIR}"
68 ${CMAKE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-ios.command
69 COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}"
70 "TARGET_BUILD_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.."
71 "TARGET_NAME=${APP_NAME}.app"
72 "APP_NAME=${APP_NAME}"
73 "PRODUCT_NAME=${APP_NAME}"
74 "FULL_PRODUCT_NAME=${APP_NAME}.app"
75 "WRAPPER_EXTENSION=app"
76 "SRCROOT=${CMAKE_BINARY_DIR}"
77 ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-ios.command
78 COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}"
79 "NATIVEPREFIX=${NATIVEPREFIX}"
80 "PLATFORM_NAME=${PLATFORM}"
81 "CODESIGNING_FOLDER_PATH=$<TARGET_FILE_DIR:${APP_NAME_LC}>"
82 "BUILT_PRODUCTS_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.."
83 "WRAPPER_NAME=${APP_NAME}.app"
84 "APP_NAME=${APP_NAME}"
85 "CURRENT_ARCH=${ARCH}"
86 ${CMAKE_SOURCE_DIR}/tools/darwin/Support/Codesign.command
87)
88
89set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..)
90configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh.in
91 ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh @ONLY)
92configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh.in
93 ${CMAKE_BINARY_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh @ONLY)
94
95add_custom_target(deb
96 COMMAND sh ./mkdeb-ios.sh ${CORE_BUILD_CONFIG}
97 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios)
98add_dependencies(deb ${APP_NAME_LC})
99
diff --git a/cmake/scripts/ios/Macros.cmake b/cmake/scripts/ios/Macros.cmake
deleted file mode 120000
index 54c1b28..0000000
--- a/cmake/scripts/ios/Macros.cmake
+++ /dev/null
@@ -1 +0,0 @@
1../osx/Macros.cmake \ No newline at end of file
diff --git a/cmake/scripts/ios/PathSetup.cmake b/cmake/scripts/ios/PathSetup.cmake
deleted file mode 120000
index d7f25b2..0000000
--- a/cmake/scripts/ios/PathSetup.cmake
+++ /dev/null
@@ -1 +0,0 @@
1../osx/PathSetup.cmake \ No newline at end of file
diff --git a/cmake/scripts/linux/ArchSetup.cmake b/cmake/scripts/linux/ArchSetup.cmake
index 602ef3d..04fc6e3 100644
--- a/cmake/scripts/linux/ArchSetup.cmake
+++ b/cmake/scripts/linux/ArchSetup.cmake
@@ -1,8 +1,8 @@
1# we always want to use GNU features if available, so set _GNU_SOURCE 1# we always want to use GNU features if available, so set _GNU_SOURCE
2set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_LINUX -D_GNU_SOURCE) 2set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_GNU_SOURCE)
3set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED 3set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64)
4 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64)
5set(PLATFORM_DIR platform/linux) 4set(PLATFORM_DIR platform/linux)
5set(PLATFORMDEFS_DIR platform/posix)
6set(CMAKE_SYSTEM_NAME Linux) 6set(CMAKE_SYSTEM_NAME Linux)
7if(WITH_ARCH) 7if(WITH_ARCH)
8 set(ARCH ${WITH_ARCH}) 8 set(ARCH ${WITH_ARCH})
@@ -84,10 +84,27 @@ endif()
84include(LDGOLD) 84include(LDGOLD)
85 85
86include(CheckIncludeFiles) 86include(CheckIncludeFiles)
87check_include_files("linux/memfd.h" HAVE_LINUX_MEMFD) 87check_include_files("linux/udmabuf.h" HAVE_LINUX_UDMABUF)
88if(HAVE_LINUX_MEMFD) 88if(HAVE_LINUX_UDMABUF)
89 list(APPEND ARCH_DEFINES "-DHAVE_LINUX_MEMFD=1") 89 list(APPEND ARCH_DEFINES "-DHAVE_LINUX_UDMABUF=1")
90else()
91 message(STATUS "include/linux/udmabuf.h not found")
92endif()
93
94check_include_files("linux/dma-heap.h" HAVE_LINUX_DMA_HEAP)
95if(HAVE_LINUX_DMA_HEAP)
96 list(APPEND ARCH_DEFINES "-DHAVE_LINUX_DMA_HEAP=1")
97else()
98 message(STATUS "include/linux/dma-heap.h not found")
99endif()
100
101check_include_files("linux/dma-buf.h" HAVE_LINUX_DMA_BUF)
102if(HAVE_LINUX_DMA_BUF)
103 list(APPEND ARCH_DEFINES "-DHAVE_LINUX_DMA_BUF=1")
104else()
105 message(STATUS "include/linux/dma-buf.h not found")
90endif() 106endif()
107
91include(CheckSymbolExists) 108include(CheckSymbolExists)
92set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") 109set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
93check_symbol_exists("mkostemp" "stdlib.h" HAVE_MKOSTEMP) 110check_symbol_exists("mkostemp" "stdlib.h" HAVE_MKOSTEMP)
@@ -96,8 +113,17 @@ if(HAVE_MKOSTEMP)
96 list(APPEND ARCH_DEFINES "-DHAVE_MKOSTEMP=1") 113 list(APPEND ARCH_DEFINES "-DHAVE_MKOSTEMP=1")
97endif() 114endif()
98 115
116set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
117check_symbol_exists("memfd_create" "sys/mman.h" HAVE_LINUX_MEMFD)
118set(CMAKE_REQUIRED_DEFINITIONS "")
119if(HAVE_LINUX_MEMFD)
120 list(APPEND ARCH_DEFINES "-DHAVE_LINUX_MEMFD=1")
121else()
122 message(STATUS "memfd_create() not found")
123endif()
124
99# Additional SYSTEM_DEFINES 125# Additional SYSTEM_DEFINES
100list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK) 126list(APPEND SYSTEM_DEFINES -DHAS_POSIX_NETWORK -DHAS_LINUX_NETWORK)
101 127
102# Code Coverage 128# Code Coverage
103if(CMAKE_BUILD_TYPE STREQUAL Coverage) 129if(CMAKE_BUILD_TYPE STREQUAL Coverage)
diff --git a/cmake/scripts/osx/ArchSetup.cmake b/cmake/scripts/osx/ArchSetup.cmake
index 74f2ed4..7d8f58b 100644
--- a/cmake/scripts/osx/ArchSetup.cmake
+++ b/cmake/scripts/osx/ArchSetup.cmake
@@ -6,10 +6,11 @@ set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/posix/main.cpp
6 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.mm 6 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.mm
7 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.h) 7 ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.h)
8 8
9set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX) 9set(ARCH_DEFINES -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 platform/linux) 12set(PLATFORM_DIR platform/darwin)
13set(PLATFORMDEFS_DIR platform/posix)
13set(CMAKE_SYSTEM_NAME Darwin) 14set(CMAKE_SYSTEM_NAME Darwin)
14if(WITH_ARCH) 15if(WITH_ARCH)
15 set(ARCH ${WITH_ARCH}) 16 set(ARCH ${WITH_ARCH})
@@ -23,7 +24,7 @@ else()
23endif() 24endif()
24 25
25# Additional SYSTEM_DEFINES 26# Additional SYSTEM_DEFINES
26list(APPEND SYSTEM_DEFINES -DHAS_LINUX_NETWORK -DHAS_SDL -DHAS_ZEROCONF) 27list(APPEND SYSTEM_DEFINES -DHAS_POSIX_NETWORK -DHAS_OSX_NETWORK -DHAS_SDL -DHAS_ZEROCONF)
27 28
28list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) 29list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX})
29 30
@@ -32,7 +33,10 @@ list(APPEND DEPLIBS "-framework DiskArbitration" "-framework IOKit"
32 "-framework ApplicationServices" "-framework AppKit" 33 "-framework ApplicationServices" "-framework AppKit"
33 "-framework CoreAudio" "-framework AudioToolbox" 34 "-framework CoreAudio" "-framework AudioToolbox"
34 "-framework CoreGraphics" "-framework CoreMedia" 35 "-framework CoreGraphics" "-framework CoreMedia"
35 "-framework VideoToolbox") 36 "-framework VideoToolbox" "-framework Security")
36 37
37set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) 38set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
38set(CMAKE_XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME OFF) 39set(CMAKE_XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME OFF)
40
41include(cmake/scripts/darwin/Macros.cmake)
42enable_arc()
diff --git a/cmake/scripts/osx/Install.cmake b/cmake/scripts/osx/Install.cmake
index 77c771c..aca31b4 100644
--- a/cmake/scripts/osx/Install.cmake
+++ b/cmake/scripts/osx/Install.cmake
@@ -22,6 +22,7 @@ add_custom_target(bundle
22 "APP_NAME=${APP_NAME}" 22 "APP_NAME=${APP_NAME}"
23 "FULL_PRODUCT_NAME=${APP_NAME}.app" 23 "FULL_PRODUCT_NAME=${APP_NAME}.app"
24 "SRCROOT=${CMAKE_BINARY_DIR}" 24 "SRCROOT=${CMAKE_BINARY_DIR}"
25 "PYTHON_VERSION=${PYTHON_VERSION}"
25 ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-osx.command) 26 ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-osx.command)
26set_target_properties(bundle PROPERTIES FOLDER "Build Utilities") 27set_target_properties(bundle PROPERTIES FOLDER "Build Utilities")
27add_dependencies(bundle ${APP_NAME_LC}) 28add_dependencies(bundle ${APP_NAME_LC})
diff --git a/cmake/scripts/osx/Macros.cmake b/cmake/scripts/osx/Macros.cmake
index 52f87d1..251cc79 100644
--- a/cmake/scripts/osx/Macros.cmake
+++ b/cmake/scripts/osx/Macros.cmake
@@ -20,7 +20,7 @@ function(core_link_library lib wraplib)
20 20
21 # iOS: EFFECTIVE_PLATFORM_NAME is not resolved 21 # iOS: EFFECTIVE_PLATFORM_NAME is not resolved
22 # http://public.kitware.com/pipermail/cmake/2016-March/063049.html 22 # http://public.kitware.com/pipermail/cmake/2016-March/063049.html
23 if(CORE_SYSTEM_NAME STREQUAL ios AND CMAKE_GENERATOR STREQUAL Xcode) 23 if(CORE_SYSTEM_NAME STREQUAL darwin_embedded)
24 get_target_property(dir ${lib} BINARY_DIR) 24 get_target_property(dir ${lib} BINARY_DIR)
25 set(link_lib ${dir}/${CORE_BUILD_CONFIG}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}) 25 set(link_lib ${dir}/${CORE_BUILD_CONFIG}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
26 endif() 26 endif()
diff --git a/cmake/scripts/windows/ArchSetup.cmake b/cmake/scripts/windows/ArchSetup.cmake
index 032632c..f3628f2 100644
--- a/cmake/scripts/windows/ArchSetup.cmake
+++ b/cmake/scripts/windows/ArchSetup.cmake
@@ -35,7 +35,6 @@ set(MINGW_LIBS_DIR ${CMAKE_SOURCE_DIR}/${DEPS_FOLDER_RELATIVE}/mingwlibs/${ARCH}
35list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR}) 35list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR})
36list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) 36list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin)
37list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) 37list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR})
38set(PYTHON_INCLUDE_DIR ${DEPENDENCIES_DIR}/include/python)
39 38
40# -------- Compiler options --------- 39# -------- Compiler options ---------
41 40
@@ -46,12 +45,9 @@ set(SYSTEM_DEFINES -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DHAS_DX -D__STDC_CONSTANT_M
46 -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" 45 -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi"
47 -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" 46 -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi"
48 -DUNICODE -D_UNICODE 47 -DUNICODE -D_UNICODE
48 -DFRIBIDI_STATIC
49 $<$<CONFIG:Debug>:-DD3D_DEBUG_INFO>) 49 $<$<CONFIG:Debug>:-DD3D_DEBUG_INFO>)
50 50
51if(${ARCH} STREQUAL win32)
52 list(APPEND SYSTEM_DEFINES $<$<CONFIG:Debug>:-D_ITERATOR_DEBUG_LEVEL=0>)
53endif()
54
55# Additional SYSTEM_DEFINES 51# Additional SYSTEM_DEFINES
56list(APPEND SYSTEM_DEFINES -DHAS_WIN32_NETWORK -DHAS_FILESYSTEM_SMB) 52list(APPEND SYSTEM_DEFINES -DHAS_WIN32_NETWORK -DHAS_FILESYSTEM_SMB)
57 53
@@ -74,7 +70,8 @@ link_directories(${DEPENDENCIES_DIR}/lib)
74 70
75# Additional libraries 71# Additional libraries
76list(APPEND DEPLIBS bcrypt.lib d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib WS2_32.lib 72list(APPEND DEPLIBS bcrypt.lib d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib WS2_32.lib
77 PowrProf.lib setupapi.lib Shlwapi.lib dwmapi.lib dxguid.lib DelayImp.lib) 73 PowrProf.lib setupapi.lib Shlwapi.lib dwmapi.lib dxguid.lib DelayImp.lib version.lib
74 crypt32.lib Mfplat.lib Mfuuid.lib Strmiids.lib)
78 75
79# NODEFAULTLIB option 76# NODEFAULTLIB option
80set(_nodefaultlibs_RELEASE libcmt) 77set(_nodefaultlibs_RELEASE libcmt)
@@ -87,7 +84,7 @@ foreach(_lib ${_nodefaultlibs_DEBUG})
87endforeach() 84endforeach()
88 85
89# DELAYLOAD option 86# DELAYLOAD option
90set(_delayloadlibs zlib.dll libmysql.dll libxslt.dll dnssd.dll dwmapi.dll sqlite3.dll 87set(_delayloadlibs zlib.dll libmariadb.dll libxslt.dll dnssd.dll dwmapi.dll sqlite3.dll
91 d3dcompiler_47.dll) 88 d3dcompiler_47.dll)
92foreach(_lib ${_delayloadlibs}) 89foreach(_lib ${_delayloadlibs})
93 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DELAYLOAD:\"${_lib}\"") 90 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DELAYLOAD:\"${_lib}\"")
diff --git a/cmake/scripts/windowsstore/ArchSetup.cmake b/cmake/scripts/windowsstore/ArchSetup.cmake
index 2e6d7cb..ad55a01 100644
--- a/cmake/scripts/windowsstore/ArchSetup.cmake
+++ b/cmake/scripts/windowsstore/ArchSetup.cmake
@@ -53,8 +53,6 @@ list(APPEND CMAKE_PREFIX_PATH ${MINGW_LIBS_DIR})
53list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin) 53list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIBS_DIR}/bin)
54# dependencies 54# dependencies
55list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}) 55list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR})
56# for python
57set(PYTHON_INCLUDE_DIR ${DEPENDENCIES_DIR}/include/python)
58 56
59 57
60# -------- Compiler options --------- 58# -------- Compiler options ---------
@@ -64,22 +62,24 @@ add_options(CXX ALL_BUILDS "/wd\"4146\"")
64add_options(CXX ALL_BUILDS "/wd\"4251\"") 62add_options(CXX ALL_BUILDS "/wd\"4251\"")
65add_options(CXX ALL_BUILDS "/wd\"4668\"") 63add_options(CXX ALL_BUILDS "/wd\"4668\"")
66add_options(CXX ALL_BUILDS "/wd\"5033\"") 64add_options(CXX ALL_BUILDS "/wd\"5033\"")
67set(ARCH_DEFINES -D_WINDOWS -DTARGET_WINDOWS -DTARGET_WINDOWS_STORE -DXBMC_EXPORT -DMS_UWP) 65set(ARCH_DEFINES -D_WINDOWS -DTARGET_WINDOWS -DTARGET_WINDOWS_STORE -DXBMC_EXPORT -DMS_UWP -DMS_STORE)
68if(NOT SDK_TARGET_ARCH STREQUAL arm) 66if(NOT SDK_TARGET_ARCH STREQUAL arm)
69 list(APPEND ARCH_DEFINES -D__SSE__ -D__SSE2__) 67 list(APPEND ARCH_DEFINES -D__SSE__ -D__SSE2__)
70endif() 68endif()
71set(SYSTEM_DEFINES -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DHAS_DX -D__STDC_CONSTANT_MACROS 69set(SYSTEM_DEFINES -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DHAS_DX -D__STDC_CONSTANT_MACROS
72 -DFMT_HEADER_ONLY -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING 70 -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING
73 -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" 71 -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi"
74 -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" 72 -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi"
75 -DUNICODE -D_UNICODE 73 -DUNICODE -D_UNICODE
74 -DFRIBIDI_STATIC
76 $<$<CONFIG:Debug>:-DD3D_DEBUG_INFO>) 75 $<$<CONFIG:Debug>:-DD3D_DEBUG_INFO>)
77 76
78# Additional SYSTEM_DEFINES 77# Additional SYSTEM_DEFINES
79list(APPEND SYSTEM_DEFINES -DHAS_WIN10_NETWORK) 78list(APPEND SYSTEM_DEFINES -DHAS_WIN10_NETWORK)
80 79
81# The /MP option enables /FS by default. 80# The /MP option enables /FS by default.
82set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS} /EHsc /await /std:c++latest") 81set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS} /EHsc /await")
82set(CMAKE_CXX_STANDARD 17)
83# Google Test needs to use shared version of runtime libraries 83# Google Test needs to use shared version of runtime libraries
84set(gtest_force_shared_crt ON CACHE STRING "" FORCE) 84set(gtest_force_shared_crt ON CACHE STRING "" FORCE)
85 85
@@ -91,7 +91,8 @@ set(gtest_force_shared_crt ON CACHE STRING "" FORCE)
91link_directories(${MINGW_LIBS_DIR}/lib 91link_directories(${MINGW_LIBS_DIR}/lib
92 ${DEPENDENCIES_DIR}/lib) 92 ${DEPENDENCIES_DIR}/lib)
93 93
94list(APPEND DEPLIBS bcrypt.lib d3d11.lib WS2_32.lib dxguid.lib dloadhelper.lib WindowsApp.lib) 94list(APPEND DEPLIBS bcrypt.lib d3d11.lib WS2_32.lib dxguid.lib dloadhelper.lib WindowsApp.lib
95 Mfplat.lib Mfuuid.lib Strmiids.lib)
95 96
96set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /WINMD:NO") 97set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /WINMD:NO")
97set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:msvcrt /DEBUG:FASTLINK /OPT:NOREF /OPT:NOICF") 98set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:msvcrt /DEBUG:FASTLINK /OPT:NOREF /OPT:NOICF")
diff --git a/cmake/scripts/windowsstore/Macros.cmake b/cmake/scripts/windowsstore/Macros.cmake
index de89c62..c8cb960 100644
--- a/cmake/scripts/windowsstore/Macros.cmake
+++ b/cmake/scripts/windowsstore/Macros.cmake
@@ -112,7 +112,7 @@ endmacro()
112 112
113macro(winstore_append_props target) 113macro(winstore_append_props target)
114 # exclude debug dlls from packaging 114 # exclude debug dlls from packaging
115 set(DEBUG_DLLS zlibd.dll freetyped.dll sqlite3d.dll) 115 set(DEBUG_DLLS zlibd.dll)
116 foreach(_dll ${DEBUG_DLLS}) 116 foreach(_dll ${DEBUG_DLLS})
117 if (DEBUG_DLLS_EXCLUDE) 117 if (DEBUG_DLLS_EXCLUDE)
118 list(APPEND DEBUG_DLLS_EXCLUDE "\;$(BuildRootPath)/dlls/${_dll}") 118 list(APPEND DEBUG_DLLS_EXCLUDE "\;$(BuildRootPath)/dlls/${_dll}")
diff --git a/cmake/treedata/android/subdirs.txt b/cmake/treedata/android/subdirs.txt
index 335c331..0c4cf88 100644
--- a/cmake/treedata/android/subdirs.txt
+++ b/cmake/treedata/android/subdirs.txt
@@ -3,6 +3,7 @@ xbmc/cores/VideoPlayer/Process/android cores/VideoPlayer/Process/android
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/media/decoderfilter media/decoderfilter 5xbmc/media/decoderfilter media/decoderfilter
6xbmc/platform/android platform/android
6xbmc/platform/android/activity platform/android/activity 7xbmc/platform/android/activity platform/android/activity
7xbmc/platform/android/bionic_supplement platform/android/bionicsupplement 8xbmc/platform/android/bionic_supplement platform/android/bionicsupplement
8xbmc/platform/android/filesystem platform/android/filesystem 9xbmc/platform/android/filesystem platform/android/filesystem
@@ -12,7 +13,7 @@ xbmc/platform/android/network platform/android/network
12xbmc/platform/android/peripherals platform/android/peripherals 13xbmc/platform/android/peripherals platform/android/peripherals
13xbmc/platform/android/powermanagement platform/android/powermanagement 14xbmc/platform/android/powermanagement platform/android/powermanagement
14xbmc/platform/android/storage platform/android/storage 15xbmc/platform/android/storage platform/android/storage
15xbmc/platform/linux platform/linux 16xbmc/platform/android/utils platform/android/utils
16xbmc/platform/linux/peripherals platform/linux/peripherals 17xbmc/platform/linux/peripherals platform/linux/peripherals
17xbmc/platform/posix platform/posix 18xbmc/platform/posix platform/posix
18xbmc/platform/posix/filesystem platform/posix/filesystem 19xbmc/platform/posix/filesystem platform/posix/filesystem
diff --git a/cmake/treedata/common/gbm/gbm.txt b/cmake/treedata/common/gbm/gbm.txt
new file mode 100644
index 0000000..113c47b
--- /dev/null
+++ b/cmake/treedata/common/gbm/gbm.txt
@@ -0,0 +1,3 @@
1xbmc/cores/RetroPlayer/process/gbm cores/RetroPlayer/process/gbm
2xbmc/cores/VideoPlayer/Process/gbm cores/VideoPlayer/Process/gbm
3xbmc/windowing/gbm windowing/gbm
diff --git a/cmake/treedata/common/pvr.txt b/cmake/treedata/common/pvr.txt
index decdabb..74e766f 100644
--- a/cmake/treedata/common/pvr.txt
+++ b/cmake/treedata/common/pvr.txt
@@ -1,8 +1,12 @@
1xbmc/pvr pvr 1xbmc/pvr pvr
2xbmc/pvr/addons pvr/addons 2xbmc/pvr/addons pvr/addons
3xbmc/pvr/channels pvr/channels 3xbmc/pvr/channels pvr/channels
4xbmc/pvr/dialogs pvr/dialogs 4xbmc/pvr/dialogs pvr/dialogs
5xbmc/pvr/epg pvr/epg 5xbmc/pvr/epg pvr/epg
6xbmc/pvr/recordings pvr/recordings 6xbmc/pvr/filesystem pvr/filesystem
7xbmc/pvr/timers pvr/timers 7xbmc/pvr/guilib pvr/guilib
8xbmc/pvr/windows pvr/windows 8xbmc/pvr/guilib/guiinfo pvr/guilib/guiinfo
9xbmc/pvr/recordings pvr/recordings
10xbmc/pvr/settings pvr/settings
11xbmc/pvr/timers pvr/timers
12xbmc/pvr/windows pvr/windows
diff --git a/cmake/treedata/common/rbpi/rbpi.txt b/cmake/treedata/common/rbpi/rbpi.txt
new file mode 100644
index 0000000..dc268e7
--- /dev/null
+++ b/cmake/treedata/common/rbpi/rbpi.txt
@@ -0,0 +1,2 @@
1xbmc/cores/omxplayer cores/omxplayer
2xbmc/windowing/rpi windowing/rpi
diff --git a/cmake/treedata/common/subdirs.txt b/cmake/treedata/common/subdirs.txt
index 083e8ef..8131113 100644
--- a/cmake/treedata/common/subdirs.txt
+++ b/cmake/treedata/common/subdirs.txt
@@ -1,16 +1,21 @@
1xbmc xbmc 1xbmc xbmc
2xbmc/addons addons 2xbmc/addons addons
3xbmc/addons/addoninfo addons_addoninfo
3xbmc/addons/binary-addons addons_binary-addons 4xbmc/addons/binary-addons addons_binary-addons
4xbmc/addons/interfaces addons_interfaces 5xbmc/addons/interfaces addons_interfaces
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/kodi-addon-dev-kit/include/kodi addons_kodi-addon-dev-kit_include_kodi 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 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/addon-instance/pvr addons_kodi-addon-dev-kit_include_kodi_addon-instance_pvr
12xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api addons_kodi-addon-dev-kit_include_kodi_c-api
13xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance addons_kodi-addon-dev-kit_include_kodi_c-api_addon-instance
14xbmc/addons/kodi-addon-dev-kit/include/kodi/c-api/addon-instance/pvr addons_kodi-addon-dev-kit_include_kodi_c-api_addon-instance_pvr
11xbmc/addons/kodi-addon-dev-kit/include/kodi/gui addons_kodi-addon-dev-kit_include_kodi_gui 15xbmc/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 16xbmc/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 17xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/dialogs addons_kodi-addon-dev-kit_include_kodi_gui_dialogs
18xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/gl addons_kodi-addon-dev-kit_include_kodi_gui_gl
14xbmc/addons/kodi-addon-dev-kit/include/kodi/tools addons_kodi-addon-dev-kit_include_kodi_tools 19xbmc/addons/kodi-addon-dev-kit/include/kodi/tools addons_kodi-addon-dev-kit_include_kodi_tools
15xbmc/addons/settings addons_settings 20xbmc/addons/settings addons_settings
16xbmc/commons commons 21xbmc/commons commons
diff --git a/cmake/treedata/common/tests.txt b/cmake/treedata/common/tests.txt
index 415eae6..9573812 100644
--- a/cmake/treedata/common/tests.txt
+++ b/cmake/treedata/common/tests.txt
@@ -5,6 +5,7 @@ xbmc/interfaces/python/test test/python
5xbmc/music/tags/test test/music_tags 5xbmc/music/tags/test test/music_tags
6xbmc/network/test test/network 6xbmc/network/test test/network
7xbmc/playlists/test test/playlists 7xbmc/playlists/test test/playlists
8xbmc/pvr/channels/test test/pvrchannels
8xbmc/test test 9xbmc/test test
9xbmc/threads/test test/threads 10xbmc/threads/test test/threads
10xbmc/utils/test test/utils 11xbmc/utils/test test/utils
diff --git a/cmake/treedata/common/videoplayer.txt b/cmake/treedata/common/videoplayer.txt
index ce6a757..8110f08 100644
--- a/cmake/treedata/common/videoplayer.txt
+++ b/cmake/treedata/common/videoplayer.txt
@@ -1,4 +1,5 @@
1xbmc/cores/VideoPlayer cores/VideoPlayer 1xbmc/cores/VideoPlayer cores/VideoPlayer
2xbmc/cores/VideoPlayer/Buffers cores/VideoPlayer/Buffers
2xbmc/cores/VideoPlayer/DVDCodecs cores/VideoPlayer/codecs 3xbmc/cores/VideoPlayer/DVDCodecs cores/VideoPlayer/codecs
3xbmc/cores/VideoPlayer/DVDCodecs/Audio cores/VideoPlayer/codecs/audio 4xbmc/cores/VideoPlayer/DVDCodecs/Audio cores/VideoPlayer/codecs/audio
4xbmc/cores/VideoPlayer/DVDCodecs/Overlay cores/VideoPlayer/codecs/overlay 5xbmc/cores/VideoPlayer/DVDCodecs/Overlay cores/VideoPlayer/codecs/overlay
diff --git a/cmake/treedata/optional/common/wayland.txt b/cmake/treedata/common/wayland/wayland.txt
index f8f77a6..bbbb14e 100644
--- a/cmake/treedata/optional/common/wayland.txt
+++ b/cmake/treedata/common/wayland/wayland.txt
@@ -1,3 +1,3 @@
1xbmc/cores/RetroPlayer/process/wayland cores/RetroPlayer/process/wayland # WAYLANDPP 1xbmc/cores/RetroPlayer/process/wayland cores/RetroPlayer/process/wayland
2xbmc/cores/VideoPlayer/Process/wayland cores/VideoPlayer/Process/wayland # WAYLANDPP 2xbmc/cores/VideoPlayer/Process/wayland cores/VideoPlayer/Process/wayland
3xbmc/windowing/wayland windowing/wayland # WAYLANDPP 3xbmc/windowing/wayland windowing/wayland
diff --git a/cmake/treedata/optional/common/X.txt b/cmake/treedata/common/x11/X.txt
index a250537..548c9dd 100644
--- a/cmake/treedata/optional/common/X.txt
+++ b/cmake/treedata/common/x11/X.txt
@@ -1,3 +1,3 @@
1xbmc/cores/RetroPlayer/process/X11 cores/RetroPlayer/process/X11 # X 1xbmc/cores/RetroPlayer/process/X11 cores/RetroPlayer/process/X11
2xbmc/cores/VideoPlayer/Process/X11 cores/VideoPlayer/Process/X11 # X 2xbmc/cores/VideoPlayer/Process/X11 cores/VideoPlayer/Process/X11
3xbmc/windowing/X11 windowing/X11 # X 3xbmc/windowing/X11 windowing/X11
diff --git a/cmake/treedata/darwin_embedded/ios/ios.txt b/cmake/treedata/darwin_embedded/ios/ios.txt
new file mode 100644
index 0000000..f5d13e3
--- /dev/null
+++ b/cmake/treedata/darwin_embedded/ios/ios.txt
@@ -0,0 +1,2 @@
1xbmc/platform/darwin/ios platform/ios
2xbmc/windowing/ios windowing/ios
diff --git a/cmake/treedata/ios/subdirs.txt b/cmake/treedata/darwin_embedded/subdirs.txt
index a3a03be..718c5c5 100644
--- a/cmake/treedata/ios/subdirs.txt
+++ b/cmake/treedata/darwin_embedded/subdirs.txt
@@ -3,13 +3,12 @@ xbmc/cores/VideoPlayer/Process/ios cores/VideoPlayer/Process/ios
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/platform/darwin platform/darwin 5xbmc/platform/darwin platform/darwin
6xbmc/platform/darwin/ios platform/ios
7xbmc/platform/darwin/ios-common platform/ios-common 6xbmc/platform/darwin/ios-common platform/ios-common
7xbmc/platform/darwin/ios-common/network platform/ios-common/network
8xbmc/platform/darwin/ios-common/peripherals platform/ios-common/peripherals
9xbmc/platform/darwin/ios-common/storage platform/ios-common/storage
8xbmc/platform/darwin/network platform/darwin/network 10xbmc/platform/darwin/network platform/darwin/network
9xbmc/platform/darwin/storage platform/storage 11xbmc/platform/darwin/utils platform/darwin/utils
10xbmc/platform/linux platform/linux
11xbmc/platform/linux/network platform/linux/network
12xbmc/platform/posix posix 12xbmc/platform/posix posix
13xbmc/platform/posix/filesystem platform/posix/filesystem 13xbmc/platform/posix/filesystem platform/posix/filesystem
14xbmc/platform/posix/utils platform/posix/utils 14xbmc/platform/posix/utils platform/posix/utils
15xbmc/windowing/ios windowing/ios
diff --git a/cmake/treedata/darwin_embedded/tvos/tvos.txt b/cmake/treedata/darwin_embedded/tvos/tvos.txt
new file mode 100755
index 0000000..1335e66
--- /dev/null
+++ b/cmake/treedata/darwin_embedded/tvos/tvos.txt
@@ -0,0 +1,5 @@
1xbmc/platform/darwin/tvos platform/tvos
2xbmc/platform/darwin/tvos/filesystem platform/darwin/tvos/filesystem
3xbmc/platform/darwin/tvos/input platform/darwin/tvos/input
4xbmc/platform/darwin/tvos/powermanagement platform/darwin/tvos/powermanagement
5xbmc/windowing/tvos windowing/tvos
diff --git a/cmake/treedata/freebsd/subdirs.txt b/cmake/treedata/freebsd/subdirs.txt
index fd8ed5f..79e3462 100644
--- a/cmake/treedata/freebsd/subdirs.txt
+++ b/cmake/treedata/freebsd/subdirs.txt
@@ -3,13 +3,14 @@ xbmc/cores/VideoPlayer/Process/rbpi cores/VideoPlayer/Process/rbpi
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/platform/freebsd platform/freebsd 5xbmc/platform/freebsd platform/freebsd
6xbmc/platform/linux platform/linux 6xbmc/platform/freebsd/network platform/freebsd/network
7xbmc/platform/linux/input platform/linux/input 7xbmc/platform/linux/input platform/linux/input
8xbmc/platform/linux/network platform/linux/network
9xbmc/platform/linux/peripherals platform/linux/peripherals 8xbmc/platform/linux/peripherals platform/linux/peripherals
10xbmc/platform/linux/powermanagement platform/linux/powermanagement 9xbmc/platform/linux/powermanagement platform/linux/powermanagement
10xbmc/platform/linux/sse4 platform/linux/sse4
11xbmc/platform/linux/storage platform/linux/storage 11xbmc/platform/linux/storage platform/linux/storage
12xbmc/platform/posix platform/posix 12xbmc/platform/posix platform/posix
13xbmc/platform/posix/filesystem platform/posix/filesystem 13xbmc/platform/posix/filesystem platform/posix/filesystem
14xbmc/platform/posix/network platform/posix/network
14xbmc/platform/posix/utils platform/posix/utils 15xbmc/platform/posix/utils platform/posix/utils
15xbmc/windowing/linux windowing/linux 16xbmc/windowing/linux windowing/linux
diff --git a/cmake/treedata/linux/subdirs.txt b/cmake/treedata/linux/subdirs.txt
index 7619e2e..51a7cbd 100644
--- a/cmake/treedata/linux/subdirs.txt
+++ b/cmake/treedata/linux/subdirs.txt
@@ -7,8 +7,10 @@ xbmc/platform/linux/input platform/linux/input
7xbmc/platform/linux/network platform/linux/network 7xbmc/platform/linux/network platform/linux/network
8xbmc/platform/linux/peripherals platform/linux/peripherals 8xbmc/platform/linux/peripherals platform/linux/peripherals
9xbmc/platform/linux/powermanagement platform/linux/powermanagement 9xbmc/platform/linux/powermanagement platform/linux/powermanagement
10xbmc/platform/linux/sse4 platform/linux/sse4
10xbmc/platform/linux/storage platform/linux/storage 11xbmc/platform/linux/storage platform/linux/storage
11xbmc/platform/posix platform/posix 12xbmc/platform/posix platform/posix
12xbmc/platform/posix/filesystem platform/posix/filesystem 13xbmc/platform/posix/filesystem platform/posix/filesystem
14xbmc/platform/posix/network platform/posix/network
13xbmc/platform/posix/utils platform/posix/utils 15xbmc/platform/posix/utils platform/posix/utils
14xbmc/windowing/linux windowing/linux 16xbmc/windowing/linux windowing/linux
diff --git a/cmake/treedata/linux/tests.txt b/cmake/treedata/linux/tests.txt
new file mode 100644
index 0000000..3f3a3e3
--- /dev/null
+++ b/cmake/treedata/linux/tests.txt
@@ -0,0 +1 @@
xbmc/platform/linux/test platform/linux/test
diff --git a/cmake/treedata/optional/common/aml.txt b/cmake/treedata/optional/common/aml.txt
deleted file mode 100644
index 09bf2db..0000000
--- a/cmake/treedata/optional/common/aml.txt
+++ /dev/null
@@ -1,2 +0,0 @@
1xbmc/cores/RetroPlayer/process/amlogic cores/RetroPlayer/process/amlogic # AML
2xbmc/windowing/amlogic windowing/amlogic # AML
diff --git a/cmake/treedata/optional/common/avahi.txt b/cmake/treedata/optional/common/avahi.txt
new file mode 100644
index 0000000..41b82b9
--- /dev/null
+++ b/cmake/treedata/optional/common/avahi.txt
@@ -0,0 +1 @@
xbmc/platform/linux/network/zeroconf platform/linux/network/zeroconf # AVAHI
diff --git a/cmake/treedata/optional/common/gbm.txt b/cmake/treedata/optional/common/gbm.txt
deleted file mode 100644
index 5d898d4..0000000
--- a/cmake/treedata/optional/common/gbm.txt
+++ /dev/null
@@ -1,2 +0,0 @@
1xbmc/cores/RetroPlayer/process/gbm cores/RetroPlayer/process/gbm # GBM
2xbmc/windowing/gbm windowing/gbm # GBM
diff --git a/cmake/treedata/osx/subdirs.txt b/cmake/treedata/osx/subdirs.txt
index 943c366..fa28aa0 100644
--- a/cmake/treedata/osx/subdirs.txt
+++ b/cmake/treedata/osx/subdirs.txt
@@ -3,12 +3,13 @@ xbmc/cores/VideoPlayer/Process/osx cores/VideoPlayer/Process/osx
3xbmc/platform/darwin platform/darwin 3xbmc/platform/darwin platform/darwin
4xbmc/platform/darwin/network platform/darwin/network 4xbmc/platform/darwin/network platform/darwin/network
5xbmc/platform/darwin/osx platform/osx 5xbmc/platform/darwin/osx platform/osx
6xbmc/platform/darwin/osx/network platform/darwin/osx/network
6xbmc/platform/darwin/osx/peripherals platform/osx/peripherals 7xbmc/platform/darwin/osx/peripherals platform/osx/peripherals
7xbmc/platform/darwin/osx/powermanagement platform/darwin/osx/powermanagement 8xbmc/platform/darwin/osx/powermanagement platform/darwin/osx/powermanagement
8xbmc/platform/darwin/storage platform/storage 9xbmc/platform/darwin/osx/storage platform/osx/storage
9xbmc/platform/linux platform/linux 10xbmc/platform/darwin/utils platform/darwin/utils
10xbmc/platform/linux/network platform/linux/network
11xbmc/platform/posix posix 11xbmc/platform/posix posix
12xbmc/platform/posix/filesystem platform/posix/filesystem 12xbmc/platform/posix/filesystem platform/posix/filesystem
13xbmc/platform/posix/network platform/posix/network
13xbmc/platform/posix/utils platform/posix/utils 14xbmc/platform/posix/utils platform/posix/utils
14xbmc/windowing/osx windowing/osx 15xbmc/windowing/osx windowing/osx
diff --git a/cmake/treedata/windows/subdirs.txt b/cmake/treedata/windows/subdirs.txt
index 0078758..c633977 100644
--- a/cmake/treedata/windows/subdirs.txt
+++ b/cmake/treedata/windows/subdirs.txt
@@ -1,6 +1,7 @@
1xbmc/cores/RetroPlayer/process/windows cores/RetroPlayer/process/windows 1xbmc/cores/RetroPlayer/process/windows cores/RetroPlayer/process/windows
2xbmc/cores/RetroPlayer/rendering/VideoShaders/windows cores/RetroPlayer/rendering/VideoShaders/windows 2xbmc/cores/RetroPlayer/rendering/VideoShaders/windows cores/RetroPlayer/rendering/VideoShaders/windows
3xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows 3xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows
4xbmc/cores/VideoPlayer/VideoRenderers/windows cores/VideoPlayer/VideoRenderers/windows
4xbmc/input/touch input/touch 5xbmc/input/touch input/touch
5xbmc/input/touch/generic input/touch/generic 6xbmc/input/touch/generic input/touch/generic
6xbmc/network/mdns network/mdns 7xbmc/network/mdns network/mdns
diff --git a/cmake/treedata/windowsstore/subdirs.txt b/cmake/treedata/windowsstore/subdirs.txt
index 0644fd2..da42566 100644
--- a/cmake/treedata/windowsstore/subdirs.txt
+++ b/cmake/treedata/windowsstore/subdirs.txt
@@ -1,4 +1,5 @@
1xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows 1xbmc/cores/VideoPlayer/Process/windows cores/VideoPlayer/Process/windows
2xbmc/cores/VideoPlayer/VideoRenderers/windows cores/VideoPlayer/VideoRenderers/windows
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/mdns network/mdns 5xbmc/network/mdns network/mdns