Autogen: Split out UI file generation code to dedicated method

This commit is contained in:
Sebastian Holtermann 2016-04-18 14:07:12 +02:00 committed by Brad King
parent cf679ea8dc
commit 47e60bc5a0
2 changed files with 28 additions and 12 deletions

View File

@ -595,20 +595,10 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
{
this->GenerateMocFiles ( includedMocs, notIncludedMocs );
}
for(std::map<std::string, std::vector<std::string> >::const_iterator
it = includedUis.begin();
it != includedUis.end();
++it)
if(!this->UicExecutable.empty())
{
for (std::vector<std::string>::const_iterator nit = it->second.begin();
nit != it->second.end();
++nit)
{
this->GenerateUi(it->first, *nit);
this->GenerateUiFiles ( includedUis );
}
}
if(!this->RccExecutable.empty())
{
this->GenerateQrcFiles();
@ -1227,6 +1217,30 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
return false;
}
bool cmQtAutoGenerators::GenerateUiFiles(
const std::map<std::string, std::vector<std::string> >& includedUis )
{
for(std::map<std::string, std::vector<std::string> >::const_iterator
it = includedUis.begin(); it != includedUis.end(); ++it)
{
for (std::vector<std::string>::const_iterator nit = it->second.begin();
nit != it->second.end(); ++nit)
{
if (!this->GenerateUi(it->first, *nit) )
{
if (this->RunUicFailed)
{
return false;
}
}
}
}
return true;
}
bool cmQtAutoGenerators::GenerateUi(const std::string& realName,
const std::string& uiFileName)
{

View File

@ -44,6 +44,8 @@ private:
const std::map<std::string, std::string>& notIncludedMocs);
bool GenerateMoc(const std::string& sourceFile,
const std::string& mocFileName);
bool GenerateUiFiles(
const std::map<std::string, std::vector<std::string> >& includedUis );
bool GenerateUi(const std::string& realName, const std::string& uiFileName);
bool GenerateQrcFiles();
void ParseCppFile(const std::string& absFilename,