[Cmake-commits] CMake branch, next, updated. v2.8.12-4923-g9d6de1b
Brad King
brad.king at kitware.com
Tue Nov 5 12:06:07 EST 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 9d6de1b2b6bf405124e1baabaa495077ef2fbd0d (commit)
via a1b9465bf85621f80f02b9903aa7b38a74676df1 (commit)
from 501e2b174a764c41a64878a7dfa82c3346a1d3a4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d6de1b2b6bf405124e1baabaa495077ef2fbd0d
commit 9d6de1b2b6bf405124e1baabaa495077ef2fbd0d
Merge: 501e2b1 a1b9465
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Nov 5 12:05:58 2013 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 5 12:05:58 2013 -0500
Merge branch 'fix-automoc-compile-definitions' into next
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a1b9465bf85621f80f02b9903aa7b38a74676df1
commit a1b9465bf85621f80f02b9903aa7b38a74676df1
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 4 10:51:37 2013 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 5 12:00:49 2013 -0500
Automoc: Add directory-level COMPILE_DEFINITIONS to command line (#14535)
In commit 18412153 (Refactor cmTarget::GetCompileDefinitions...,
2013-06-06) cmQtAutomoc was refactored to get all compile definitions
from the target instead of separately asking the target and querying the
directory-level COMPILE_DEFINITIONS property value. While the
generation process does integrate directory-level COMPILE_DEFINITIONS
into the target definitions, this did not happen until after Automoc
targets are constructed. Therefore the commit regressed use of
directory-level definitions in Automoc targets.
Factor the definition finalization logic out from the
cmGlobalGenerator::CreateGeneratorTargets method into a new
cmGlobalGenerator::FinalizeTargetCompileDefinitions method and call it
before constructing Automoc targets. This will place the
directory-level definitions into the target in time to use them for the
Automoc targets.
Extend the QtAutomoc test to cover this case.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 7f2b592..f940c9e 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -956,6 +956,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();
@@ -1140,13 +1142,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 =
@@ -1161,7 +1161,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)
@@ -1178,7 +1177,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:
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list