VS: Convert PlatformName member to a virtual method

This commit is contained in:
Patrick Gansterer 2010-08-16 21:49:14 +02:00 committed by Brad King
parent d5e3e04a23
commit 807fca4ce6
10 changed files with 19 additions and 16 deletions

View File

@ -40,7 +40,7 @@ void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
cmLocalGenerator *cmGlobalVisualStudio10Generator::CreateLocalGenerator()
{
cmLocalVisualStudio10Generator* lg = new cmLocalVisualStudio10Generator;
lg->SetPlatformName(this->PlatformName.c_str());
lg->SetPlatformName(this->GetPlatformName());
lg->SetGlobalGenerator(this);
return lg;
}

View File

@ -16,7 +16,6 @@
//----------------------------------------------------------------------------
cmGlobalVisualStudio10Win64Generator::cmGlobalVisualStudio10Win64Generator()
{
this->PlatformName = "x64";
}
//----------------------------------------------------------------------------

View File

@ -27,6 +27,8 @@ public:
return cmGlobalVisualStudio10Win64Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 10 Win64";}
virtual const char* GetPlatformName() const {return "x64";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;

View File

@ -21,7 +21,6 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator()
{
this->FindMakeProgramFile = "CMakeVS8FindMake.cmake";
this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
this->PlatformName = "Win32";
}
//----------------------------------------------------------------------------
@ -30,6 +29,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion8();
lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;
@ -252,8 +252,8 @@ cmGlobalVisualStudio8Generator
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
{
fout << "\t\t" << *i << "|" << this->PlatformName << " = " << *i << "|"
<< this->PlatformName << "\n";
fout << "\t\t" << *i << "|" << this->GetPlatformName() << " = " << *i << "|"
<< this->GetPlatformName() << "\n";
}
fout << "\tEndGlobalSection\n";
}
@ -269,13 +269,13 @@ cmGlobalVisualStudio8Generator
i != this->Configurations.end(); ++i)
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->PlatformName << ".ActiveCfg = "
<< *i << "|" << this->PlatformName << "\n";
<< "|" << this->GetPlatformName() << ".ActiveCfg = "
<< *i << "|" << this->GetPlatformName() << "\n";
if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->PlatformName << ".Build.0 = "
<< *i << "|" << this->PlatformName << "\n";
<< "|" << this->GetPlatformName() << ".Build.0 = "
<< *i << "|" << this->GetPlatformName() << "\n";
}
}
}

View File

@ -32,14 +32,14 @@ public:
return cmGlobalVisualStudio8Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 8 2005";}
virtual const char* GetPlatformName() const {return "Win32";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
///! Create a local generator appropriate to this Global Generator
virtual cmLocalGenerator *CreateLocalGenerator();
std::string const& GetPlatformName() const { return this->PlatformName; }
/**
* Override Configure and Generate to add the build-system check
* target.
@ -78,6 +78,5 @@ protected:
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
bool partOfDefaultBuild);
std::string PlatformName; // Win32 or x64
};
#endif

View File

@ -19,7 +19,6 @@
cmGlobalVisualStudio8Win64Generator::cmGlobalVisualStudio8Win64Generator()
{
this->PlatformName = "x64";
}
///! Create a local generator appropriate to this Global Generator
@ -27,7 +26,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Win64Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion8();
lg->SetPlatformName(this->PlatformName.c_str());
lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;

View File

@ -33,6 +33,8 @@ public:
return cmGlobalVisualStudio8Win64Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 8 2005 Win64";}
virtual const char* GetPlatformName() const {return "x64";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;

View File

@ -42,6 +42,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion9();
lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;

View File

@ -16,7 +16,6 @@
cmGlobalVisualStudio9Win64Generator::cmGlobalVisualStudio9Win64Generator()
{
this->PlatformName = "x64";
}
///! Create a local generator appropriate to this Global Generator
@ -24,7 +23,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Win64Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion9();
lg->SetPlatformName(this->PlatformName.c_str());
lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;

View File

@ -33,6 +33,8 @@ public:
return cmGlobalVisualStudio9Win64Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 9 2008 Win64";}
virtual const char* GetPlatformName() const {return "x64";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;