diff options
author | Brad King <brad.king@kitware.com> | 2009-09-16 15:44:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-09-16 15:44:08 (GMT) |
commit | 09e398fa9f6e2a858780c78e3096a56e96a3dcb7 (patch) | |
tree | 39bc29839c768ee5253adf222d10ad6a475577d2 | |
parent | 33207a9a87d53b7cb97e0b30bc36dccad3c50289 (diff) | |
download | CMake-09e398fa9f6e2a858780c78e3096a56e96a3dcb7.zip CMake-09e398fa9f6e2a858780c78e3096a56e96a3dcb7.tar.gz CMake-09e398fa9f6e2a858780c78e3096a56e96a3dcb7.tar.bz2 |
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.
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio6Generator.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.h | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.h | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio9Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.h | 3 |
8 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 562b546..22351cd 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -73,5 +73,7 @@ public: virtual std::string GetUserMacrosRegKeyBase(); virtual const char* GetCMakeCFGInitDirectory() { return "$(ConfigurationName)";} +protected: + virtual const char* GetIDEVersion() { return "10.0"; } }; #endif diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h index ab023a3..91e7973 100644 --- a/Source/cmGlobalVisualStudio6Generator.h +++ b/Source/cmGlobalVisualStudio6Generator.h @@ -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); diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index ed847e1..22c5dd4 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -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, diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index e04b05a..54bb5e1 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -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); diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 74ee3c7..11f33d3 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -64,6 +64,7 @@ public: virtual std::string GetUserMacrosRegKeyBase(); protected: + virtual const char* GetIDEVersion() { return "8.0"; } virtual bool VSLinksDependencies() const { return false; } diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h index 0841603..ea31ab5 100644 --- a/Source/cmGlobalVisualStudio9Generator.h +++ b/Source/cmGlobalVisualStudio9Generator.h @@ -65,5 +65,7 @@ public: * Studio? */ virtual std::string GetUserMacrosRegKeyBase(); +protected: + virtual const char* GetIDEVersion() { return "9.0"; } }; #endif diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 43e3a81..6e91552 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -32,6 +32,14 @@ cmGlobalVisualStudioGenerator::~cmGlobalVisualStudioGenerator() } //---------------------------------------------------------------------------- +std::string cmGlobalVisualStudioGenerator::GetRegistryBase() +{ + std::string key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\"; + key += this->GetIDEVersion(); + return key; +} + +//---------------------------------------------------------------------------- void cmGlobalVisualStudioGenerator::Generate() { // Add a special target that depends on ALL projects for easy build diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index e7b8e46..f471300 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -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); |