CMake: Wrap path in quotes to avoid issues with spaces in paths

Otherwise running the deployment script fails on macOS with something
like

CMake Error at
 .qt/deploy_qml_app_texteditorexample_32987d3e6e.cmake:1 (include):
  include called with invalid argument:
   2/build/.qt/QtDeploySupport.cmake

due to the following generated content:
  include(build/texteditor space 2/build/.qt/QtDeploySupport.cmake)

Pick-to: 6.8 6.9
Task-number: QTBUG-126827
Change-Id: I8f9923db8dc670a6efbd6f75c48da5dfd1af687d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexandru Croitor 2025-01-31 09:24:48 +01:00
parent bda78d0aab
commit 65f08c0971

View File

@ -3704,7 +3704,7 @@ function(qt6_generate_deploy_script)
set(${arg_OUTPUT_SCRIPT} "${deploy_script}" PARENT_SCOPE)
_qt_internal_get_i18n_catalogs_for_modules(catalogs ${QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE})
set(boiler_plate "include(${QT_DEPLOY_SUPPORT})
set(boiler_plate "include(\"${QT_DEPLOY_SUPPORT}\")
include(\"\${CMAKE_CURRENT_LIST_DIR}/${arg_TARGET}-plugins${config_infix}.cmake\" OPTIONAL)
set(__QT_DEPLOY_I18N_CATALOGS \"${catalogs}\")
")