summaryrefslogtreecommitdiffstats
path: root/cmake/addons
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2018-01-01 13:40:09 +0100
committermanuel <manuel@mausz.at>2018-01-01 13:40:09 +0100
commit4830f27a40323fe859dc166337a2b861877b7121 (patch)
tree39e9f712a5415ec0026c3914f4bf600b2f679287 /cmake/addons
parent0afb1d4d51973cf52973617c92236d851a039d31 (diff)
downloadkodi-pvr-build-4830f27a40323fe859dc166337a2b861877b7121.tar.gz
kodi-pvr-build-4830f27a40323fe859dc166337a2b861877b7121.tar.bz2
kodi-pvr-build-4830f27a40323fe859dc166337a2b861877b7121.zip
sync with upstream
Diffstat (limited to 'cmake/addons')
-rw-r--r--cmake/addons/CMakeLists.txt8
-rw-r--r--cmake/addons/depends/windowsstore/CMakeLists.txt52
-rw-r--r--cmake/addons/depends/windowsstore/Install.cmake24
-rw-r--r--cmake/addons/depends/windowsstore/README19
-rw-r--r--cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt1
-rw-r--r--cmake/addons/depends/windowsstore/prebuilt/README21
6 files changed, 124 insertions, 1 deletions
diff --git a/cmake/addons/CMakeLists.txt b/cmake/addons/CMakeLists.txt
index a6ea149..fd1d448 100644
--- a/cmake/addons/CMakeLists.txt
+++ b/cmake/addons/CMakeLists.txt
@@ -75,6 +75,11 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX)
75endif() 75endif()
76list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}) 76list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
77 77
78if (CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
79 set(BUILD_ARGS_ext -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
80 -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION})
81endif()
82
78set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} 83set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
79 -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> 84 -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
80 -DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig 85 -DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig
@@ -86,7 +91,8 @@ set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
86 -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} 91 -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME}
87 -DBUILD_SHARED_LIBS=1 92 -DBUILD_SHARED_LIBS=1
88 -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} 93 -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
89 -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}) 94 -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
95 ${BUILD_ARGS_ext})
90 96
91if(MSVC) 97if(MSVC)
92 # move cmake specific targets to a CMakePredefinedTargets folder in Visual Studio 98 # move cmake specific targets to a CMakePredefinedTargets folder in Visual Studio
diff --git a/cmake/addons/depends/windowsstore/CMakeLists.txt b/cmake/addons/depends/windowsstore/CMakeLists.txt
new file mode 100644
index 0000000..c8739c0
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/CMakeLists.txt
@@ -0,0 +1,52 @@
1cmake_minimum_required(VERSION 3.1)
2project(kodi-addons-depends-windows)
3
4list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
5
6if(NOT CMAKE_BUILD_TYPE)
7 set(CMAKE_BUILD_TYPE Release)
8endif()
9
10include(ExternalProject)
11
12if(NOT ADDON_DEPENDS_PATH)
13 message(FATAL_ERROR "ADDON_DEPENDS_PATH (${ADDON_DEPENDS_PATH}) is not a valid target directory.")
14else()
15 file(TO_CMAKE_PATH "${ADDON_DEPENDS_PATH}" ADDON_DEPENDS_PATH)
16endif()
17get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE)
18list(APPEND CMAKE_PREFIX_PATH ${ADDON_DEPENDS_PATH})
19
20if(NOT DEPENDS_TO_BUILD)
21 set(DEPENDS_TO_BUILD "all")
22endif()
23
24function(add_internal id url inputfile)
25 externalproject_add(${id}
26 URL ${url}
27 PREFIX build/${id}
28 CONFIGURE_COMMAND ""
29 BUILD_COMMAND ""
30 INSTALL_COMMAND ${CMAKE_COMMAND}
31 -DINPUTDIR=${PROJECT_BINARY_DIR}/build/${id}/src/${id}
32 -DINPUTFILE=${inputfile}
33 -DDESTDIR=${ADDON_DEPENDS_PATH}
34 -P ${PROJECT_SOURCE_DIR}/Install.cmake
35 )
36endfunction()
37
38file(GLOB_RECURSE download_input_files prebuilt/*.txt)
39foreach(file ${download_input_files})
40 if(NOT file MATCHES install.txt)
41 file(STRINGS ${file} def)
42 get_filename_component(dir ${file} DIRECTORY)
43 string(REPLACE " " ";" def ${def})
44 list(GET def 0 id)
45
46 list(FIND DEPENDS_TO_BUILD ${id} idx)
47 if(idx GREATER -1 OR DEPENDS_TO_BUILD STREQUAL "all")
48 list(GET def 1 url)
49 add_internal(${id} ${url} ${dir}/install.txt)
50 endif()
51 endif()
52endforeach()
diff --git a/cmake/addons/depends/windowsstore/Install.cmake b/cmake/addons/depends/windowsstore/Install.cmake
new file mode 100644
index 0000000..9a3adbb
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/Install.cmake
@@ -0,0 +1,24 @@
1if(EXISTS "${INPUTFILE}")
2 # if there's an input file we use it to determine which files to copy where
3 file(STRINGS ${INPUTFILE} FILES)
4 string(REPLACE "\n" ";" FILES "${FILES}")
5 foreach(file ${FILES})
6 string(REPLACE " " ";" file "${file}")
7 list(GET file 0 dir)
8 list(GET file 1 dest)
9 list(LENGTH file deflength)
10 if(deflength GREATER 2)
11 list(GET file 2 copy)
12 endif()
13 file(GLOB files ${INPUTDIR}/${dir})
14 foreach(instfile ${files})
15 file(COPY ${instfile} DESTINATION ${DESTDIR}/${dest})
16 if(copy)
17 file(COPY ${instfile} DESTINATION ${DESTDIR}/${copy})
18 endif()
19 endforeach()
20 endforeach()
21else()
22 # otherwise we assume that the content of the extracted archive is already well-formed and can just be copied
23 file(COPY ${INPUTDIR}/${dir} DESTINATION ${DESTDIR})
24endif() \ No newline at end of file
diff --git a/cmake/addons/depends/windowsstore/README b/cmake/addons/depends/windowsstore/README
new file mode 100644
index 0000000..67dc594
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/README
@@ -0,0 +1,19 @@
1KODI WIN32 ADDON DEPENDENCIES
2=============================
3This directory contains the cmake-based buildsystem for dependencies (currently
4only prebuilt) used by one or multiple addons. The buildsystem looks into the
5"prebuilt" sub-directory, downloads all the specified dependencies, extracts
6them and places them into the "depends" sub-directory.
7
8To trigger the cmake-based buildsystem the following command must be executed
9with <path> being the path to this directory (absolute or relative, allowing for
10in-source and out-of-source builds).
11
12 cmake <path> [-G <generator>]
13
14cmake supports multiple generators, see
15http://www.cmake.org/cmake/help/v2.8.8/cmake.html#section_Generators for a list.
16For win32 builds one of the "Visual Studio XX" or the "NMake Makefiles"
17generators is preferred. For the "NMake Makefiles" generator to work the above
18command must be called from an environment prepared for VC++ builds (see
19http://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx).
diff --git a/cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt b/cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt
new file mode 100644
index 0000000..db6f782
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/p8-platform/p8-platform.txt
@@ -0,0 +1 @@
p8-platform https://github.com/afedchin/platform.git win10
diff --git a/cmake/addons/depends/windowsstore/prebuilt/README b/cmake/addons/depends/windowsstore/prebuilt/README
new file mode 100644
index 0000000..a0c70d6
--- /dev/null
+++ b/cmake/addons/depends/windowsstore/prebuilt/README
@@ -0,0 +1,21 @@
1KODI WIN32 PREBUILT ADDON DEPENDENCIES
2======================================
3This directory contains a file or sub-directory for every prebuilt dependency
4used by one of the addons being built. There are two different modes supported.
5Both include a file named <library-id>.txt which must follow the defined format
6 <library-id> <download-url>
7
8If the archive, which the <download-url> points at, contains
9 * only the necessary files and in the proper directory structure (i.e. an
10 "include" and a "lib" directory) then the file must be put into this
11 directory and nothing else is needed.
12 * unnecessary files and/or does not follow the defined directory structure
13 (i.e. an "include" and a "lib" directory) then the file must be put into a
14 sub-directory named <library-id>. Furthermore an additional file called
15 "install.txt" must be placed in that sub-directory. install.txt contains a
16 line for every path/directory/file with a destination where it must be copied
17 to. It must follow the defined format
18 <source> <destination> [<copy-destination>]
19 where <source> must be an existing file, directory or a path containing
20 wildcards, <destination> and the optional <copy-destination> must be existing
21 directories.