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
Task-number: QTBUG-126827
Change-Id: I8f9923db8dc670a6efbd6f75c48da5dfd1af687d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 65f08c09713b6d167638c4e19ebafcac045fc1c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2025-01-31 09:24:48 +01:00 committed by Qt Cherry-pick Bot
parent 01b90c38e7
commit 9ffc3b0705

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}\")
")