[qmake] Adjust vswhere command to find any VS product containing latest vcredist.

This commit is contained in:
Mat Sutcliffe
2019-02-13 17:52:46 +00:00
parent 1a30e24652
commit 48b16b9598

View File

@@ -147,9 +147,10 @@ unix:!macx {
############### Install VC runtime ############## ############### Install VC runtime ##############
win32-msvc { win32-msvc {
# https://github.com/Microsoft/vswhere/wiki/Find-VC # https://github.com/Microsoft/vswhere/wiki
VS_WHERE = $$getenv(programfiles(x86))/Microsoft Visual Studio/Installer/vswhere.exe VS_WHERE = $$system_quote($$system_path($$getenv(programfiles(x86))/Microsoft Visual Studio/Installer/vswhere.exe))
VS_PATH = $$system($$system_quote($$system_path($$VS_WHERE)) -latest -property installationPath) VC_REDIST_COMPONENT = Microsoft.VisualStudio.Component.VC.Redist.14.Latest
VS_PATH = $$system($$VS_WHERE -latest -products * -requires $$VC_REDIST_COMPONENT -property installationPath)
VC_REDIST_VERSION = $$cat($$VS_PATH/VC/Auxiliary/Build/Microsoft.VCRedistVersion.default.txt) VC_REDIST_VERSION = $$cat($$VS_PATH/VC/Auxiliary/Build/Microsoft.VCRedistVersion.default.txt)
VC_REDIST_PATH = $$VS_PATH/VC/Redist/MSVC/$$VC_REDIST_VERSION VC_REDIST_PATH = $$VS_PATH/VC/Redist/MSVC/$$VC_REDIST_VERSION