summaryrefslogtreecommitdiffstats
path: root/cmake/addons/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/addons/README.md')
-rw-r--r--cmake/addons/README.md65
1 files changed, 65 insertions, 0 deletions
diff --git a/cmake/addons/README.md b/cmake/addons/README.md
new file mode 100644
index 0000000..6470ee1
--- /dev/null
+++ b/cmake/addons/README.md
@@ -0,0 +1,65 @@
1![Kodi logo](https://raw.githubusercontent.com/xbmc/xbmc-forum/master/xbmc/images/logo-sbs-black.png)
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:
4
5 - `<addon-id> <git-url> <git-revision>`
6 - `<addon-id> <tarball-url>`
7 - `<addon-id> <file://path>`
8
9where
10- `<addon-id>` must be identical to the add-on's ID as defined in the add-on's addon.xml
11- `<git-url>` must be the URL of the git repository containing the add-on
12- `<git-revision>` must be a valid git tag/branch/commit in the add-on's git repository which will be used for the build
13- `<tarball-url>` must be the URL to a .tar.gz tarball containing the add-on
14- `<file://path>` must be a *file://* based path to the directory containing the add-on
15
16## Reserved filenames
17- **platforms.txt**
18
19List of platforms to build an add-on for (or *all*). Negating platforms is supported using a leading exclamation mark, e.g. *!windows*.
20
21Available platforms are: linux, windows, osx, ios, android, rbpi and freebsd.
22
23#### Attention
24If no add-on definitions could be found, the buildsystem assumes that the bootstrapping of the add-on definition repositories hasn't been performed yet and automatically executes the add-on bootstrapping buildsystem located in the *bootstrap* sub-directory with the default settings (i.e. *all* add-ons from all pre-defined add-on definition repositories are bootstrapped into the directory pointed to by the *ADDONS_DEFINITION_DIR* option).
25
26## Buildsystem variables
27The buildsystem uses the following variables (which can be passed into it when executing cmake with the -D`<variable-name>=<value>` format) to manipulate the build process:
28- `ADDONS_TO_BUILD` has two variations, which are tested in order:
29 - a quoted, space delimited list of `<addon-id>s` that you want to build (default is *all*)
30 - a regular expression that every `<addon-id>` is matched against (e.g. `ADDONS_TO_BUILD="pvr.*"`) to build all pvr add-ons
31- `ADDONS_DEFINITION_DIR` points to the directory containing the definitions for the addons to be built
32- `ADDON_SRC_PREFIX` can be used to override the add-on repository location. It must point to the locally available parent directory of the add-on(s) to build. `<addon-id>` will be appended to this path automatically
33- `CMAKE_BUILD_TYPE` specifies the type of the build. This can be either *Debug* or *Release* (default is *Release*)
34- `CMAKE_INSTALL_PREFIX` points to the directory where the built add-ons and their additional files (addon.xml, resources, ...) will be installed to (defaults to `<ADDON_DEPENDS_PATH>`)
35- `CMAKE_TOOLCHAIN_FILE` can be used to pass a toolchain file into the add-on builds
36- `ADDON_DEPENDS_PATH` points to the directory containing the *include* and *lib* directories of the add-ons' dependencies.
37- `CORE_SOURCE_DIR` points to the root directory of the project (default is the absolute representation of ../../.. starting from this directory)
38- `BUILD_DIR` points to the directory where the add-ons and their dependencies will be downloaded and built
39- `PACKAGE_ZIP=ON` means that the add-ons will be 'packaged' into a common folder, rather than being placed in `<CMAKE_INSTALL_PREFIX>/lib/kodi/addons` and `<CMAKE_INSTALL_PREFIX>/share/kodi/addons`
40- `PACKAGE_DIR` points to the directory where the ZIP archived add-ons will be stored after they have been packaged (defaults to `<BUILD_DIR>/zips`)
41- `ARCH_DEFINES` specifies the platform-specific C/C++ preprocessor defines (defaults to empty)
42- `ADDON_TARBALL_CACHING` specifies whether downloaded add-on source tarballs should be cached or not (defaults to *ON*)
43
44## Deprecated buildsystem variables
45Buildsystem will print a warning if you use any of the below-listed variables. For now they still work but you should adapt your workflow to the new variables.
46- `APP_ROOT` - Use `CORE_SOURCE_DIR` instead
47
48## Building
49The buildsystem makes some assumptions about the environment which must be met by whoever uses it:
50- Any dependencies of the add-ons must already be built and their include and library files must be present in the path pointed to by `<CMAKE_PREFIX_PATH>` (in *include* and *lib* sub-directories)
51
52To trigger the cmake-based buildsystem the following command must be executed with `<path>` set to this directory (absolute or relative) allowing for in-source and out-of-source builds
53
54`cmake <path> -G <generator>`
55
56CMake supports multiple generators. See [here] (https://cmake.org/cmake/help/v3.1/manual/cmake-generators.7.html) for a list.
57
58In case of additional options the call might look like this:
59
60cmake `<path>` [-G `<generator>`] \
61 -DCMAKE_BUILD_TYPE=Release \
62 -DCORE_SOURCE_DIR="`<path-to-app-root>`" \
63 -DARCH_DEFINES="-DTARGET_LINUX" \
64 -DADDON_DEPENDS_PATH=`<path-to-built-depends>` \
65 -DCMAKE_INSTALL_PREFIX="`<path-to-install-directory`"