[Cmake-commits] CMake branch, next, updated. v3.0.0-4791-g5cbbe85

Brad King brad.king at kitware.com
Tue Aug 5 11:40:49 EDT 2014


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  5cbbe85f0b7fed752c8b6c2a91771bacb5aa0afd (commit)
       via  0c44cb94b69172d6e4b701aa50e07e7a6c0bc726 (commit)
       via  08bfe04bba37f4275b4070feebd7991a98adfbec (commit)
       via  0a2f1636bc735b73f9e79e358217cf651263abc9 (commit)
      from  91dda067bb399fd4f54c91825cc15bfd7ae6b731 (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=5cbbe85f0b7fed752c8b6c2a91771bacb5aa0afd
commit 5cbbe85f0b7fed752c8b6c2a91771bacb5aa0afd
Merge: 91dda06 0c44cb9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Aug 5 11:40:48 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Aug 5 11:40:48 2014 -0400

    Merge topic 'vs-special-source-file-properties' into next
    
    0c44cb94 VS: Add a source file property to set the hlsl shader type
    08bfe04b VS: Add a source file property to mark content for Windows App deployment
    0a2f1636 VS: Re-arrange WriteExtraSource to support tool configuration


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0c44cb94b69172d6e4b701aa50e07e7a6c0bc726
commit 0c44cb94b69172d6e4b701aa50e07e7a6c0bc726
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 29 14:48:20 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 5 11:39:15 2014 -0400

    VS: Add a source file property to set the hlsl shader type
    
    Create a VS_SHADER_TYPE source file property.
    
    Inspired-by: Gilles Khouzam <gillesk at microsoft.com>

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 3b7436a..81b00fa 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -288,6 +288,7 @@ Properties on Source Files
    /prop_sf/OBJECT_OUTPUTS
    /prop_sf/SYMBOLIC
    /prop_sf/VS_DEPLOYMENT_CONTENT
+   /prop_sf/VS_SHADER_TYPE
    /prop_sf/WRAP_EXCLUDE
    /prop_sf/XCODE_EXPLICIT_FILE_TYPE
    /prop_sf/XCODE_LAST_KNOWN_FILE_TYPE
diff --git a/Help/prop_sf/VS_SHADER_TYPE.rst b/Help/prop_sf/VS_SHADER_TYPE.rst
new file mode 100644
index 0000000..6880256
--- /dev/null
+++ b/Help/prop_sf/VS_SHADER_TYPE.rst
@@ -0,0 +1,4 @@
+VS_SHADER_TYPE
+--------------
+
+Set the VS shader type of a ``.hlsl`` source file.
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 70bce08..0062b4a 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1020,11 +1020,22 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
 {
   bool toolHasSettings = false;
   std::string tool = "None";
+  std::string shaderType;
   std::string const& ext = sf->GetExtension();
   if(ext == "appxmanifest")
     {
     tool = "AppxManifest";
     }
+  else if(ext == "hlsl")
+    {
+    tool = "FXCompile";
+    // Figure out the type of shader compiler to use.
+    if(const char* st = sf->GetProperty("VS_SHADER_TYPE"))
+      {
+      shaderType = st;
+      toolHasSettings = true;
+      }
+    }
   else if(ext == "jpg" ||
           ext == "png")
     {
@@ -1078,6 +1089,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
           }
         }
       }
+    if(!shaderType.empty())
+      {
+      this->WriteString("<ShaderType>", 3);
+      (*this->BuildFileStream) << cmVS10EscapeXML(shaderType)
+                               << "</ShaderType>\n";
+      }
 
     this->WriteString("</", 2);
     (*this->BuildFileStream) << tool << ">\n";

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08bfe04bba37f4275b4070feebd7991a98adfbec
commit 08bfe04bba37f4275b4070feebd7991a98adfbec
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 29 14:03:35 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 5 11:38:29 2014 -0400

    VS: Add a source file property to mark content for Windows App deployment
    
    Create a VS_DEPLOYMENT_CONTENT source file property, supporting
    generator expressions, to compute whether a source file should be marked
    as DeploymentContent or ExcludedFromBuild in Windows Phone and Windows
    Store projects.
    
    Inspired-by: Minmin Gong <minmin.gong at gmail.com>

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 17dadc2..3b7436a 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -287,6 +287,7 @@ Properties on Source Files
    /prop_sf/OBJECT_DEPENDS
    /prop_sf/OBJECT_OUTPUTS
    /prop_sf/SYMBOLIC
+   /prop_sf/VS_DEPLOYMENT_CONTENT
    /prop_sf/WRAP_EXCLUDE
    /prop_sf/XCODE_EXPLICIT_FILE_TYPE
    /prop_sf/XCODE_LAST_KNOWN_FILE_TYPE
diff --git a/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst b/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst
new file mode 100644
index 0000000..9fb3ba3
--- /dev/null
+++ b/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst
@@ -0,0 +1,11 @@
+VS_DEPLOYMENT_CONTENT
+---------------------
+
+Mark a source file as content for deployment with a Windows Phone or
+Windows Store application when built with a Visual Studio generator.
+The value must evaluate to either ``1`` or ``0`` and may use
+:manual:`generator expressions <cmake-generator-expressions(7)>`
+to make the choice based on the build configuration.
+The ``.vcxproj`` file entry for the source file will be
+marked either ``DeploymentContent`` or ``ExcludedFromBuild``
+for values ``1`` and ``0``, respectively.
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 4bd8824..70bce08 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1035,10 +1035,50 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
     tool = "XML";
     }
 
+  std::string deployContent;
+  if(this->GlobalGenerator->TargetsWindowsPhone() ||
+     this->GlobalGenerator->TargetsWindowsStore())
+    {
+    const char* content = sf->GetProperty("VS_DEPLOYMENT_CONTENT");
+    if(content && *content)
+      {
+      toolHasSettings = true;
+      deployContent = content;
+      }
+    }
+
   if(toolHasSettings)
     {
     this->WriteSource(tool, sf, ">\n");
 
+    if(!deployContent.empty())
+      {
+      std::vector<std::string> const* configs =
+        this->GlobalGenerator->GetConfigurations();
+      cmGeneratorExpression ge;
+      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+        ge.Parse(deployContent);
+      for(size_t i = 0; i != configs->size(); ++i)
+        {
+        if(0 == strcmp(cge->Evaluate(this->Makefile, (*configs)[i]), "1"))
+          {
+          this->WriteString("<DeploymentContent Condition=\""
+                            "'$(Configuration)|$(Platform)'=='", 3);
+          (*this->BuildFileStream) << (*configs)[i] << "|"
+                                   << this->Platform << "'\">true";
+          this->WriteString("</DeploymentContent>\n", 0);
+          }
+        else
+          {
+          this->WriteString("<ExcludedFromBuild Condition=\""
+                            "'$(Configuration)|$(Platform)'=='", 3);
+          (*this->BuildFileStream) << (*configs)[i] << "|"
+                                   << this->Platform << "'\">true";
+          this->WriteString("</ExcludedFromBuild>\n", 0);
+          }
+        }
+      }
+
     this->WriteString("</", 2);
     (*this->BuildFileStream) << tool << ">\n";
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a2f1636bc735b73f9e79e358217cf651263abc9
commit 0a2f1636bc735b73f9e79e358217cf651263abc9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 29 14:41:03 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Aug 5 11:19:19 2014 -0400

    VS: Re-arrange WriteExtraSource to support tool configuration
    
    Add a code path to write the tool open and close elements separately
    so that we can add content in between to configure it.

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 291827a..4bd8824 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1018,6 +1018,7 @@ void cmVisualStudio10TargetGenerator::WriteHeaderSource(cmSourceFile const* sf)
 
 void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
 {
+  bool toolHasSettings = false;
   std::string tool = "None";
   std::string const& ext = sf->GetExtension();
   if(ext == "appxmanifest")
@@ -1033,7 +1034,18 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
     {
     tool = "XML";
     }
-  this->WriteSource(tool, sf);
+
+  if(toolHasSettings)
+    {
+    this->WriteSource(tool, sf, ">\n");
+
+    this->WriteString("</", 2);
+    (*this->BuildFileStream) << tool << ">\n";
+    }
+  else
+    {
+    this->WriteSource(tool, sf);
+    }
 }
 
 void cmVisualStudio10TargetGenerator::WriteSource(

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

Summary of changes:
 Help/manual/cmake-properties.7.rst         |    2 +
 Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst     |   11 +++++
 Help/prop_sf/VS_SHADER_TYPE.rst            |    4 ++
 Source/cmVisualStudio10TargetGenerator.cxx |   71 +++++++++++++++++++++++++++-
 4 files changed, 87 insertions(+), 1 deletion(-)
 create mode 100644 Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst
 create mode 100644 Help/prop_sf/VS_SHADER_TYPE.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list