From 0f5ff64ae6b69f6a5a8e4e570f947b10e3c349d4 Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Wed, 31 May 2023 15:42:13 -0700 Subject: [PATCH] build: Fix Qt download commands working directory. (#6579) --- CMakeModules/DownloadExternals.cmake | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeModules/DownloadExternals.cmake b/CMakeModules/DownloadExternals.cmake index bfdcf71aad..38a8151ca3 100644 --- a/CMakeModules/DownloadExternals.cmake +++ b/CMakeModules/DownloadExternals.cmake @@ -65,6 +65,8 @@ function(download_qt_external target prefix_var) endif() get_external_prefix(qt base_path) + file(MAKE_DIRECTORY "${base_path}") + if (target MATCHES "tools_.*") set(prefix "${base_path}") set(install_args install-tool --outputdir ${base_path} ${host} desktop ${target}) @@ -76,16 +78,21 @@ function(download_qt_external target prefix_var) if (NOT EXISTS "${prefix}") message(STATUS "Downloading binaries for Qt...") if (WIN32) - set(aqt_path "${CMAKE_BINARY_DIR}/externals/aqt.exe") + set(aqt_path "${base_path}/aqt.exe") file(DOWNLOAD https://github.com/miurahr/aqtinstall/releases/download/v3.1.4/aqt.exe ${aqt_path} SHOW_PROGRESS) - execute_process(COMMAND ${aqt_path} ${install_args}) + execute_process(COMMAND ${aqt_path} ${install_args} + WORKING_DIRECTORY ${base_path}) else() # aqt does not offer binary releases for other platforms, so download and run from pip. - set(aqt_install_path "${CMAKE_BINARY_DIR}/externals/aqt") - execute_process(COMMAND python3 -m pip install --target=${aqt_install_path} aqtinstall) - execute_process(COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${aqt_install_path} python3 -m aqt ${install_args}) + set(aqt_install_path "${base_path}/aqt") + file(MAKE_DIRECTORY "${aqt_install_path}") + + execute_process(COMMAND python3 -m pip install --target=${aqt_install_path} aqtinstall + WORKING_DIRECTORY ${base_path}) + execute_process(COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${aqt_install_path} python3 -m aqt ${install_args} + WORKING_DIRECTORY ${base_path}) endif() endif()