diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-09-20 14:55:47 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-09-26 17:32:53 (GMT) |
commit | 8b6ec29d4096b4ea59ef502360845e25a9bcb47e (patch) | |
tree | 7c1cb936426d9778397fa16df02c47310db4d12e /Source/cmGlobalGenerator.cxx | |
parent | 9470b056fc0be0910f90230e0635d4a2e2baa81a (diff) | |
download | CMake-8b6ec29d4096b4ea59ef502360845e25a9bcb47e.zip CMake-8b6ec29d4096b4ea59ef502360845e25a9bcb47e.tar.gz CMake-8b6ec29d4096b4ea59ef502360845e25a9bcb47e.tar.bz2 |
QtAutogen: Move initialization condition to caller.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f9a65ee..435b769 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1436,6 +1436,18 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens) { continue; } + // don't do anything if there is no Qt4 or Qt5Core (which contains moc): + cmMakefile* mf = ti->second.GetMakefile(); + std::string qtMajorVersion = mf->GetSafeDefinition("QT_VERSION_MAJOR"); + if (qtMajorVersion == "") + { + qtMajorVersion = mf->GetSafeDefinition("Qt5Core_VERSION_MAJOR"); + } + if (qtMajorVersion != "4" && qtMajorVersion != "5") + { + continue; + } + targetNames.push_back(ti->second.GetName()); } for(std::vector<std::string>::iterator ti = targetNames.begin(); @@ -1444,12 +1456,10 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens) cmTarget& target = *this->LocalGenerators[i] ->GetMakefile()->FindTarget(*ti, true); - if(cmQtAutoGenerators::InitializeAutogenTarget( - this->LocalGenerators[i], &target)) - { - cmQtAutoGenerators autogen; - autogens.push_back(std::make_pair(autogen, &target)); - } + cmQtAutoGenerators::InitializeAutogenTarget( + this->LocalGenerators[i], &target); + cmQtAutoGenerators autogen; + autogens.push_back(std::make_pair(autogen, &target)); } } #else |