Commit 2fad6e06 authored by Dan Huantes's avatar Dan Huantes
Browse files

Added VS_DOTNET_REFERENCES_HINT_PATH_ONLY Target Property

[Source/cmVisualStudio10TargetGenerator.cxx]
- Added code to capture the VS_DOTNET_REFERENCES_HINT_PATH_ONLY
target property if it is set on a target.  If it
is, the expectation is that the value for this property
will be a semicolon delimited string naming one or more
references that should only contain the <HintPath> tag and
not other tags within the body of the Reference declaration.

This Commit Addresses cmake/cmake#19621
parent 43fe736b
Pipeline #144313 passed with stage
......@@ -832,19 +832,39 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReference(
e2.Attribute("Condition", this->CalcCondition(config));
}
e2.Attribute("Include", ref);
// There are references that contain controls and the only
// work when only the <HintPath> is provided. To add these
// references check for VS_DOTNET_REFERENCES_HINT_PATH_ONLY
// which will be one or more semicolon delimited references
std::vector<std::string> hintOnlyReferences;
if (const char* vsHintOnlyReferences = this->GeneratorTarget->GetProperty(
"VS_DOTNET_REFERENCES_HINT_PATH_ONLY")) {
cmExpandList(vsHintOnlyReferences, hintOnlyReferences);
}
bool l_addOnlyHintPath = false;
if (!hintOnlyReferences.empty()) {
for (std::string const& hintRef : hintOnlyReferences) {
if (ref.compare(hintRef) == 0) {
l_addOnlyHintPath = true;
}
}
}
if (!l_addOnlyHintPath) {
e2.Element("CopyLocalSatelliteAssemblies", "true");
e2.Element("ReferenceOutputAssembly", "true");
if (!hint.empty()) {
const char* privateReference = "True";
if (const char* value = this->GeneratorTarget->GetProperty(
"VS_DOTNET_REFERENCES_COPY_LOCAL")) {
if (cmIsOff(value)) {
if (cmSystemTools::IsOff(value)) {
privateReference = "False";
}
}
e2.Element("Private", privateReference);
e2.Element("HintPath", hint);
}
}
e2.Element("HintPath", hint);
this->WriteDotNetReferenceCustomTags(e2, ref);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment