diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2012-09-21 14:28:11 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-09 08:23:30 (GMT) |
commit | 63097b8ab370607b5952d4278609776b0b150634 (patch) | |
tree | f8daaec77d3180947247b7158857c4ec73c7e7cd /qmake | |
parent | e8460dbefd30b657f27c0c111e8e2ec5d74d6bb2 (diff) | |
download | Qt-63097b8ab370607b5952d4278609776b0b150634.zip Qt-63097b8ab370607b5952d4278609776b0b150634.tar.gz Qt-63097b8ab370607b5952d4278609776b0b150634.tar.bz2 |
qmake: support for Visual Studio 2012 project files added
The differences to VS 2010 project files are the
version number (surprise!) and the PlatformToolSet tag which
sets the version of the toolchain.
Change-Id: If26f08fad1a69d7e6cd28cc5e860ff964f19b264
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from commit 461a01c1df88cdea0e8109948d125fc58a185cf8)
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/win32/msbuild_objectmodel.cpp | 19 | ||||
-rw-r--r-- | qmake/generators/win32/msbuild_objectmodel.h | 1 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.h | 3 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 12 |
4 files changed, 34 insertions, 1 deletions
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 5df4718..dc6755d 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -450,6 +450,10 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProjectSingleConfig &tool) << attrTag("Condition", condition) << valueTag(tool.Configuration.IntermediateDirectory); } + if (tool.Configuration.CompilerVersion >= NET2012) { + xml << tagValue("PlatformToolSet", + platformToolSetVersion(tool.Configuration.CompilerVersion)); + } if ( !tool.Configuration.PrimaryOutput.isEmpty() ) { xml<< tag("TargetName") << attrTag("Condition", condition) @@ -645,6 +649,10 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool) << attrTag("Condition", condition) << valueTag(config.IntermediateDirectory); } + if (config.CompilerVersion >= NET2012) { + xml << tagValue("PlatformToolSet", + platformToolSetVersion(config.CompilerVersion)); + } if (!config.PrimaryOutput.isEmpty()) { xml << tag("TargetName") << attrTag("Condition", condition) @@ -1959,4 +1967,15 @@ QString VCXProjectWriter::generateCondition(const VCConfiguration &config) return QLatin1String("'$(Configuration)|$(Platform)'=='") + config.Name + QLatin1Char('\''); } +QString VCXProjectWriter::platformToolSetVersion(const DotNET version) +{ + switch (version) + { + case NET2012: + return "v110"; + } + Q_ASSERT(!"This MSVC version does not support the PlatformToolSet tag!"); + return QString(); +} + QT_END_NAMESPACE diff --git a/qmake/generators/win32/msbuild_objectmodel.h b/qmake/generators/win32/msbuild_objectmodel.h index ed3778d..8be1284 100644 --- a/qmake/generators/win32/msbuild_objectmodel.h +++ b/qmake/generators/win32/msbuild_objectmodel.h @@ -183,6 +183,7 @@ private: static void outputFileConfigs(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const VCFilterFile &info, const QString &filtername); static bool outputFileConfig(VCFilter &filter, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filename, const QString &filtername, bool fileAllreadyAdded); static QString generateCondition(const VCConfiguration &config); + static QString platformToolSetVersion(const DotNET version); friend class XTreeNode; friend class XFlatNode; diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 23d0bc3..814ca7a 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -59,7 +59,8 @@ enum DotNET { NET2003 = 0x71, NET2005 = 0x80, NET2008 = 0x90, - NET2010 = 0xa0 + NET2010 = 0xa0, + NET2012 = 0xb0 }; /* diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 56f004e..1a1ad91 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -76,6 +76,8 @@ struct { const char *regKey; } dotNetCombo[] = { #ifdef Q_OS_WIN64 + {NET2012, "MSVC.NET 2012 (11.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir"}, + {NET2012, "MSVC.NET 2012 Express Edition (11.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\11.0\\Setup\\VC\\ProductDir"}, {NET2010, "MSVC.NET 2010 (10.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir"}, {NET2010, "MSVC.NET 2010 Express Edition (10.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\10.0\\Setup\\VC\\ProductDir"}, {NET2008, "MSVC.NET 2008 (9.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir"}, @@ -85,6 +87,8 @@ struct { {NET2003, "MSVC.NET 2003 (7.1)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir"}, {NET2002, "MSVC.NET 2002 (7.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir"}, #else + {NET2012, "MSVC.NET 2012 (11.0)", "Software\\Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir"}, + {NET2012, "MSVC.NET 2012 Express Edition (11.0)", "Software\\Microsoft\\VCExpress\\11.0\\Setup\\VC\\ProductDir"}, {NET2010, "MSVC.NET 2010 (10.0)", "Software\\Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir"}, {NET2010, "MSVC.NET 2010 Express Edition (10.0)", "Software\\Microsoft\\VCExpress\\10.0\\Setup\\VC\\ProductDir"}, {NET2008, "MSVC.NET 2008 (9.0)", "Software\\Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir"}, @@ -176,6 +180,8 @@ const char _slnHeader90[] = "Microsoft Visual Studio Solution File, Format "\n# Visual Studio 2008"; const char _slnHeader100[] = "Microsoft Visual Studio Solution File, Format Version 11.00" "\n# Visual Studio 2010"; +const char _slnHeader110[] = "Microsoft Visual Studio Solution File, Format Version 12.00" + "\n# Visual Studio 2012"; // The following UUID _may_ change for later servicepacks... // If so we need to search through the registry at // HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Projects @@ -392,6 +398,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) } switch(which_dotnet_version()) { + case NET2012: + t << _slnHeader110; + break; case NET2010: t << _slnHeader100; break; @@ -815,6 +824,9 @@ void VcprojGenerator::initProject() // Own elements ----------------------------- vcProject.Name = unescapeFilePath(project->first("QMAKE_ORIG_TARGET")); switch(which_dotnet_version()) { + case NET2012: + vcProject.Version = "12.00"; + break; case NET2010: vcProject.Version = "10.00"; break; |