summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudioGeneratorOptions.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-11-10 22:17:41 (GMT)
committerBrad King <brad.king@kitware.com>2011-11-14 14:47:31 (GMT)
commit1be4b6f4638334970a3d3f19891b5997ddcf5717 (patch)
tree7ce46559af786886bb622648efbff68ac4f17d2c /Source/cmVisualStudioGeneratorOptions.cxx
parent131d0ae4fc4d51fa8175bc3dfd323efccb1cc951 (diff)
downloadCMake-1be4b6f4638334970a3d3f19891b5997ddcf5717.zip
CMake-1be4b6f4638334970a3d3f19891b5997ddcf5717.tar.gz
CMake-1be4b6f4638334970a3d3f19891b5997ddcf5717.tar.bz2
Order VS local generator Version ivar values consistently
Move the Version member to the top cmLocalVisualStudioGenerator class and set it consistently for instances created by all the global generator versions. Use an enumeration type with values scaled by a factor of 10 so we can handle VS 7.1 without out-of-order numbers. VS 7.1 support for SuppressStartupBanner was broken by commit 25116a3c (Fix CMAKE_VERBOSE_MAKEFILE for VS10 vcxproj files, 2011-10-11) because it assumed comparison of VS version numbers works. Now it does.
Diffstat (limited to 'Source/cmVisualStudioGeneratorOptions.cxx')
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 4edeedc..a3bf0ed 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -25,14 +25,13 @@ inline std::string cmVisualStudioGeneratorOptionsEscapeForXML(const char* s)
//----------------------------------------------------------------------------
cmVisualStudioGeneratorOptions
-::cmVisualStudioGeneratorOptions(cmLocalGenerator* lg,
- int version,
+::cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg,
Tool tool,
cmVS7FlagTable const* table,
cmVS7FlagTable const* extraTable,
cmVisualStudio10TargetGenerator* g):
cmIDEOptions(),
- LocalGenerator(lg), Version(version), CurrentTool(tool),
+ LocalGenerator(lg), Version(lg->GetVersion()), CurrentTool(tool),
TargetGenerator(g)
{
// Store the given flag tables.
@@ -61,11 +60,11 @@ void cmVisualStudioGeneratorOptions::FixExceptionHandlingDefault()
// remove the flag we need to override the IDE default of on.
switch (this->Version)
{
- case 7:
- case 71:
+ case cmLocalVisualStudioGenerator::VS7:
+ case cmLocalVisualStudioGenerator::VS71:
this->FlagMap["ExceptionHandling"] = "FALSE";
break;
- case 10:
+ case cmLocalVisualStudioGenerator::VS10:
// by default VS puts <ExceptionHandling></ExceptionHandling> empty
// for a project, to make our projects look the same put a new line
// and space over for the closing </ExceptionHandling> as the default
@@ -93,7 +92,8 @@ void cmVisualStudioGeneratorOptions::SetVerboseMakefile(bool verbose)
if(verbose &&
this->FlagMap.find("SuppressStartupBanner") == this->FlagMap.end())
{
- this->FlagMap["SuppressStartupBanner"] = this->Version < 10 ? "FALSE" : "";
+ this->FlagMap["SuppressStartupBanner"] =
+ this->Version < cmLocalVisualStudioGenerator::VS10 ? "FALSE" : "";
}
}
@@ -211,7 +211,7 @@ cmVisualStudioGeneratorOptions
{
return;
}
- if(this->Version == 10)
+ if(this->Version == cmLocalVisualStudioGenerator::VS10)
{
// if there are configuration specifc flags, then
// use the configuration specific tag for PreprocessorDefinitions
@@ -239,7 +239,7 @@ cmVisualStudioGeneratorOptions
{
// Escape the definition for the compiler.
std::string define;
- if(this->Version != 10)
+ if(this->Version != cmLocalVisualStudioGenerator::VS10)
{
define =
this->LocalGenerator->EscapeForShell(di->c_str(), true);
@@ -249,7 +249,7 @@ cmVisualStudioGeneratorOptions
define = *di;
}
// Escape this flag for the IDE.
- if(this->Version == 10)
+ if(this->Version == cmLocalVisualStudioGenerator::VS10)
{
define = cmVisualStudio10GeneratorOptionsEscapeForXML(define.c_str());
@@ -266,7 +266,7 @@ cmVisualStudioGeneratorOptions
fout << sep << define;
sep = ";";
}
- if(this->Version == 10)
+ if(this->Version == cmLocalVisualStudioGenerator::VS10)
{
fout << ";%(PreprocessorDefinitions)</PreprocessorDefinitions>" << suffix;
}
@@ -281,7 +281,7 @@ void
cmVisualStudioGeneratorOptions
::OutputFlagMap(std::ostream& fout, const char* indent)
{
- if(this->Version == 10)
+ if(this->Version == cmLocalVisualStudioGenerator::VS10)
{
for(std::map<cmStdString, cmStdString>::iterator m = this->FlagMap.begin();
m != this->FlagMap.end(); ++m)
@@ -326,7 +326,7 @@ cmVisualStudioGeneratorOptions
{
if(!this->FlagString.empty())
{
- if(this->Version == 10)
+ if(this->Version == cmLocalVisualStudioGenerator::VS10)
{
fout << prefix;
if(this->Configuration.size())