From 9a50333dd03969abb3f09c0f90dcb4afd048e47a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 16 Aug 2017 14:17:38 +0200 Subject: Fix CMake version resolving Otherwise 3.8.1 is treated as not recent enough than the required 2.8.3 Change-Id: I198fc7d54e3da935fd163c9b9bb7dc12b986d1c2 Reviewed-by: Konstantin Tokarev --- mkspecs/features/ctest_testcase_common.prf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'mkspecs') 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() -- cgit v1.2.3