summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-05 12:06:28 -0500
committerBrad King <brad.king@kitware.com>2013-11-05 12:06:28 -0500
commit3063011352ebf2311ae3a9407066f32d6403b26b (patch)
treeefc137a00553b1df4253b6b95728c417e3d9d77d
parent850276d2b445aecc19c48c764865fc697d87739c (diff)
parenta1b9465bf85621f80f02b9903aa7b38a74676df1 (diff)
downloadcmake-3063011352ebf2311ae3a9407066f32d6403b26b.tar.gz
Merge branch 'fix-automoc-compile-definitions' into release
-rw-r--r--Source/cmGlobalGenerator.cxx24
-rw-r--r--Source/cmGlobalGenerator.h1
-rw-r--r--Tests/QtAutomoc/foo.h5
3 files changed, 25 insertions, 5 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index e8a4bb6579..f297c4abb3 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 18aba24bf8..80916ae59e 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 32d4c8d8f9..f23ec0739f 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: