diff options
Diffstat (limited to 'Source/cmQtAutoGeneratorInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 30 |
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); } |