summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/ctest_testcase_common.prf12
1 files changed, 7 insertions, 5 deletions
diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf
index 4c7e03f0f7..f5eafc4e0d 100644
--- a/mkspecs/features/ctest_testcase_common.prf
+++ b/mkspecs/features/ctest_testcase_common.prf
@@ -1,11 +1,15 @@
win32 {
- CMAKE_VERSION = $$system(cmake --version 2>NUL, lines)
+ cmake_version_output = $$system(cmake --version 2>NUL, lines)
} else {
- CMAKE_VERSION = $$system(cmake --version 2>/dev/null, lines)
+ cmake_version_output = $$system(cmake --version 2>/dev/null, lines)
}
-CMAKE_VERSION = $$member(CMAKE_VERSION, 0, 0)
+# First line
+cmake_version_output = $$first(cmake_version_output)
+# Format is "cmake version X.Y.Z"
+cmake_version_output = $$split(cmake_version_output)
+CMAKE_VERSION = $$last(cmake_version_output)
check.commands =
QMAKE_EXTRA_TARGETS *= check
@@ -26,8 +30,6 @@ isEmpty(CTEST_VERSION) {
return()
}
-CMAKE_VERSION = $$last(CMAKE_VERSION)
-
!versionAtLeast(CMAKE_VERSION, 2.8.3) {
message("cmake $$CMAKE_VERSION is too old for this test.")
return()