diff options
Diffstat (limited to 'cmake/scripts/common/AddonHelpers.dox')
| -rw-r--r-- | cmake/scripts/common/AddonHelpers.dox | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/cmake/scripts/common/AddonHelpers.dox b/cmake/scripts/common/AddonHelpers.dox new file mode 100644 index 0000000..d3acec0 --- /dev/null +++ b/cmake/scripts/common/AddonHelpers.dox | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | /*! | ||
| 2 | \addtogroup cpp_cmake | ||
| 3 | |||
| 4 | Kodi which uses it as a library for its binary addons has a special build | ||
| 5 | system for this. | ||
| 6 | |||
| 7 | To implement this, a CMake macro brought by Kodi is used, this is | ||
| 8 | "build_addon (...)". This processes various definitions passed by the addon to | ||
| 9 | process the construction. | ||
| 10 | |||
| 11 | |||
| 12 | -------------------------------------------------------------------------------- | ||
| 13 | |||
| 14 | <b>Here a minmal example of the for addon used CMakeLists.txt:</b> | ||
| 15 | |||
| 16 | ~~~~~~~~~~~~~{.cmake} | ||
| 17 | cmake_minimum_required(VERSION 3.5) | ||
| 18 | project(example.addon) | ||
| 19 | |||
| 20 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}) | ||
| 21 | |||
| 22 | find_package(Kodi REQUIRED) | ||
| 23 | |||
| 24 | include_directories(${KODI_INCLUDE_DIR} | ||
| 25 | |||
| 26 | set(DEPLIBS ) # Here empty | ||
| 27 | set(EXAMPLE_SOURCES src/main.cpp) | ||
| 28 | set(EXAMPLE_HEADERS src/main.h) | ||
| 29 | |||
| 30 | build_addon((example.addon EXAMPLE DEPLIBS) | ||
| 31 | |||
| 32 | include(CPack) | ||
| 33 | ~~~~~~~~~~~~~ | ||
| 34 | |||
| 35 | |||
| 36 | -------------------------------------------------------------------------------- | ||
| 37 | |||
| 38 | This is a list of special variables that can be passed to the macro. | ||
| 39 | The parts defined with "*" must be given the second name given to the macro. | ||
| 40 | |||
| 41 | Here to define the necessary creation and installation files on addon CMakeLists.txt: | ||
| 42 | | Name | Description | ||
| 43 | |-----------------------------|------------------------------------------------- | ||
| 44 | | *_SOURCES | List of source code files to be complicated. | ||
| 45 | | *_HEADERS | List of used source code header files. | ||
| 46 | | *_CUSTOM_BINARY | For special cases where an already created library from an external source is inserted, the <b>"* _SOURCES"</b> and <b>"* _HEADERS"</b> are unused in this case.<br>This is currently used primarily on game addons. | ||
| 47 | | *_CUSTOM_DATA | To add additional required data from a folder, which are stored in the shared folder of the addon.<br>With a "/" at the end of the content given to the folder is used, without the folder itself. | ||
| 48 | | *_ADDITIONAL_BINARY | In case the additional library has to be installed for the addon, the path or CMake name can be given here. | ||
| 49 | | *_ADDITIONAL_BINARY_EXE | In case you need to addon an additional application you can give the path or CMake name, it will be in the same folder as the addon library.<br>The mode bits are set there as EXE. | ||
| 50 | | *_ADDITIONAL_BINARY_DIRS | To add complete folders additionally to folders containing the addon library.<br>With a "/" at the end of the content given to the folder is used, without the folder itself. | ||
| 51 | |||
| 52 | External creation Options, given by `-D...`: | ||
| 53 | | Name | Description | ||
| 54 | |-----------------------------|------------------------------------------------- | ||
| 55 | | PACKAGE_ZIP | To create a package as a ZIP file. This is also used to install locally addon together.<br>Default is OFF. | ||
| 56 | | PACKAGE_TGZ | To create a package as a TGZ file.<br>Default is OFF. | ||
| 57 | | BUILD_SHARED_LIBS | To define if addon library is shared or static.<br>Default is ON to have shared. | ||
| 58 | | USE_LTO | Use link time optimization.<br>Default is OFF. | ||
| 59 | */ | ||
