summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2024-02-28 16:07:27 +0100
committerRobert Griebl <robert.griebl@qt.io>2024-02-28 16:50:34 +0000
commitbd5e3774a5fa21ae3329715f1ca392685cd05485 (patch)
tree15c1e5d7499519fa7984da203432fc0dd8a4ee3b
parent04011fe78554717c81698cafc5fd96a994b793e3 (diff)
CMake: Change the cwd to the location of the system-ui-wrapper script
This makes sure the script works correctly wherever it is called from. Change-Id: Ic19ca09890f0ee82a2fa5e3dca81403f2b849eae Fixes: QTBUG-117010 Pick-to: 6.7 6.6 6.5 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
-rw-r--r--src/main-lib/Qt6AppManMainPrivateMacros.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main-lib/Qt6AppManMainPrivateMacros.cmake b/src/main-lib/Qt6AppManMainPrivateMacros.cmake
index 12cd9dd1..77cf7f81 100644
--- a/src/main-lib/Qt6AppManMainPrivateMacros.cmake
+++ b/src/main-lib/Qt6AppManMainPrivateMacros.cmake
@@ -118,6 +118,7 @@ function(qt6_am_add_systemui_wrapper target)
file(GENERATE OUTPUT ${WRAPPER_SCRIPT} CONTENT
"@echo off
+cd \"%~dp0\"
SetLocal EnableDelayedExpansion
(set \"PATH=${test_env_path};%PATH%\")
(set \"QT_PLUGIN_PATH=${test_env_plugin_path}\")
@@ -130,6 +131,7 @@ EndLocal
set(WRAPPER_SCRIPT "_${target}$<CONFIG>${WRAPPER_SUFFIX}")
file(GENERATE OUTPUT ${WRAPPER_SCRIPT} CONTENT
"#!/bin/sh
+cd \"\${0%/*}\"
export PATH=\"${test_env_path}:$PATH\"
export QT_PLUGIN_PATH=\"${test_env_plugin_path}\"
exec ${ARG_EXECUTABLE} ${CMD_ARGS_STR} ${ARG_MAIN_QML_FILE} \"$@\";