59a5728e3bef1ba460de1e859b1047f882a68c8d
[vuplus_xbmc] / project / cmake / addons / README
1 XBMC ADDONS
2 ===========
3 This directory contains the cmake-based buildsystem for addons. It looks into
4 the "addons" sub-directory and parses all *.txt files. Each addon must have its
5 own <addon-id>.txt file which must follow the defined format:
6   <addon-id> <git-base-url> <git-revision>
7 where
8   * <addon-id> must be identical to the addon's ID as defined in the addon's
9     addon.xml
10   * <git-base-url> must be the base URL (i.e. the URL must not contain the name
11     of the git repository itself) of the git repository containing the addon.
12     The repository name of the addon must be <addon-id>.
13   * <git-revision> must be a valid git tag/branch/commit in the addon's git
14     repository which will be used for the build.
15
16 The buildsystem uses the following variables (which can be passed into it when
17 executing cmake with the -D<variable-name>=<value> option) to e.g. access
18 specific paths:
19   * ADDONS_TO_BUILD is a quoted, space delimited list of <addon-id>s that
20     you want to build (default is "all").
21   * CMAKE_BUILD_TYPE specifies the type of the build. This can be either "Debug"
22     or "Release" (default is "Release").
23   * CMAKE_INSTALL_PREFIX points to the directory where the built addons and their
24     additional files (addon.xml, resources ...) will be installed to (defaults
25     to <DEPENDS_PATH>).
26   * CMAKE_TOOLCHAIN_FILE can be used to pass a toolchain file into the add-on
27     builds.
28   * DEPENDS_PATH points to the directory containing the "include" and "lib"
29     directories of the addons' dependencies.
30   * XBMCROOT points to the root directory of the xbmc project (default is the
31     absolute representation of ../../.. starting from this directory).
32   * PACKAGE_ZIP=1 will mean the add-ons will be 'packaged' into a common folder,
33     rather than being placed in <CMAKE_INSTALL_PREFIX>/lib/xbmc/addons and
34     <CMAKE_INSTALL_PREFIX>/share/xbmc/addons.
35   * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines
36     (defaults to empty).
37
38 The buildsystem makes some assumptions about the environment which must be met
39 by whoever uses it:
40   * Any dependencies of the addons must already be built and their include and
41     library files must be present in the path pointed to by <CMAKE_PREFIX_PATH> (in
42     "include" and "lib" sub-directories).
43
44 To trigger the cmake-based buildsystem the following command must be executed
45 with <path> being the path to this directory (absolute or relative, allowing for
46 in-source and out-of-source builds).
47
48   cmake <path> -G <generator>
49
50 cmake supports multiple generators, see
51 http://www.cmake.org/cmake/help/v2.8.8/cmake.html#section_Generators for a list.
52
53 In case of additional options the call might look like this
54
55   cmake <path> [-G <generator>] \
56         -DCMAKE_BUILD_TYPE=Release \
57         -DXBMCROOT="<path-to-xbmc-root>" \
58         -DARCH_DEFINES="-DTARGET_LINUX" \
59         -DDEPENDS_PATH="<path-to-built-depends>" \
60         -DCMAKE_INSTALL_PREFIX="<path-to-install-directory"