summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-08-18 17:31:41 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-08-18 17:31:41 (GMT)
commitf7ab23837994a4a6eff1c5ebf183ae915380b41c (patch)
tree05388293a9f5181e09563fdf43628300126f1ee5 /Source
parentcb578878093473ef1cb3d2e71791d67a410d4184 (diff)
parentaa21001bd3c723f79e74407a2ba315d5988804a0 (diff)
downloadCMake-f7ab23837994a4a6eff1c5ebf183ae915380b41c.zip
CMake-f7ab23837994a4a6eff1c5ebf183ae915380b41c.tar.gz
CMake-f7ab23837994a4a6eff1c5ebf183ae915380b41c.tar.bz2
Merge topic 'vs-special-source-file-properties'
aa21001b Help: Add notes for topic 'vs-special-source-file-properties' 6fe770e1 VS: Add a source file property to set the hlsl shader type 9b4dc2ad VS: Add a source file property to mark content for Windows App deployment f063a914 VS: Re-arrange WriteExtraSource to support tool configuration
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx71
1 files changed, 70 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 1e9e8e8..6989c51 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1018,12 +1018,24 @@ void cmVisualStudio10TargetGenerator::WriteHeaderSource(cmSourceFile const* sf)
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")
{
@@ -1033,7 +1045,64 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
{
tool = "XML";
}
- this->WriteSource(tool, sf);
+
+ 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);
+ }
+ }
+ }
+ if(!shaderType.empty())
+ {
+ this->WriteString("<ShaderType>", 3);
+ (*this->BuildFileStream) << cmVS10EscapeXML(shaderType)
+ << "</ShaderType>\n";
+ }
+
+ this->WriteString("</", 2);
+ (*this->BuildFileStream) << tool << ">\n";
+ }
+ else
+ {
+ this->WriteSource(tool, sf);
+ }
}
void cmVisualStudio10TargetGenerator::WriteSource(