summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGeneratorInitializer.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-08-09 09:22:56 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-08-10 16:48:15 (GMT)
commit362f9bd755c7b964184db38d1fb2217ded70af63 (patch)
tree92bb5224ba4cc97cd0d8786921fc97010cfa4282 /Source/cmQtAutoGeneratorInitializer.cxx
parent952fc65d140a1b36fc2e580d7ca89de231a04412 (diff)
downloadCMake-362f9bd755c7b964184db38d1fb2217ded70af63.zip
CMake-362f9bd755c7b964184db38d1fb2217ded70af63.tar.gz
CMake-362f9bd755c7b964184db38d1fb2217ded70af63.tar.bz2
Autogen: Merge and remove redundant function calls
Diffstat (limited to 'Source/cmQtAutoGeneratorInitializer.cxx')
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx30
1 files changed, 10 insertions, 20 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 2cf2ee9..7974977 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -263,13 +263,17 @@ static bool AddToSourceGroup(cmMakefile* makefile, const std::string& fileName,
return true;
}
-static void AddGeneratedSource(cmMakefile* makefile,
+static void AddGeneratedSource(cmGeneratorTarget* target,
const std::string& filename,
cmQtAutoGeneratorCommon::GeneratorType genType)
{
- cmSourceFile* gFile = makefile->GetOrCreateSource(filename, true);
- gFile->SetProperty("GENERATED", "1");
- gFile->SetProperty("SKIP_AUTOGEN", "On");
+ cmMakefile* makefile = target->Target->GetMakefile();
+ {
+ cmSourceFile* gFile = makefile->GetOrCreateSource(filename, true);
+ gFile->SetProperty("GENERATED", "1");
+ gFile->SetProperty("SKIP_AUTOGEN", "On");
+ }
+ target->AddSource(filename);
AddToSourceGroup(makefile, filename, genType);
}
@@ -692,19 +696,6 @@ static void RccSetupAutoTarget(cmGeneratorTarget const* target,
AddDefinitionEscaped(makefile, "_rcc_options_options", rccFileOptions);
}
-void cmQtAutoGeneratorInitializer::InitializeAutogenSources(
- cmGeneratorTarget* target)
-{
- if (target->GetPropertyAsBool("AUTOMOC")) {
- cmMakefile* makefile = target->Target->GetMakefile();
- // Mocs compilation file
- const std::string mocsComp =
- GetAutogenTargetBuildDir(target) + "/mocs_compilation.cpp";
- AddGeneratedSource(makefile, mocsComp, cmQtAutoGeneratorCommon::MOC);
- target->AddSource(mocsComp);
- }
-}
-
void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
cmLocalGenerator* lg, cmGeneratorTarget* target)
{
@@ -781,6 +772,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
// Add moc compilation to generated files list
if (mocEnabled) {
const std::string mocsComp = autogenBuildDir + "/mocs_compilation.cpp";
+ AddGeneratedSource(target, mocsComp, cmQtAutoGeneratorCommon::MOC);
autogenProvides.push_back(mocsComp);
}
@@ -880,10 +872,8 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
rccBuildFile += ".cpp";
// Register rcc ouput file as generated
- AddGeneratedSource(makefile, rccBuildFile,
+ AddGeneratedSource(target, rccBuildFile,
cmQtAutoGeneratorCommon::RCC);
- // Add rcc output file to origin target sources
- target->AddSource(rccBuildFile);
// Register rcc ouput file as generated by the _autogen target
autogenProvides.push_back(rccBuildFile);
}