diff options
author | Hannah von Reth <hannah.vonreth@kdab.com> | 2016-11-11 10:02:34 +0100 |
---|---|---|
committer | Hannah von Reth <hannah.vonreth@kdab.com> | 2016-11-14 16:03:39 +0000 |
commit | aeb2768a7c5b23260e6ca0826b844777b9948b6c (patch) | |
tree | e3afe9912796f77a9858e65f20eed0224558300b | |
parent | 104e6d0f5427f5ebaab106b1651eb76c4c56df98 (diff) |
Introduce QMAKE_CD to enable us to cd from one Windows drive to another
On Windows cd does not change the drive. So when you are on drive C:
and type "cd D:\data" it will change the directory on drive D: but not
affect your current working directory.
To also change your drive you have to provide the parameter /d on
Windows, so "cd /d D:\data" will also change the drive.
Task-number: QTBUG-57080
Change-Id: Ib629879534523982eec693cef725f20a535a1a74
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
-rw-r--r-- | mkspecs/features/configure.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/ctest_testcase_common.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/qt_configure.prf | 4 | ||||
-rw-r--r-- | mkspecs/features/qt_parts.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/spec_post.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/testcase.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/uikit/xcodebuild.prf | 2 |
7 files changed, 9 insertions, 7 deletions
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf index 147d6f178c..62eae6d813 100644 --- a/mkspecs/features/configure.prf +++ b/mkspecs/features/configure.prf @@ -31,7 +31,7 @@ defineTest(qtCompileTest) { test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$1 test_out_dir = $$shadowed($$test_dir) - test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&" + test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&" # Disable qmake features which are typically counterproductive for tests qmake_configs = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\"" diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf index af80fc00a1..8cdad77a78 100644 --- a/mkspecs/features/ctest_testcase_common.prf +++ b/mkspecs/features/ctest_testcase_common.prf @@ -86,7 +86,7 @@ for (MODULE_UNDER_TEST, CMAKE_QT_MODULES_UNDER_TEST) { CMAKE_MODULES_UNDER_TEST = $$join(CMAKE_MODULES_UNDER_TEST, ;) check.commands = \ - $(MKDIR) $$BUILD_DIR && cd $$BUILD_DIR && \ + $(MKDIR) $$BUILD_DIR && $$QMAKE_CD $$BUILD_DIR && \ cmake $$CMAKE_TEST_LOCATION $$CMAKE_GENERATOR \ -DCMAKE_C_COMPILER=$$QMAKE_CC \ -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \ diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index d5b9c6dc11..47772be8de 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -324,7 +324,7 @@ defineTest(qtConfParseCommandLine) { defineReplace(qtConfToolchainSupportsFlag) { test_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR) - test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&" + test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&" conftest = "int main() { return 0; }" write_file("$$test_out_dir/conftest.cpp", conftest)|error() @@ -696,7 +696,7 @@ defineTest(qtConfTest_compile) { test_out_dir = $$shadowed($$test_dir) !isEmpty($${1}.pro): \ test_dir = $$test_dir/$$eval($${1}.pro) - test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&" + test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&" qmake_args = $$qtConfPkgConfigEnv()$$system_quote($$system_path($$QMAKE_QMAKE)) !isEmpty(QMAKE_QTCONF): \ diff --git a/mkspecs/features/qt_parts.prf b/mkspecs/features/qt_parts.prf index 0accef6665..67e218ca73 100644 --- a/mkspecs/features/qt_parts.prf +++ b/mkspecs/features/qt_parts.prf @@ -88,7 +88,7 @@ for (t, tests): \ testdirs = $$unique(testdirs) for (td, testdirs) { t = $$basename(td)-distclean - $${t}.commands = -cd $$shell_path($$td) && $(MAKE) distclean + $${t}.commands = -$$QMAKE_CD $$shell_path($$td) && $(MAKE) distclean QMAKE_EXTRA_TARGETS += $$t DISTCLEAN_DEPS += $$t } diff --git a/mkspecs/features/spec_post.prf b/mkspecs/features/spec_post.prf index 234189fed1..f87bf3c037 100644 --- a/mkspecs/features/spec_post.prf +++ b/mkspecs/features/spec_post.prf @@ -67,6 +67,7 @@ equals(MAKEFILE_GENERATOR, MSBUILD) \ |isEmpty(QMAKE_SH) { QMAKE_ZIP = zip -r -9 + QMAKE_CD = cd /d QMAKE_COPY = copy /y QMAKE_COPY_FILE = $$QMAKE_COPY QMAKE_COPY_DIR = xcopy /s /q /y /i @@ -87,6 +88,7 @@ equals(MAKEFILE_GENERATOR, MSBUILD) \ QMAKE_TAR = tar -cf QMAKE_GZIP = gzip -9f + QMAKE_CD = cd QMAKE_COPY = cp -f QMAKE_COPY_FILE = $$QMAKE_COPY QMAKE_COPY_DIR = $$QMAKE_COPY -R diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 83ff177856..c202664c47 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -49,7 +49,7 @@ unix { $${type}.commands += $(TESTARGS) !isEmpty(TESTRUN_CWD):!contains(TESTRUN_CWD, ^\\./?): \ - $${type}.commands = cd $$shell_path($$TESTRUN_CWD) && $$eval($${type}.commands) + $${type}.commands = $$QMAKE_CD $$shell_path($$TESTRUN_CWD) && $$eval($${type}.commands) # If the test is marked as insignificant, discard the exit code insignificant_test: $${type}.commands = -$$eval($${type}.commands) diff --git a/mkspecs/features/uikit/xcodebuild.prf b/mkspecs/features/uikit/xcodebuild.prf index df015b583a..a766b9ea5c 100644 --- a/mkspecs/features/uikit/xcodebuild.prf +++ b/mkspecs/features/uikit/xcodebuild.prf @@ -27,7 +27,7 @@ for(arg, QMAKE_ARGS) { cmd = "$$QMAKE_QMAKE $$system_quote($$_PRO_FILE_) -spec macx-xcode $$args" debug(1, "Generating Xcode project in $$OUT_PWD using '$$cmd'") -system("cd $$system_quote($$OUT_PWD) && $$cmd") +system("$$QMAKE_CD $$system_quote($$OUT_PWD) && $$cmd") # Subtargets |