aboutsummaryrefslogtreecommitdiff
path: root/project/cmake/addons/README
blob: 93f2f8e6076fee03217490e855dcf3729b2ae77a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
KODI ADDONS
===========
This directory contains the cmake-based buildsystem for addons. It looks into
the "addons" sub-directory and parses all *.txt files recursively. Each addon
must have its own <addon-id>.txt file in a separate sub-directory which must
follow the defined format:
  <addon-id> <git-url> <git-revision>
where
  * <addon-id> must be identical to the addon's ID as defined in the addon's
    addon.xml
  * <git-url> must be the URL of the git repository containing the addon.
  * <git-revision> must be a valid git tag/branch/commit in the addon's git
    repository which will be used for the build.

Reserved filenames (for additional information on how to build an addon)
are:
  * platforms.txt: list of platforms to build an addon for (or "all")

The buildsystem uses the following variables (which can be passed into it when
executing cmake with the -D<variable-name>=<value> option) to e.g. access
specific paths:
  * ADDONS_TO_BUILD is a quoted, space delimited list of <addon-id>s that
    you want to build (default is "all").
  * CMAKE_BUILD_TYPE specifies the type of the build. This can be either "Debug"
    or "Release" (default is "Release").
  * CMAKE_INSTALL_PREFIX points to the directory where the built addons and their
    additional files (addon.xml, resources ...) will be installed to (defaults
    to <DEPENDS_PATH>).
  * CMAKE_TOOLCHAIN_FILE can be used to pass a toolchain file into the add-on
    builds.
  * DEPENDS_PATH points to the directory containing the "include" and "lib"
    directories of the addons' dependencies.
  * XBMCROOT points to the root directory of the project (default is the
    absolute representation of ../../.. starting from this directory).
  * PACKAGE_ZIP=1 will mean 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.
  * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines
    (defaults to empty).

The buildsystem makes some assumptions about the environment which must be met
by whoever uses it:
  * Any dependencies of the addons 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).

To trigger the cmake-based buildsystem the following command must be executed
with <path> being the path to this directory (absolute or relative, allowing for
in-source and out-of-source builds).

  cmake <path> -G <generator>

cmake supports multiple generators, see
http://www.cmake.org/cmake/help/v2.8.8/cmake.html#section_Generators for a list.

In case of additional options the call might look like this

  cmake <path> [-G <generator>] \
        -DCMAKE_BUILD_TYPE=Release \
        -DXBMCROOT="<path-to-app-root>" \
        -DARCH_DEFINES="-DTARGET_LINUX" \
        -DDEPENDS_PATH="<path-to-built-depends>" \
        -DCMAKE_INSTALL_PREFIX="<path-to-install-directory"