|
|
@@ -1864,8 +1864,8 @@ bool cmVisualStudio10TargetGenerator::PropertyIsSameInAllConfigs(
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
|
|
|
- cmSourceFile const* sf)
|
|
|
+void cmVisualStudio10TargetGenerator::WriteExtraSource(
|
|
|
+ Elem& e1, cmSourceFile const* sf, ConfigToSettings& toolSettings)
|
|
|
{
|
|
|
bool toolHasSettings = false;
|
|
|
const char* tool = "None";
|
|
|
@@ -1876,10 +1876,6 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
|
|
|
std::string copyToOutDir;
|
|
|
std::string includeInVsix;
|
|
|
std::string ext = cmSystemTools::LowerCase(sf->GetExtension());
|
|
|
- ConfigToSettings toolSettings;
|
|
|
- for (const auto& config : this->Configurations) {
|
|
|
- toolSettings[config];
|
|
|
- }
|
|
|
|
|
|
if (this->ProjectType == csproj && !this->InSourceBuild) {
|
|
|
toolHasSettings = true;
|
|
|
@@ -2047,10 +2043,6 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (cmProp p = sf->GetProperty("VS_SETTINGS")) {
|
|
|
- ParseSettingsProperty(*p, toolSettings);
|
|
|
- }
|
|
|
-
|
|
|
if (!toolSettings.empty()) {
|
|
|
toolHasSettings = true;
|
|
|
}
|
|
|
@@ -2060,27 +2052,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
|
|
|
if (toolHasSettings) {
|
|
|
e2.SetHasElements();
|
|
|
|
|
|
- std::vector<std::string> writtenSettings;
|
|
|
- for (const auto& configSettings : toolSettings) {
|
|
|
- for (const auto& setting : configSettings.second) {
|
|
|
-
|
|
|
- if (std::find(writtenSettings.begin(), writtenSettings.end(),
|
|
|
- setting.first) != writtenSettings.end()) {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- if (PropertyIsSameInAllConfigs(toolSettings, setting.first)) {
|
|
|
- e2.Element(setting.first, setting.second);
|
|
|
- writtenSettings.push_back(setting.first);
|
|
|
- } else {
|
|
|
- e2.WritePlatformConfigTag(setting.first,
|
|
|
- "'$(Configuration)|$(Platform)'=='" +
|
|
|
- configSettings.first + "|" +
|
|
|
- this->Platform + "'",
|
|
|
- setting.second);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ this->FinishWritingSource(e2, toolSettings);
|
|
|
|
|
|
if (!deployContent.empty()) {
|
|
|
cmGeneratorExpression ge;
|
|
|
@@ -2217,6 +2189,15 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
|
|
|
// Skip explicit reference to CMakeLists.txt source.
|
|
|
continue;
|
|
|
}
|
|
|
+
|
|
|
+ ConfigToSettings toolSettings;
|
|
|
+ for (const auto& config : this->Configurations) {
|
|
|
+ toolSettings[config];
|
|
|
+ }
|
|
|
+ if (cmProp p = si.Source->GetProperty("VS_SETTINGS")) {
|
|
|
+ ParseSettingsProperty(*p, toolSettings);
|
|
|
+ }
|
|
|
+
|
|
|
const char* tool = nullptr;
|
|
|
switch (si.Kind) {
|
|
|
case cmGeneratorTarget::SourceKindAppManifest:
|
|
|
@@ -2244,7 +2225,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
|
|
|
}
|
|
|
break;
|
|
|
case cmGeneratorTarget::SourceKindExtra:
|
|
|
- this->WriteExtraSource(e1, si.Source);
|
|
|
+ this->WriteExtraSource(e1, si.Source, toolSettings);
|
|
|
break;
|
|
|
case cmGeneratorTarget::SourceKindHeader:
|
|
|
this->WriteHeaderSource(e1, si.Source);
|
|
|
@@ -2365,6 +2346,32 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void cmVisualStudio10TargetGenerator::FinishWritingSource(
|
|
|
+ Elem& e2, ConfigToSettings const& toolSettings)
|
|
|
+{
|
|
|
+ std::vector<std::string> writtenSettings;
|
|
|
+ for (const auto& configSettings : toolSettings) {
|
|
|
+ for (const auto& setting : configSettings.second) {
|
|
|
+
|
|
|
+ if (std::find(writtenSettings.begin(), writtenSettings.end(),
|
|
|
+ setting.first) != writtenSettings.end()) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (PropertyIsSameInAllConfigs(toolSettings, setting.first)) {
|
|
|
+ e2.Element(setting.first, setting.second);
|
|
|
+ writtenSettings.push_back(setting.first);
|
|
|
+ } else {
|
|
|
+ e2.WritePlatformConfigTag(setting.first,
|
|
|
+ "'$(Configuration)|$(Platform)'=='" +
|
|
|
+ configSettings.first + "|" +
|
|
|
+ this->Platform + "'",
|
|
|
+ setting.second);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
|
|
|
Elem& e2, cmSourceFile const* source)
|
|
|
{
|