[Cmake-commits] CMake branch, next, updated. v2.8.7-2455-g932b1c2

Brad King brad.king at kitware.com
Fri Feb 3 14:45:22 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  932b1c2e51eafa0cf0075f078079f6329056cc58 (commit)
       via  a03447b3dfb448b402a0451e4e436a135fee366e (commit)
       via  9e01aefd24cd23878bd88c2f3cae62b5e28802b0 (commit)
      from  6c610e4a24c836849b80378b13c39c9f58bd8b9d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=932b1c2e51eafa0cf0075f078079f6329056cc58
commit 932b1c2e51eafa0cf0075f078079f6329056cc58
Merge: 6c610e4 a03447b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Feb 3 14:45:07 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Feb 3 14:45:07 2012 -0500

    Merge topic 'VS11-WinRT-project-issue-12930' into next
    
    a03447b VS: Simplify ;-separated attribute value parsing
    9e01aef VS: Add support for WinRT project properties (#12930)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a03447b3dfb448b402a0451e4e436a135fee366e
commit a03447b3dfb448b402a0451e4e436a135fee366e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Feb 3 14:32:17 2012 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Feb 3 14:35:35 2012 -0500

    VS: Simplify ;-separated attribute value parsing
    
    An implementation ;-separated list parsing was added by commit a1f976ce
    (VS: Add support for three new project properties, 2011-11-23) and again
    by commit 9e01aefd (VS: Add support for WinRT project properties,
    2012-02-03).  Refactor both instances to use ExpandListArgument.

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 9193223..9418761 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -269,63 +269,49 @@ void cmVisualStudio10TargetGenerator::Generate()
 
 void cmVisualStudio10TargetGenerator::WriteDotNetReferences()
 {
-  const char* vsDotNetReferences
-    = this->Target->GetProperty("VS_DOTNET_REFERENCES");
-  if(vsDotNetReferences)
+  std::vector<std::string> references;
+  if(const char* vsDotNetReferences =
+     this->Target->GetProperty("VS_DOTNET_REFERENCES"))
+    {
+    cmSystemTools::ExpandListArgument(vsDotNetReferences, references);
+    }
+  if(!references.empty())
     {
-    std::string references(vsDotNetReferences);
-    std::string::size_type position = 0;
-
     this->WriteString("<ItemGroup>\n", 1);
-    while(references.length() > 0)
+    for(std::vector<std::string>::iterator ri = references.begin();
+        ri != references.end(); ++ri)
       {
-      if((position = references.find(";")) == std::string::npos)
-        {
-        position = references.length() + 1;
-        }
-
       this->WriteString("<Reference Include=\"", 2);
-      (*this->BuildFileStream) <<
-        cmVS10EscapeXML(references.substr(0, position)) << "\">\n";
+      (*this->BuildFileStream) << cmVS10EscapeXML(*ri) << "\">\n";
       this->WriteString("<CopyLocalSatelliteAssemblies>true"
                         "</CopyLocalSatelliteAssemblies>\n", 3);
       this->WriteString("<ReferenceOutputAssembly>true"
                         "</ReferenceOutputAssembly>\n", 3);
       this->WriteString("</Reference>\n", 2);
-
-      references.erase(0, position + 1);
       }
-
     this->WriteString("</ItemGroup>\n", 1);
     }
 }
 
 void cmVisualStudio10TargetGenerator::WriteWinRTReferences()
 {
-  const char* vsWinRTReferences
-    = this->Target->GetProperty("VS_WINRT_REFERENCES");
-  if(vsWinRTReferences)
+  std::vector<std::string> references;
+  if(const char* vsWinRTReferences =
+     this->Target->GetProperty("VS_WINRT_REFERENCES"))
+    {
+    cmSystemTools::ExpandListArgument(vsWinRTReferences, references);
+    }
+  if(!references.empty())
     {
-    std::string references(vsWinRTReferences);
-    std::string::size_type position = 0;
-
     this->WriteString("<ItemGroup>\n", 1);
-    while(references.length() > 0)
+    for(std::vector<std::string>::iterator ri = references.begin();
+        ri != references.end(); ++ri)
       {
-      if((position = references.find(";")) == std::string::npos)
-        {
-        position = references.length() + 1;
-        }
-
       this->WriteString("<Reference Include=\"", 2);
-      (*this->BuildFileStream) <<
-        cmVS10EscapeXML(references.substr(0, position)) << "\">\n";
+      (*this->BuildFileStream) << cmVS10EscapeXML(*ri) << "\">\n";
       this->WriteString("<IsWinMDFile>true</IsWinMDFile>\n", 3);
       this->WriteString("</Reference>\n", 2);
-
-      references.erase(0, position + 1);
       }
-
     this->WriteString("</ItemGroup>\n", 1);
     }
 }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e01aefd24cd23878bd88c2f3cae62b5e28802b0
commit 9e01aefd24cd23878bd88c2f3cae62b5e28802b0
Author:     Eugene Golushkov <eugene_gff at ukr.net>
AuthorDate: Fri Feb 3 09:07:12 2012 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Feb 3 09:26:24 2012 -0500

    VS: Add support for WinRT project properties (#12930)
    
    VS_WINRT_EXTENSIONS: Boolean property that correspond to "Enable
    Tailored Features" in Visual Studio 11 IDE.
    
    VS_WINRT_REFERENCES: Semicolon-delimited list of *.winmd references to
    add to the project, which creates a new <ItemGroup>.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1a68cee..ae5596b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1065,6 +1065,16 @@ void cmTarget::DefineProperties(cmake *cm)
      "generated Visual Studio project. For example, \"System;"
      "System.Windows.Forms\".");
   cm->DefineProperty
+    ("VS_WINRT_EXTENSIONS", cmProperty::TARGET,
+     "Visual Studio project C++/CX language extensions for Windows Runtime",
+     "Can be set to enable C++/CX language extensions.");
+  cm->DefineProperty
+    ("VS_WINRT_REFERENCES", cmProperty::TARGET,
+     "Visual Studio project Windows Runtime Metadata references",
+     "Adds one or more semicolon-delimited WinRT references to a "
+     "generated Visual Studio project. For example, \"Windows;"
+     "Windows.UI.Core\".");
+  cm->DefineProperty
     ("VS_GLOBAL_<variable>", cmProperty::TARGET,
      "Visual Studio project-specific global variable.",
      "Tell the Visual Studio generator to set the global variable "
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 449adc1..9193223 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -255,6 +255,7 @@ void cmVisualStudio10TargetGenerator::Generate()
   this->WriteObjSources();
   this->WriteCLSources();
   this->WriteDotNetReferences();
+  this->WriteWinRTReferences();
   this->WriteProjectReferences();
   this->WriteString(
     "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\""
@@ -299,6 +300,36 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences()
     }
 }
 
+void cmVisualStudio10TargetGenerator::WriteWinRTReferences()
+{
+  const char* vsWinRTReferences
+    = this->Target->GetProperty("VS_WINRT_REFERENCES");
+  if(vsWinRTReferences)
+    {
+    std::string references(vsWinRTReferences);
+    std::string::size_type position = 0;
+
+    this->WriteString("<ItemGroup>\n", 1);
+    while(references.length() > 0)
+      {
+      if((position = references.find(";")) == std::string::npos)
+        {
+        position = references.length() + 1;
+        }
+
+      this->WriteString("<Reference Include=\"", 2);
+      (*this->BuildFileStream) <<
+        cmVS10EscapeXML(references.substr(0, position)) << "\">\n";
+      this->WriteString("<IsWinMDFile>true</IsWinMDFile>\n", 3);
+      this->WriteString("</Reference>\n", 2);
+
+      references.erase(0, position + 1);
+      }
+
+    this->WriteString("</ItemGroup>\n", 1);
+    }
+}
+
 // ConfigurationType Application, Utility StaticLibrary DynamicLibrary
 
 void cmVisualStudio10TargetGenerator::WriteProjectConfigurations()
@@ -372,7 +403,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
     this->WriteString(mfcLine.c_str(), 2);
 
     if(this->Target->GetType() <= cmTarget::MODULE_LIBRARY &&
-       this->ClOptions[*i]->UsingUnicode())
+       this->ClOptions[*i]->UsingUnicode() ||
+       this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
       {
       this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2);
       }
@@ -387,6 +419,10 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
       pts += "</PlatformToolset>\n";
       this->WriteString(pts.c_str(), 2);
       }
+    if(this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
+      {
+      this->WriteString("<Immersive>true</Immersive>\n", 2);
+      }
     this->WriteString("</PropertyGroup>\n", 1);
     }
 }
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 6702509..90035f2 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -48,6 +48,7 @@ private:
   void WriteProjectConfigurationValues();
   void WriteCLSources();
   void WriteDotNetReferences();
+  void WriteWinRTReferences();
   void WriteObjSources();
   void WritePathAndIncrementalLinkOptions();
   void WriteItemDefinitionGroups();

-----------------------------------------------------------------------

Summary of changes:
 Source/cmTarget.cxx                        |   10 +++++
 Source/cmVisualStudio10TargetGenerator.cxx |   56 +++++++++++++++++++--------
 Source/cmVisualStudio10TargetGenerator.h   |    1 +
 3 files changed, 50 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list