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 ); this->GenerateMocFiles ( includedMocs, notIncludedMocs );
} }
if(!this->UicExecutable.empty())
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(); this->GenerateUiFiles ( includedUis );
nit != it->second.end();
++nit)
{
this->GenerateUi(it->first, *nit);
}
} }
if(!this->RccExecutable.empty()) if(!this->RccExecutable.empty())
{ {
this->GenerateQrcFiles(); this->GenerateQrcFiles();
@ -1227,6 +1217,30 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
return false; 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, bool cmQtAutoGenerators::GenerateUi(const std::string& realName,
const std::string& uiFileName) const std::string& uiFileName)
{ {

View File

@ -44,6 +44,8 @@ private:
const std::map<std::string, std::string>& notIncludedMocs); const std::map<std::string, std::string>& notIncludedMocs);
bool GenerateMoc(const std::string& sourceFile, bool GenerateMoc(const std::string& sourceFile,
const std::string& mocFileName); 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 GenerateUi(const std::string& realName, const std::string& uiFileName);
bool GenerateQrcFiles(); bool GenerateQrcFiles();
void ParseCppFile(const std::string& absFilename, void ParseCppFile(const std::string& absFilename,