diff options
author | fuzzard <fuzzard@kodi.tv> | 2022-08-13 18:28:22 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2022-08-13 18:28:22 +1000 |
commit | 28a7fb1e1899e0ffb0f7e1c0f55d6081a1564f1a (patch) | |
tree | 7ce217d392e28c65071f00c3d61a6b0032a44bd2 /cmake/scripts | |
parent | 61f7ea86a6e559209135995530a4b105eeed744b (diff) |
[cmake][addons] allow passing extra args to built addon dependencies
Allows a user to pass through cmake arguments to all addon dependencies that are built
Be aware, this is a global addition, and will be passed through to all addons built.
Usage:
-DADDON_EXTRA_ARGS="-Ddefine1=1 -Ddefine2=2"
The arguments will be passed through as a list (ie -Ddefine1=1;-Ddefine2=2) to all
addon dependencies built, and will be accessible via their CMakelists.txt files
an example is with visualization.projectm. If a user wishes to set -DAPP_RENDER_SYSTEM=gles
for the projectm dependency to build projectm as gles compatible.
Currently this can be done with a toolchain file, but a user cant set -DAPP_RENDER_SYSTEM=gles
as art of their cmake stanza to build the addon, as dependencies are passed through filtered
lists, of which APP_RENDER_SYSTEM isnt specifically passed through.
https://github.com/xbmc/visualization.projectm/issues/87
This solution provides a more generic way to pass through arguments to cmake dependencies
without us explicitly handling each option in HandleDepends.cmake
Diffstat (limited to 'cmake/scripts')
-rw-r--r-- | cmake/scripts/common/HandleDepends.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/scripts/common/HandleDepends.cmake b/cmake/scripts/common/HandleDepends.cmake index 8e0f6d6565..dc022bab64 100644 --- a/cmake/scripts/common/HandleDepends.cmake +++ b/cmake/scripts/common/HandleDepends.cmake @@ -99,6 +99,12 @@ function(add_addon_depends addon searchpath) message(${BUILD_ARGS}) endif() + if(ADDON_EXTRA_ARGS) + string(REPLACE " " ";" ADDON_EXTRA_ARGS ${ADDON_EXTRA_ARGS}) + list(APPEND BUILD_ARGS ${ADDON_EXTRA_ARGS}) + message("Addon Extra Args: ${ADDON_EXTRA_ARGS}") + endif() + # used for addons where need special folders to store there content (if # not set the addon define it byself). # e.g. Google Chromium addon where his git bring: |