configure.pri: Determine MSVC compiler version

Run cl.exe /? and extract version from header line printed
to standard error.

Change-Id: Iecf18f1b0f94cc1d51add7021d80772784e0f953
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
bb10
Friedemann Kleint 2016-09-01 10:05:55 +02:00
parent ed9f8a0e9d
commit 7fb3448161
1 changed files with 3 additions and 0 deletions

View File

@ -281,8 +281,11 @@ defineTest(qtConfTest_checkCompiler) {
$${1}.compilerId = "icc"
$${1}.compilerVersion = $$replace(version, "icpc version ([0-9.]+).*", "\\1")
} else: msvc {
qtRunLoggedCommand("$$QMAKE_CXX /? 2>&1", version)|return(false)
version = "$$version"
$${1}.compilerDescription = "MSVC"
$${1}.compilerId = "cl"
$${1}.compilerVersion = $$replace(version, "^.*Compiler Version ([0-9.]+) for.*$", "\\1")
} else {
return(false)
}