From dcd4e945173ef4f29ac8a60593a28af28d8d1421 Mon Sep 17 00:00:00 2001 From: fuzzard Date: Wed, 23 Mar 2022 11:44:24 +1000 Subject: [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 --- cmake/scripts/common/ModuleHelpers.cmake | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'cmake') 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) -- cgit v1.2.3 From d208fbe78ebd442c3efd0f98df3a31679f2d14ec Mon Sep 17 00:00:00 2001 From: fuzzard Date: Tue, 22 Mar 2022 21:18:25 +1000 Subject: [cmake] FindFstrcmp clean internal BUILD_DEP_TARGET search for autoconf binary as a requirement dont use PATCH_COMMAND for autoreconf, just use CONFIGURE_COMMAND Use vars in toolchain to enable cross compile of autoconf based fstrcmp for Apple/Android platforms. --- cmake/modules/FindFstrcmp.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cmake') 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) -- cgit v1.2.3