From 5823b05feb29a59510c32a9c28ca18b50b9b6399 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 1 May 2016 18:06:14 +0200 Subject: sync with upstream --- project/cmake/addons/CMakeLists.txt | 6 +- project/cmake/addons/README | 94 -------------------------- project/cmake/addons/README.md | 61 +++++++++++++++++ project/cmake/addons/bootstrap/bootstrap.cmake | 2 + 4 files changed, 67 insertions(+), 96 deletions(-) delete mode 100644 project/cmake/addons/README create mode 100644 project/cmake/addons/README.md (limited to 'project/cmake/addons') diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt index 8fc1a23..982d977 100644 --- a/project/cmake/addons/CMakeLists.txt +++ b/project/cmake/addons/CMakeLists.txt @@ -120,6 +120,7 @@ endif() if(NOT ADDONS_TO_BUILD) set(ADDONS_TO_BUILD "all") else() + string(STRIP "${ADDONS_TO_BUILD}" ADDONS_TO_BUILD) message(STATUS "Building following addons: ${ADDONS_TO_BUILD}") separate_arguments(ADDONS_TO_BUILD) endif() @@ -132,6 +133,7 @@ endif() get_filename_component(ADDONS_DEFINITION_DIR "${ADDONS_DEFINITION_DIR}" ABSOLUTE) if(ADDON_SRC_PREFIX) + get_filename_component(ADDON_SRC_PREFIX "${ADDON_SRC_PREFIX}" ABSOLUTE) message(STATUS "Overriding addon source directory prefix: ${ADDON_SRC_PREFIX}") endif() @@ -196,12 +198,12 @@ if(NOT addons) file(MAKE_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) endif() + string (REPLACE ";" " " ADDONS_TO_BUILD_STR "${ADDONS_TO_BUILD}") # generate the bootstrap buildsystem execute_process(COMMAND ${CMAKE_COMMAND} ${PROJECT_SOURCE_DIR}/bootstrap - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=${ADDONS_DEFINITION_DIR} -DBUILD_DIR:PATH=${BOOTSTRAP_BUILD_DIR} - -DADDONS_TO_BUILD=${ADDONS_TO_BUILD} + -DADDONS_TO_BUILD:STRING=${ADDONS_TO_BUILD_STR} WORKING_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) # execute the generated bootstrap buildsystem diff --git a/project/cmake/addons/README b/project/cmake/addons/README deleted file mode 100644 index a0f2c32..0000000 --- a/project/cmake/addons/README +++ /dev/null @@ -1,94 +0,0 @@ -KODI ADDONS -=========== -This directory contains the cmake-based buildsystem for addons. 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 addon -must have its own .txt file in a separate sub-directory which must -follow one of the defined format: - - - -where - * must be identical to the addon's ID as defined in the addon's - addon.xml - * must be the URL of the git repository containing the addon - * must be a valid git tag/branch/commit in the addon's git - repository which will be used for the build. - * must be the URL to a .tar.gz tarball containing the addon - * must be a file:// based path to the directory containing the - addon - -Reserved filenames (for additional information on how to build an addon) -are: - * platforms.txt: List of platforms to build an addon for (or "all"). It is - also supported to specify negated platforms with a leading exclamation mark - (i), e.g. "!windows". - Available platforms are: linux, windows, osx, ios, android, rbpi, freebsd - -ATTENTION: If no addon definitions could be found the buildsystem assumes that - the bootstrapping of the addon definition repositories hasn't been - performed yet and automatically executes the addon bootstrapping - buildsystem located in the "bootstrap" sub-directory with the default - settings (i.e. all addons from all pre-defined addon definition - repositories are bootstrapped into the directory pointed to by the - ADDONS_DEFINITION_DIR option). - -The buildsystem uses the following variables (which can be passed into it when -executing cmake with the -D= option) to e.g. access -specific paths: - * ADDONS_TO_BUILD has two variations, which are tested in order: - - a quoted, space delimited list of s that - you want to build (default is "all"). - - a regular expression that every is matched against - e.g.: ADDONS_TO_BUILD=pvr.* to build all pvr addons - * ADDONS_DEFINITION_DIR points to the directory containing the definitions - for the addons to be built. - * ADDON_SRC_PREFIX can be used to override the addon repository location. - It must point to the locally available parent directory of the addon(s) to build - will be appended to this path automatically - * 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 ). - * 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. - * APP_ROOT points to the root directory of the project (default is the - absolute representation of ../../.. starting from this directory). - * BUILD_DIR points to the directory where the addons and their dependencies - will be downloaded and built. - * PACKAGE_ZIP=ON means that the add-ons will be 'packaged' into a common folder, - rather than being placed in /lib/kodi/addons and - /share/kodi/addons. - * PACKAGE_DIR points to the directory where the ZIP archived addons will be - stored after they have been packaged (defaults to /zips) - * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines - (defaults to empty). - * ADDON_TARBALL_CACHING specifies whether downloaded addon source tarballs - should be cached or not (defaults to ON). - -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 (in - "include" and "lib" sub-directories). - -To trigger the cmake-based buildsystem the following command must be executed -with being the path to this directory (absolute or relative, allowing for -in-source and out-of-source builds). - - cmake -G - -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 [-G ] \ - -DCMAKE_BUILD_TYPE=Release \ - -DAPP_ROOT="" \ - -DARCH_DEFINES="-DTARGET_LINUX" \ - -DDEPENDS_PATH="" \ - -DCMAKE_INSTALL_PREFIX=".txt` file in a separate sub-directory that must follow one of the defined formats: + + - ` ` + - ` ` + - ` ` + +where +- `` must be identical to the add-on's ID as defined in the add-on's addon.xml +- `` must be the URL of the git repository containing the add-on +- `` must be a valid git tag/branch/commit in the add-on's git repository which will be used for the build +- `` must be the URL to a .tar.gz tarball containing the add-on +- `` must be a *file://* based path to the directory containing the add-on + +## Reserved filenames +- **platforms.txt** + +List of platforms to build an add-on for (or *all*). Negating platforms is supported using a leading exclamation mark, e.g. *!windows*. + +Available platforms are: linux, windows, osx, ios, android, rbpi and freebsd. + +#### Attention +If 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). + +## Buildsystem variables +The buildsystem uses the following variables (which can be passed into it when executing cmake with the -D`=` format) to manipulate the build process: +- `ADDONS_TO_BUILD` has two variations, which are tested in order: + - a quoted, space delimited list of `s` that you want to build (default is *all*) + - a regular expression that every `` is matched against (e.g. `ADDONS_TO_BUILD="pvr.*"`) to build all pvr add-ons +- `ADDONS_DEFINITION_DIR` points to the directory containing the definitions for the addons to be built +- `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. `` will be appended to this path automatically +- `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 add-ons and their additional files (addon.xml, resources, ...) will be installed to (defaults to ``) +- `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 add-ons' dependencies. +- `APP_ROOT` points to the root directory of the project (default is the absolute representation of ../../.. starting from this directory) +- `BUILD_DIR` points to the directory where the add-ons and their dependencies will be downloaded and built +- `PACKAGE_ZIP=ON` means that the add-ons will be 'packaged' into a common folder, rather than being placed in `/lib/kodi/addons` and `/share/kodi/addons` +- `PACKAGE_DIR` points to the directory where the ZIP archived add-ons will be stored after they have been packaged (defaults to `/zips`) +- `ARCH_DEFINES` specifies the platform-specific C/C++ preprocessor defines (defaults to empty) +- `ADDON_TARBALL_CACHING` specifies whether downloaded add-on source tarballs should be cached or not (defaults to *ON*) + +## Building +The buildsystem makes some assumptions about the environment which must be met by whoever uses it: +- 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 `` (in *include* and *lib* sub-directories) + +To trigger the cmake-based buildsystem the following command must be executed with `` set to this directory (absolute or relative) allowing for in-source and out-of-source builds + +`cmake -G ` + +CMake supports multiple generators. See [here] (https://cmake.org/cmake/help/v3.1/manual/cmake-generators.7.html) for a list. + +In case of additional options the call might look like this: + +cmake `` [-G ``] \ + -DCMAKE_BUILD_TYPE=Release \ + -DAPP_ROOT="``" \ + -DARCH_DEFINES="-DTARGET_LINUX" \ + -DDEPENDS_PATH=`` \ + -DCMAKE_INSTALL_PREFIX="`