diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2022-03-25 05:55:34 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-25 05:55:34 +1000 |
commit | 372a7d0314abfdda2b4306b186acfb64e7104abb (patch) | |
tree | 500c47e08f256ee023794fc9e37a8828714927ef /cmake | |
parent | 6e4c853b0444189254fdeb786b74531647bf7f4e (diff) | |
parent | d208fbe78ebd442c3efd0f98df3a31679f2d14ec (diff) |
Merge pull request #21167 from fuzzard/cmake_toolchain
[Cmake] Add autoconf vars to toolchain
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindFstrcmp.cmake | 6 | ||||
-rw-r--r-- | cmake/scripts/common/ModuleHelpers.cmake | 17 |
2 files changed, 20 insertions, 3 deletions
diff --git a/cmake/modules/FindFstrcmp.cmake b/cmake/modules/FindFstrcmp.cmake index fe671dffa3..1b7cc93399 100644 --- a/cmake/modules/FindFstrcmp.cmake +++ b/cmake/modules/FindFstrcmp.cmake @@ -18,8 +18,10 @@ if(ENABLE_INTERNAL_FSTRCMP) SETUP_BUILD_VARS() - set(PATCH_COMMAND autoreconf -vif) - set(CONFIGURE_COMMAND ./configure --prefix ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}) + find_program(AUTORECONF autoreconf REQUIRED) + + set(CONFIGURE_COMMAND ${AUTORECONF} -vif + COMMAND ./configure --prefix ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}) set(BUILD_COMMAND make lib/libfstrcmp.la) set(BUILD_IN_SOURCE 1) set(INSTALL_COMMAND make install-libdir install-include) 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) |