QtAutogen: Move condition to prior loop.

This commit is contained in:
Stephen Kelly 2015-09-20 16:50:25 +02:00
parent e791c85419
commit b7491b1cda
1 changed files with 16 additions and 15 deletions

View File

@ -1421,6 +1421,14 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
{ {
continue; continue;
} }
if(ti->second.GetType() != cmTarget::EXECUTABLE &&
ti->second.GetType() != cmTarget::STATIC_LIBRARY &&
ti->second.GetType() != cmTarget::SHARED_LIBRARY &&
ti->second.GetType() != cmTarget::MODULE_LIBRARY &&
ti->second.GetType() != cmTarget::OBJECT_LIBRARY)
{
continue;
}
targetNames.push_back(ti->second.GetName()); targetNames.push_back(ti->second.GetName());
} }
for(std::vector<std::string>::iterator ti = targetNames.begin(); for(std::vector<std::string>::iterator ti = targetNames.begin();
@ -1428,23 +1436,16 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
{ {
cmTarget& target = *this->LocalGenerators[i] cmTarget& target = *this->LocalGenerators[i]
->GetMakefile()->FindTarget(*ti, true); ->GetMakefile()->FindTarget(*ti, true);
if(target.GetType() == cmTarget::EXECUTABLE || if((target.GetPropertyAsBool("AUTOMOC")
target.GetType() == cmTarget::STATIC_LIBRARY || || target.GetPropertyAsBool("AUTOUIC")
target.GetType() == cmTarget::SHARED_LIBRARY || || target.GetPropertyAsBool("AUTORCC"))
target.GetType() == cmTarget::MODULE_LIBRARY || && !target.IsImported())
target.GetType() == cmTarget::OBJECT_LIBRARY)
{ {
if((target.GetPropertyAsBool("AUTOMOC") if(cmQtAutoGenerators::InitializeAutogenTarget(
|| target.GetPropertyAsBool("AUTOUIC") this->LocalGenerators[i], &target))
|| target.GetPropertyAsBool("AUTORCC"))
&& !target.IsImported())
{ {
if(cmQtAutoGenerators::InitializeAutogenTarget( cmQtAutoGenerators autogen;
this->LocalGenerators[i], &target)) autogens.push_back(std::make_pair(autogen, &target));
{
cmQtAutoGenerators autogen;
autogens.push_back(std::make_pair(autogen, &target));
}
} }
} }
} }