summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Karlsson <jonas.karlsson@qt.io>2020-06-19 13:34:48 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-07-15 15:13:05 +0000
commita99bc30e1e07b5307ad34b2114fc2e108df6a1f2 (patch)
tree48041c9a81a5ef22d2d7738da821cf369b8b70e3
parent124590850b7017233e25366688715ef642c5cdc3 (diff)
Add OS-specific prelude to qt-cmake-standalone-test
This makes sure the executable is run as a shell script with the proper interpreter on Unix systems. Otherwise it will fail in some shells, like fish. On windows, it prevents all commands in the batch file from displaying on the screen. Change-Id: If554262f172b035b9661b3e2ff26a96789fa707b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rwxr-xr-xbin/qt-cmake-standalone-test.in2
-rw-r--r--cmake/QtBaseGlobalTargets.cmake2
2 files changed, 4 insertions, 0 deletions
diff --git a/bin/qt-cmake-standalone-test.in b/bin/qt-cmake-standalone-test.in
index fce287ac94..91413b21eb 100755
--- a/bin/qt-cmake-standalone-test.in
+++ b/bin/qt-cmake-standalone-test.in
@@ -1 +1,3 @@
+@__qt_cmake_standalone_test_os_prelude@
+
@__qt_cmake_private_path@ @__qt_cmake_standalone_test_path@ -DQT_STANDALONE_TEST_PATH=@__qt_cmake_standalone_passed_args@
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake
index 355a24eaed..ec17164153 100644
--- a/cmake/QtBaseGlobalTargets.cmake
+++ b/cmake/QtBaseGlobalTargets.cmake
@@ -239,9 +239,11 @@ if(QT_WILL_INSTALL)
"${__qt_cmake_standalone_test_path}")
endif()
if(UNIX)
+ set(__qt_cmake_standalone_test_os_prelude "#!/bin/sh")
string(PREPEND __qt_cmake_private_path "exec ")
set(__qt_cmake_standalone_passed_args "\"$@\" -DPWD=\"$PWD\"")
else()
+ set(__qt_cmake_standalone_test_os_prelude "@echo off")
string(APPEND __qt_cmake_standalone_test_bin_name ".bat")
string(APPEND __qt_cmake_private_path ".bat")
set(__qt_cmake_standalone_passed_args "%* -DPWD=\"%CD%\"")