diff options
author | fuzzard <fuzzard@kodi.tv> | 2022-03-23 11:44:24 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2022-03-24 14:19:09 +1000 |
commit | dcd4e945173ef4f29ac8a60593a28af28d8d1421 (patch) | |
tree | 14408328f5ff7ee77c278d7ab65db0dcccce5887 /cmake/scripts/common | |
parent | 717aa8e2f213c9231faf98b52ca0c0ce44e5eaa0 (diff) |
[cmake] BUILD_DEP_TARGET add DEP_BUILDENV to CONFIGURE_COMMAND invocations
Sets environment variables for autoconf based build systems for externalproject_add
build of a dependency
Diffstat (limited to 'cmake/scripts/common')
-rw-r--r-- | cmake/scripts/common/ModuleHelpers.cmake | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/cmake/scripts/common/ModuleHelpers.cmake b/cmake/scripts/common/ModuleHelpers.cmake index 795e7c4718..0578e6171f 100644 --- a/cmake/scripts/common/ModuleHelpers.cmake +++ b/cmake/scripts/common/ModuleHelpers.cmake @@ -141,7 +141,22 @@ macro(BUILD_DEP_TARGET) endif() if(CONFIGURE_COMMAND) - set(CONFIGURE_COMMAND CONFIGURE_COMMAND ${CONFIGURE_COMMAND}) + if(NOT CMAKE_ARGS AND DEP_BUILDENV) + # DEP_BUILDENV only used for non cmake externalproject_add builds + # iterate through CONFIGURE_COMMAND looking for multiple COMMAND, we need to + # add DEP_BUILDENV for each distinct COMMAND + set(tmp_config_command ${DEP_BUILDENV}) + foreach(item ${CONFIGURE_COMMAND}) + list(APPEND tmp_config_command ${item}) + if(item STREQUAL "COMMAND") + list(APPEND tmp_config_command ${DEP_BUILDENV}) + endif() + endforeach() + set(CONFIGURE_COMMAND CONFIGURE_COMMAND ${tmp_config_command}) + unset(tmp_config_command) + else() + set(CONFIGURE_COMMAND CONFIGURE_COMMAND ${CONFIGURE_COMMAND}) + endif() endif() if(BUILD_COMMAND) |