Only generate one check per missing target.
This commit is contained in:
parent
f623d37a95
commit
d8fe1fcd80
|
@ -671,7 +671,10 @@ void cmExportFileGenerator::GenerateMissingTargetsCheckCode(std::ostream& os,
|
||||||
}
|
}
|
||||||
os << "# Make sure the targets which have been exported in some other \n"
|
os << "# Make sure the targets which have been exported in some other \n"
|
||||||
"# export set exist.\n";
|
"# export set exist.\n";
|
||||||
|
std::set<std::string> emitted;
|
||||||
for(unsigned int i=0; i<missingTargets.size(); ++i)
|
for(unsigned int i=0; i<missingTargets.size(); ++i)
|
||||||
|
{
|
||||||
|
if (emitted.insert(missingTargets[i]).second)
|
||||||
{
|
{
|
||||||
os << "IF(NOT TARGET \"" << missingTargets[i] << "\" )\n"
|
os << "IF(NOT TARGET \"" << missingTargets[i] << "\" )\n"
|
||||||
<< " IF(CMAKE_FIND_PACKAGE_NAME)\n"
|
<< " IF(CMAKE_FIND_PACKAGE_NAME)\n"
|
||||||
|
@ -685,6 +688,7 @@ void cmExportFileGenerator::GenerateMissingTargetsCheckCode(std::ostream& os,
|
||||||
<< " ENDIF()\n"
|
<< " ENDIF()\n"
|
||||||
<< "ENDIF()\n";
|
<< "ENDIF()\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
os << "\n";
|
os << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue