Rename/constify build-time config placeholder lookup

Rename cmGlobalGenerator::GetCMakeCFG{InitDirectory => IntDir} to
have a shorter name without a typo.  Add a 'const' qualifier since
the method is only for lookup and never needs to modify anything.
This commit is contained in:
Brad King 2012-03-08 16:18:55 -05:00
parent 46f4940675
commit 9c0a00d6dd
8 changed files with 9 additions and 9 deletions

View File

@ -1769,7 +1769,7 @@ void cmGlobalGenerator::SetCMakeInstance(cmake* cm)
void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
{ {
cmMakefile* mf = this->LocalGenerators[0]->GetMakefile(); cmMakefile* mf = this->LocalGenerators[0]->GetMakefile();
const char* cmakeCfgIntDir = this->GetCMakeCFGInitDirectory(); const char* cmakeCfgIntDir = this->GetCMakeCFGIntDir();
const char* cmakeCommand = mf->GetRequiredDefinition("CMAKE_COMMAND"); const char* cmakeCommand = mf->GetRequiredDefinition("CMAKE_COMMAND");
// CPack // CPack

View File

@ -184,7 +184,7 @@ public:
const char* GetLanguageOutputExtension(cmSourceFile const&); const char* GetLanguageOutputExtension(cmSourceFile const&);
///! What is the configurations directory variable called? ///! What is the configurations directory variable called?
virtual const char* GetCMakeCFGInitDirectory() { return "."; } virtual const char* GetCMakeCFGIntDir() const { return "."; }
/** Get whether the generator should use a script for link commands. */ /** Get whether the generator should use a script for link commands. */
bool GetUseLinkScript() const { return this->UseLinkScript; } bool GetUseLinkScript() const { return this->UseLinkScript; }

View File

@ -72,7 +72,7 @@ public:
* Studio? * Studio?
*/ */
virtual std::string GetUserMacrosRegKeyBase(); virtual std::string GetUserMacrosRegKeyBase();
virtual const char* GetCMakeCFGInitDirectory() virtual const char* GetCMakeCFGIntDir() const
{ return "$(Configuration)";} { return "$(Configuration)";}
bool Find64BitTools(cmMakefile* mf); bool Find64BitTools(cmMakefile* mf);
protected: protected:

View File

@ -82,7 +82,7 @@ public:
std::string& dir); std::string& dir);
///! What is the configurations directory variable called? ///! What is the configurations directory variable called?
virtual const char* GetCMakeCFGInitDirectory() { return "$(IntDir)"; } virtual const char* GetCMakeCFGIntDir() const { return "$(IntDir)"; }
protected: protected:
virtual const char* GetIDEVersion() { return "6.0"; } virtual const char* GetIDEVersion() { return "6.0"; }

View File

@ -87,7 +87,7 @@ public:
std::string& dir); std::string& dir);
///! What is the configurations directory variable called? ///! What is the configurations directory variable called?
virtual const char* GetCMakeCFGInitDirectory() { return "$(OutDir)"; } virtual const char* GetCMakeCFGIntDir() const { return "$(OutDir)"; }
/** Return true if the target project file should have the option /** Return true if the target project file should have the option
LinkLibraryDependencies and link to .sln dependencies. */ LinkLibraryDependencies and link to .sln dependencies. */

View File

@ -3283,7 +3283,7 @@ cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char* cmGlobalXCodeGenerator::GetCMakeCFGInitDirectory() const char* cmGlobalXCodeGenerator::GetCMakeCFGIntDir() const
{ {
return this->XcodeVersion >= 21 ? return this->XcodeVersion >= 21 ?
"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" : "."; "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" : ".";

View File

@ -74,7 +74,7 @@ public:
std::string& dir); std::string& dir);
///! What is the configurations directory variable called? ///! What is the configurations directory variable called?
virtual const char* GetCMakeCFGInitDirectory(); virtual const char* GetCMakeCFGIntDir() const;
void SetCurrentLocalGenerator(cmLocalGenerator*); void SetCurrentLocalGenerator(cmLocalGenerator*);

View File

@ -945,7 +945,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
outName += ".rule"; outName += ".rule";
const char* dir = const char* dir =
this->LocalGenerator->GetGlobalGenerator()-> this->LocalGenerator->GetGlobalGenerator()->
GetCMakeCFGInitDirectory(); GetCMakeCFGIntDir();
if(dir && dir[0] == '$') if(dir && dir[0] == '$')
{ {
cmSystemTools::ReplaceString(outName, dir, cmSystemTools::ReplaceString(outName, dir,
@ -2865,7 +2865,7 @@ void cmMakefile::EnableLanguage(std::vector<std::string> const & lang,
{ {
this->AddDefinition("CMAKE_CFG_INTDIR", this->AddDefinition("CMAKE_CFG_INTDIR",
this->LocalGenerator->GetGlobalGenerator() this->LocalGenerator->GetGlobalGenerator()
->GetCMakeCFGInitDirectory()); ->GetCMakeCFGIntDir());
this->LocalGenerator->GetGlobalGenerator()->EnableLanguage(lang, this, this->LocalGenerator->GetGlobalGenerator()->EnableLanguage(lang, this,
optional); optional);
} }