Create VS generator GetRegistryBase method

This method returns the registry key

  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\<version>

A protected GetIDEVersion method retrieves the version-specific part of
the key name.
This commit is contained in:
Brad King 2009-09-16 11:44:08 -04:00
parent 33207a9a87
commit 09e398fa9f
8 changed files with 22 additions and 0 deletions

View File

@ -73,5 +73,7 @@ public:
virtual std::string GetUserMacrosRegKeyBase();
virtual const char* GetCMakeCFGInitDirectory()
{ return "$(ConfigurationName)";}
protected:
virtual const char* GetIDEVersion() { return "10.0"; }
};
#endif

View File

@ -88,6 +88,9 @@ public:
///! What is the configurations directory variable called?
virtual const char* GetCMakeCFGInitDirectory() { return "$(IntDir)"; }
protected:
virtual const char* GetIDEVersion() { return "6.0"; }
private:
void GenerateConfigurations(cmMakefile* mf);
void WriteDSWFile(std::ostream& fout);

View File

@ -57,6 +57,7 @@ public:
virtual std::string GetUserMacrosRegKeyBase();
protected:
virtual const char* GetIDEVersion() { return "7.1"; }
virtual void AddPlatformDefinitions(cmMakefile* mf);
virtual void WriteSLNFile(std::ostream& fout,
cmLocalGenerator* root,

View File

@ -103,6 +103,8 @@ public:
};
protected:
virtual const char* GetIDEVersion() { return "7.0"; }
static cmIDEFlagTable const* GetExtraFlagTableVS7();
virtual void OutputSLNFile(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);

View File

@ -64,6 +64,7 @@ public:
virtual std::string GetUserMacrosRegKeyBase();
protected:
virtual const char* GetIDEVersion() { return "8.0"; }
virtual bool VSLinksDependencies() const { return false; }

View File

@ -65,5 +65,7 @@ public:
* Studio?
*/
virtual std::string GetUserMacrosRegKeyBase();
protected:
virtual const char* GetIDEVersion() { return "9.0"; }
};
#endif

View File

@ -31,6 +31,14 @@ cmGlobalVisualStudioGenerator::~cmGlobalVisualStudioGenerator()
{
}
//----------------------------------------------------------------------------
std::string cmGlobalVisualStudioGenerator::GetRegistryBase()
{
std::string key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\";
key += this->GetIDEVersion();
return key;
}
//----------------------------------------------------------------------------
void cmGlobalVisualStudioGenerator::Generate()
{

View File

@ -68,6 +68,8 @@ public:
bool TargetIsFortranOnly(cmTarget& t);
const char* GetUtilityForTarget(cmTarget& target, const char*);
/** Get the top-level registry key for this VS version. */
std::string GetRegistryBase();
protected:
void FixUtilityDepends();
@ -76,6 +78,7 @@ protected:
// below 8.
virtual bool VSLinksDependencies() const { return true; }
virtual const char* GetIDEVersion() = 0;
private:
void FixUtilityDependsForTarget(cmTarget& target);
void CreateUtilityDependTarget(cmTarget& target);