|
|
@@ -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);
|
|
|
}
|
|
|
@@ -919,6 +909,12 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // cmGeneratorTarget::GetConfigCommonSourceFiles computes the target's
|
|
|
+ // sources meta data cache. Clear it so that OBJECT library targets that
|
|
|
+ // are AUTOGEN initialized after this target get their added
|
|
|
+ // mocs_compilation.cpp source acknowledged by this target.
|
|
|
+ target->ClearSourcesCache();
|
|
|
+
|
|
|
// Convert std::set to std::vector
|
|
|
const std::vector<std::string> autogenDepends(autogenDependsSet.begin(),
|
|
|
autogenDependsSet.end());
|