瀏覽代碼

Merge topic 'vs-RootNamespace'

cca955a VS: Add VS_GLOBAL_ROOTNAMESPACE target property
Brad King 12 年之前
父節點
當前提交
90441b289d
共有 2 個文件被更改,包括 14 次插入0 次删除
  1. 5 0
      Source/cmTarget.cxx
  2. 9 0
      Source/cmVisualStudio10TargetGenerator.cxx

+ 5 - 0
Source/cmTarget.cxx

@@ -1336,6 +1336,11 @@ void cmTarget::DefineProperties(cmake *cm)
      "project. Defaults to \"Win32Proj\". You may wish to override "
      "project. Defaults to \"Win32Proj\". You may wish to override "
      "this value with \"ManagedCProj\", for example, in a Visual "
      "this value with \"ManagedCProj\", for example, in a Visual "
      "Studio managed C++ unit test project.");
      "Studio managed C++ unit test project.");
+  cm->DefineProperty
+    ("VS_GLOBAL_ROOTNAMESPACE", cmProperty::TARGET,
+     "Visual Studio project root namespace.",
+     "Sets the \"RootNamespace\" attribute for a generated Visual Studio "
+     "project.  The attribute will be generated only if this is set.");
   cm->DefineProperty
   cm->DefineProperty
     ("VS_DOTNET_REFERENCES", cmProperty::TARGET,
     ("VS_DOTNET_REFERENCES", cmProperty::TARGET,
      "Visual Studio managed project .NET references",
      "Visual Studio managed project .NET references",

+ 9 - 0
Source/cmVisualStudio10TargetGenerator.cxx

@@ -262,6 +262,15 @@ void cmVisualStudio10TargetGenerator::Generate()
       "</Keyword>\n";
       "</Keyword>\n";
     }
     }
 
 
+  const char* vsGlobalRootNamespace =
+    this->Target->GetProperty("VS_GLOBAL_ROOTNAMESPACE");
+  if(vsGlobalRootNamespace)
+    {
+    this->WriteString("<RootNamespace>", 2);
+    (*this->BuildFileStream) << cmVS10EscapeXML(vsGlobalRootNamespace) <<
+      "</RootNamespace>\n";
+    }
+
   this->WriteString("<Platform>", 2);
   this->WriteString("<Platform>", 2);
   (*this->BuildFileStream) << this->Platform << "</Platform>\n";
   (*this->BuildFileStream) << this->Platform << "</Platform>\n";
   const char* projLabel = this->Target->GetProperty("PROJECT_LABEL");
   const char* projLabel = this->Target->GetProperty("PROJECT_LABEL");