diff options
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/doc/src/qmake-manual.qdoc | 26 | ||||
-rw-r--r-- | qmake/generators/win32/msbuild_objectmodel.cpp | 23 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.h | 2 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 4 |
4 files changed, 34 insertions, 21 deletions
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index 1a779a94b4..645422050b 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -2788,6 +2788,26 @@ See also \l{#DEPENDPATH}{DEPENDPATH}. + \target WINDOWS_TARGET_PLATFORM_VERSION + \section1 WINDOWS_TARGET_PLATFORM_VERSION + + Specifies the targeted Windows version; this corresponds to the tag + \c{WindowsTargetPlatformVersion} in vcxproj files. + + On desktop Windows, the default value is the value of the environment + variable \c{WindowsSDKVersion}. + + On WinRT, the default value is the value of the environment variable + \c{UCRTVERSION}. + + \target WINDOWS_TARGET_PLATFORM_MIN_VERSION + \section1 WINDOWS_TARGET_PLATFORM_MIN_VERSION + + Specifies the minimum version of the Windows target platform; this + corresponds to the tag \c{WindowsTargetPlatformMinVersion} in vcxproj files. + + Defaults to \c{WINDOWS_TARGET_PLATFORM_VERSION}. + \target WINRT_MANIFEST \section1 WINRT_MANIFEST @@ -2921,10 +2941,12 @@ \li The version number of the package. Defaults to \c{1.0.0.0}. \row \li minVersion - \li The minimum required Windows version to run the package. Defaults to the environment variable \c UCRTVersion. + \li The minimum required Windows version to run the package. + Defaults to \c{WINDOWS_TARGET_PLATFORM_VERSION}. \row \li maxVersionTested - \li The maximum Windows version the package has been tested against. Defaults to \c WINRT_MANIFEST.minVersion + \li The maximum Windows version the package has been tested against. + Defaults to \c{WINDOWS_TARGET_PLATFORM_MIN_VERSION}. \endtable diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index ad2976aa01..0e95766f8e 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -34,7 +34,6 @@ #include <qscopedpointer.h> #include <qstringlist.h> #include <qfileinfo.h> -#include <qversionnumber.h> QT_BEGIN_NAMESPACE @@ -625,31 +624,17 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool) << tagValue("RootNamespace", tool.Name) << tagValue("Keyword", tool.Keyword); - QString windowsTargetPlatformVersion; if (isWinRT) { xml << tagValue("MinimumVisualStudioVersion", tool.Version) << tagValue("DefaultLanguage", "en") << tagValue("AppContainerApplication", "true") << tagValue("ApplicationType", "Windows Store") << tagValue("ApplicationTypeRevision", tool.SdkVersion); - if (tool.SdkVersion == "10.0") - windowsTargetPlatformVersion = qgetenv("UCRTVERSION"); - } else { - QByteArray winSDKVersionStr = qgetenv("WindowsSDKVersion").trimmed(); - - // This environment variable might end with a backslash due to a VS bug. - if (winSDKVersionStr.endsWith('\\')) - winSDKVersionStr.chop(1); - - QVersionNumber winSDKVersion = QVersionNumber::fromString( - QString::fromLocal8Bit(winSDKVersionStr)); - if (!winSDKVersion.isNull()) - windowsTargetPlatformVersion = winSDKVersionStr; - } - if (!windowsTargetPlatformVersion.isEmpty()) { - xml << tagValue("WindowsTargetPlatformVersion", windowsTargetPlatformVersion) - << tagValue("WindowsTargetPlatformMinVersion", windowsTargetPlatformVersion); } + if (!tool.WindowsTargetPlatformVersion.isEmpty()) + xml << tagValue("WindowsTargetPlatformVersion", tool.WindowsTargetPlatformVersion); + if (!tool.WindowsTargetPlatformMinVersion.isEmpty()) + xml << tagValue("WindowsTargetPlatformMinVersion", tool.WindowsTargetPlatformMinVersion); xml << closetag(); diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 9d1a170489..f8f9804c27 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -1123,6 +1123,8 @@ public: QString SccLocalPath; QString PlatformName; QString SdkVersion; + QString WindowsTargetPlatformVersion; + QString WindowsTargetPlatformMinVersion; // Single projects QList<VCProjectSingleConfig> SingleProjects; diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 95c16661e7..db2a16ae35 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -191,6 +191,10 @@ bool VcprojGenerator::writeProjectMakefile() mergedProject.SccProjectName = mergedProjects.at(0)->vcProject.SccProjectName; mergedProject.SccLocalPath = mergedProjects.at(0)->vcProject.SccLocalPath; mergedProject.PlatformName = mergedProjects.at(0)->vcProject.PlatformName; + mergedProject.WindowsTargetPlatformVersion = + project->first("WINDOWS_TARGET_PLATFORM_VERSION").toQString(); + mergedProject.WindowsTargetPlatformMinVersion = + project->first("WINDOWS_TARGET_PLATFORM_MIN_VERSION").toQString(); XmlOutput xmlOut(t); projectWriter->write(xmlOut, mergedProject); |