Merge branch 'fix-automoc-compile-definitions' into release

This commit is contained in:
Brad King 2013-11-05 12:06:28 -05:00
commit 3063011352
3 changed files with 25 additions and 5 deletions

View File

@ -964,6 +964,8 @@ void cmGlobalGenerator::Generate()
return;
}
this->FinalizeTargetCompileDefinitions();
// Iterate through all targets and set up automoc for those which have
// the AUTOMOC property set
this->CreateAutomocTargets();
@ -1149,13 +1151,11 @@ void cmGlobalGenerator::CreateAutomocTargets()
}
//----------------------------------------------------------------------------
void cmGlobalGenerator::CreateGeneratorTargets()
void cmGlobalGenerator::FinalizeTargetCompileDefinitions()
{
// Construct per-target generator information.
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{
cmGeneratorTargetsType generatorTargets;
cmMakefile *mf = this->LocalGenerators[i]->GetMakefile();
const std::vector<cmValueWithOrigin> noconfig_compile_definitions =
@ -1170,7 +1170,6 @@ void cmGlobalGenerator::CreateGeneratorTargets()
{
cmTarget* t = &ti->second;
{
for (std::vector<cmValueWithOrigin>::const_iterator it
= noconfig_compile_definitions.begin();
it != noconfig_compile_definitions.end(); ++it)
@ -1187,7 +1186,24 @@ void cmGlobalGenerator::CreateGeneratorTargets()
mf->GetProperty(defPropName.c_str()));
}
}
}
}
//----------------------------------------------------------------------------
void cmGlobalGenerator::CreateGeneratorTargets()
{
// Construct per-target generator information.
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{
cmGeneratorTargetsType generatorTargets;
cmMakefile *mf = this->LocalGenerators[i]->GetMakefile();
cmTargets& targets = mf->GetTargets();
for(cmTargets::iterator ti = targets.begin();
ti != targets.end(); ++ti)
{
cmTarget* t = &ti->second;
cmGeneratorTarget* gt = new cmGeneratorTarget(t);
this->GeneratorTargets[t] = gt;
this->ComputeTargetObjects(gt);

View File

@ -382,6 +382,7 @@ private:
void WriteSummary();
void WriteSummary(cmTarget* target);
void FinalizeTargetCompileDefinitions();
cmExternalMakefileProjectGenerator* ExtraGenerator;

View File

@ -16,7 +16,10 @@
#include <QObject>
class Foo : public QObject
class Foo
#ifdef FOO
: public QObject
#endif
{
Q_OBJECT
public: