Refactor SetupAutomocTarget() so it can be run after creating the target

This makes it easier to move it from InitialPass() to some other
location, e.g. FinalPass() or something else.

Alex
This commit is contained in:
Alex Neundorf
2011-08-16 01:27:30 +02:00
parent 24d9b7d745
commit c27607baf8
4 changed files with 28 additions and 64 deletions
+3 -12
View File
@@ -126,14 +126,6 @@ bool cmAddExecutableCommand
}
std::vector<std::string> srclists(s, args.end());
cmQtAutomoc* automoc = 0;
if ( doAutomoc )
{
automoc = new cmQtAutomoc;
automoc->SetupAutomocTarget(this->Makefile, exename.c_str(), srclists);
}
cmTarget* tgt = this->Makefile->AddExecutable(exename.c_str(), srclists,
excludeFromAll);
if ( use_win32 )
@@ -145,11 +137,10 @@ bool cmAddExecutableCommand
tgt->SetProperty("MACOSX_BUNDLE", "ON");
}
if ( automoc )
if ( doAutomoc )
{
automoc->AddTargetDependency(this->Makefile, tgt);
delete automoc;
automoc = 0;
cmQtAutomoc automoc;
automoc.SetupAutomocTarget(tgt);
}
return true;