mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 13:19:51 -05:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user