|
|
@@ -1592,6 +1592,8 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
|
|
|
std::string shaderEntryPoint;
|
|
|
std::string shaderModel;
|
|
|
std::string shaderAdditionalFlags;
|
|
|
+ std::string outputHeaderFile;
|
|
|
+ std::string variableName;
|
|
|
std::string settingsGenerator;
|
|
|
std::string settingsLastGenOutput;
|
|
|
std::string sourceLink;
|
|
|
@@ -1641,6 +1643,16 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
|
|
|
shaderModel = sm;
|
|
|
toolHasSettings = true;
|
|
|
}
|
|
|
+ // Figure out which output header file to use if any
|
|
|
+ if (const char* ohf = sf->GetProperty("VS_SHADER_OUTPUT_HEADER_FILE")) {
|
|
|
+ outputHeaderFile = ohf;
|
|
|
+ toolHasSettings = true;
|
|
|
+ }
|
|
|
+ // Figure out which variable name to use if any
|
|
|
+ if (const char* vn = sf->GetProperty("VS_SHADER_VARIABLE_NAME")) {
|
|
|
+ variableName = vn;
|
|
|
+ toolHasSettings = true;
|
|
|
+ }
|
|
|
// Figure out if there's any additional flags to use
|
|
|
if (const char* saf = sf->GetProperty("VS_SHADER_FLAGS")) {
|
|
|
shaderAdditionalFlags = saf;
|
|
|
@@ -1766,6 +1778,28 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
|
|
|
(*this->BuildFileStream) << cmVS10EscapeXML(shaderModel)
|
|
|
<< "</ShaderModel>\n";
|
|
|
}
|
|
|
+ if (!outputHeaderFile.empty()) {
|
|
|
+ for (size_t i = 0; i != this->Configurations.size(); ++i) {
|
|
|
+ this->WriteString("<HeaderFileOutput Condition=\""
|
|
|
+ "'$(Configuration)|$(Platform)'=='",
|
|
|
+ 3);
|
|
|
+ (*this->BuildFileStream) << this->Configurations[i] << "|"
|
|
|
+ << this->Platform << "'\">"
|
|
|
+ << cmVS10EscapeXML(outputHeaderFile);
|
|
|
+ this->WriteString("</HeaderFileOutput>\n", 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!variableName.empty()) {
|
|
|
+ for (size_t i = 0; i != this->Configurations.size(); ++i) {
|
|
|
+ this->WriteString("<VariableName Condition=\""
|
|
|
+ "'$(Configuration)|$(Platform)'=='",
|
|
|
+ 3);
|
|
|
+ (*this->BuildFileStream) << this->Configurations[i] << "|"
|
|
|
+ << this->Platform << "'\">"
|
|
|
+ << cmVS10EscapeXML(variableName);
|
|
|
+ this->WriteString("</VariableName>\n", 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!shaderAdditionalFlags.empty()) {
|
|
|
this->WriteString("<AdditionalOptions>", 3);
|
|
|
(*this->BuildFileStream) << cmVS10EscapeXML(shaderAdditionalFlags)
|