EXCLUDE_FROM_ALL: Don't warn if installing target excluded from all

The original warning pre-dates support for install components.
There are now legitimate scenarios where an install(TARGETS)
command may list a target that is excluded from all, e.g.
hierarchical projects that will never install the component such a
target belongs to.

Fixes: #18938
This commit is contained in:
Craig Scott
2019-02-21 23:00:50 +11:00
parent e6897c72e7
commit d3b765d451
5 changed files with 14 additions and 20 deletions
-16
View File
@@ -41,22 +41,6 @@ cmInstallTargetGenerator::cmInstallTargetGenerator(
cmInstallTargetGenerator::~cmInstallTargetGenerator() = default;
void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
{
// Warn if installing an exclude-from-all target.
if (this->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
std::ostringstream msg;
msg << "WARNING: Target \"" << this->Target->GetName()
<< "\" has EXCLUDE_FROM_ALL set and will not be built by default "
<< "but an install rule has been provided for it. CMake does "
<< "not define behavior for this case.";
cmSystemTools::Message(msg.str(), "Warning");
}
// Perform the main install script generation.
this->cmInstallGenerator::GenerateScript(os);
}
void cmInstallTargetGenerator::GenerateScriptForConfig(
std::ostream& os, const std::string& config, Indent indent)
{