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>
This commit is contained in:
Joerg Bornemann 2012-09-21 16:28:11 +02:00 committed by The Qt Project
parent 07c44f7bd3
commit 461a01c1df
4 changed files with 34 additions and 1 deletions

View File

@ -451,6 +451,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)
@ -652,6 +656,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)
@ -2034,4 +2042,15 @@ QString VCXProjectWriter::generateCondition(const VCConfiguration &config)
return QStringLiteral("'$(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

View File

@ -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;

View File

@ -62,7 +62,8 @@ enum DotNET {
NET2003 = 0x71,
NET2005 = 0x80,
NET2008 = 0x90,
NET2010 = 0xa0
NET2010 = 0xa0,
NET2012 = 0xb0
};
/*

View File

@ -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
@ -413,6 +419,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
}
switch(which_dotnet_version()) {
case NET2012:
t << _slnHeader110;
break;
case NET2010:
t << _slnHeader100;
break;
@ -825,6 +834,9 @@ void VcprojGenerator::initProject()
// Own elements -----------------------------
vcProject.Name = unescapeFilePath(project->first("QMAKE_ORIG_TARGET").toQString());
switch(which_dotnet_version()) {
case NET2012:
vcProject.Version = "12.00";
break;
case NET2010:
vcProject.Version = "10.00";
break;