diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-07-25 23:19:36 +0200 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-07-27 21:58:49 +0200 |
commit | 496f4cd07d20e91750ec920e05a4aef4e4bdc9ba (patch) | |
tree | 61ac013845aa592641661a2dca489e96b2ec2292 /Source | |
parent | de80993a2020e64259f12f608d11d1ace9a719a6 (diff) | |
download | cmake-496f4cd07d20e91750ec920e05a4aef4e4bdc9ba.tar.gz |
cmGlobalGenerator: Create cmGeneratorTargets before QtAutomoc.
Add cmGeneratorTargets as needed in the QtAutomoc processing.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 5 | ||||
-rw-r--r-- | Source/cmMakefile.h | 4 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 7 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.h | 3 |
5 files changed, 21 insertions, 4 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 936ef74a57..a77a02a1aa 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1234,13 +1234,14 @@ void cmGlobalGenerator::Generate() this->FinalizeTargetCompileInfo(); + this->CreateGenerationObjects(); + #ifdef CMAKE_BUILD_WITH_CMAKE // Iterate through all targets and set up automoc for those which have // the AUTOMOC, AUTOUIC or AUTORCC property set AutogensType autogens; this->CreateQtAutoGeneratorsTargets(autogens); #endif - this->CreateGenerationObjects(); unsigned int i; @@ -1414,7 +1415,8 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens) && !target.IsImported()) { cmQtAutoGenerators autogen; - if(autogen.InitializeAutogenTarget(&target)) + if(autogen.InitializeAutogenTarget(this->LocalGenerators[i], + &target)) { autogens.push_back(std::make_pair(autogen, &target)); } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 7d9bb4c550..95b0ef1630 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -300,6 +300,11 @@ public: /** Get per-target generator information. */ cmGeneratorTarget* GetGeneratorTarget(cmTarget const*) const; + void AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt) + { + this->GeneratorTargets[t] = gt; + } + const std::map<std::string, std::vector<cmLocalGenerator*> >& GetProjectMap() const {return this->ProjectMap;} diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 2fc4d78a8a..f5cd74d0c4 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -415,6 +415,10 @@ public: { this->GeneratorTargets = targets; } + void AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt) + { + this->GeneratorTargets[t] = gt; + } cmTarget* FindTarget(const std::string& name, bool excludeAliases = false) const; diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 58f4bf4148..ae21561ec1 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -287,7 +287,8 @@ std::string cmQtAutoGenerators::ListQt4RccInputs(cmSourceFile* sf, return entriesList; } -bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target) +bool cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg, + cmTarget* target) { cmMakefile* makefile = target->GetMakefile(); // don't do anything if there is no Qt4 or Qt5Core (which contains moc): @@ -474,6 +475,10 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target) /*byproducts=*/rcc_output, depends, commandLines, false, autogenComment.c_str()); + cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg); + lg->GetGlobalGenerator()->AddGeneratorTarget(autogenTarget, gt); + makefile->AddGeneratorTarget(autogenTarget, gt); + // Set target folder const char* autogenFolder = makefile->GetState() ->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER"); diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 4c0fcbcb42..4f033481c4 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -18,6 +18,7 @@ class cmGlobalGenerator; class cmMakefile; +class cmLocalGenerator; class cmQtAutoGenerators { @@ -25,7 +26,7 @@ public: cmQtAutoGenerators(); bool Run(const std::string& targetDirectory, const std::string& config); - bool InitializeAutogenTarget(cmTarget* target); + bool InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target); void SetupAutoGenerateTarget(cmTarget const* target); void SetupSourceFiles(cmTarget const* target); |