diff options
author | Brad King <brad.king@kitware.com> | 2013-11-05 17:06:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-05 17:06:28 (GMT) |
commit | 3063011352ebf2311ae3a9407066f32d6403b26b (patch) | |
tree | efc137a00553b1df4253b6b95728c417e3d9d77d | |
parent | 850276d2b445aecc19c48c764865fc697d87739c (diff) | |
parent | a1b9465bf85621f80f02b9903aa7b38a74676df1 (diff) | |
download | CMake-3063011352ebf2311ae3a9407066f32d6403b26b.zip CMake-3063011352ebf2311ae3a9407066f32d6403b26b.tar.gz CMake-3063011352ebf2311ae3a9407066f32d6403b26b.tar.bz2 |
Merge branch 'fix-automoc-compile-definitions' into release
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 24 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 1 | ||||
-rw-r--r-- | Tests/QtAutomoc/foo.h | 5 |
3 files changed, 25 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index e8a4bb6..f297c4a 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -964,6 +964,8 @@ void cmGlobalGenerator::Generate() return; } + this->FinalizeTargetCompileDefinitions(); + // Iterate through all targets and set up automoc for those which have // the AUTOMOC property set this->CreateAutomocTargets(); @@ -1149,13 +1151,11 @@ void cmGlobalGenerator::CreateAutomocTargets() } //---------------------------------------------------------------------------- -void cmGlobalGenerator::CreateGeneratorTargets() +void cmGlobalGenerator::FinalizeTargetCompileDefinitions() { // Construct per-target generator information. for(unsigned int i=0; i < this->LocalGenerators.size(); ++i) { - cmGeneratorTargetsType generatorTargets; - cmMakefile *mf = this->LocalGenerators[i]->GetMakefile(); const std::vector<cmValueWithOrigin> noconfig_compile_definitions = @@ -1170,7 +1170,6 @@ void cmGlobalGenerator::CreateGeneratorTargets() { cmTarget* t = &ti->second; - { for (std::vector<cmValueWithOrigin>::const_iterator it = noconfig_compile_definitions.begin(); it != noconfig_compile_definitions.end(); ++it) @@ -1187,7 +1186,24 @@ void cmGlobalGenerator::CreateGeneratorTargets() mf->GetProperty(defPropName.c_str())); } } + } +} + +//---------------------------------------------------------------------------- +void cmGlobalGenerator::CreateGeneratorTargets() +{ + // Construct per-target generator information. + for(unsigned int i=0; i < this->LocalGenerators.size(); ++i) + { + cmGeneratorTargetsType generatorTargets; + + cmMakefile *mf = this->LocalGenerators[i]->GetMakefile(); + cmTargets& targets = mf->GetTargets(); + for(cmTargets::iterator ti = targets.begin(); + ti != targets.end(); ++ti) + { + cmTarget* t = &ti->second; cmGeneratorTarget* gt = new cmGeneratorTarget(t); this->GeneratorTargets[t] = gt; this->ComputeTargetObjects(gt); diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 18aba24..80916ae 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -382,6 +382,7 @@ private: void WriteSummary(); void WriteSummary(cmTarget* target); + void FinalizeTargetCompileDefinitions(); cmExternalMakefileProjectGenerator* ExtraGenerator; diff --git a/Tests/QtAutomoc/foo.h b/Tests/QtAutomoc/foo.h index 32d4c8d..f23ec07 100644 --- a/Tests/QtAutomoc/foo.h +++ b/Tests/QtAutomoc/foo.h @@ -16,7 +16,10 @@ #include <QObject> -class Foo : public QObject +class Foo +#ifdef FOO + : public QObject +#endif { Q_OBJECT public: |