Ver Fonte

VS: Add a hook to adapt to SystemName and SystemVersion

Add a virtual cmGlobalVisualStudio10Generator::InitializeSystem method
called from SetSystemName once the SystemName and SystemVersion members
have been populated.  This will give VS version-specific generators a
chance to recognize and adapt to the target system.
Brad King há 11 anos atrás
pai
commit
e58f97531a

+ 10 - 0
Source/cmGlobalVisualStudio10Generator.cxx

@@ -130,6 +130,10 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s,
 {
   this->SystemName = s;
   this->SystemVersion = mf->GetSafeDefinition("CMAKE_SYSTEM_VERSION");
+  if(!this->InitializeSystem(mf))
+    {
+    return false;
+    }
   if(this->PlatformName == "Itanium" || this->PlatformName == "x64")
     {
     if(this->IsExpressEdition() && !this->Find64BitTools(mf))
@@ -141,6 +145,12 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s,
   return this->cmGlobalVisualStudio8Generator::SetSystemName(s, mf);
 }
 
+//----------------------------------------------------------------------------
+bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile*)
+{
+  return true;
+}
+
 //----------------------------------------------------------------------------
 void cmGlobalVisualStudio10Generator
 ::AddVSPlatformToolsetDefinition(cmMakefile* mf) const

+ 1 - 0
Source/cmGlobalVisualStudio10Generator.h

@@ -92,6 +92,7 @@ public:
 
 protected:
   virtual void Generate();
+  virtual bool InitializeSystem(cmMakefile* mf);
 
   virtual const char* GetIDEVersion() { return "10.0"; }