[Cmake-commits] CMake branch, next, updated. v2.8.9-294-g32ac5fa
Alexander Neundorf
neundorf at kde.org
Mon Aug 27 16:08:07 EDT 2012
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 32ac5fae5162991451241a20e83c78c15c36f2c2 (commit)
via b001b6e129134e88dc958cecbcd4c326e8daf36a (commit)
from 6e6604d9797438c86e57936ddaba25108eda4fde (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=32ac5fae5162991451241a20e83c78c15c36f2c2
commit 32ac5fae5162991451241a20e83c78c15c36f2c2
Merge: 6e6604d b001b6e
Author: Alexander Neundorf <neundorf at kde.org>
AuthorDate: Mon Aug 27 16:08:03 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Aug 27 16:08:03 2012 -0400
Merge topic 'AutomocRerunFix' into next
b001b6e fix #13494: rerun automoc also if include dirs or moc options change
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b001b6e129134e88dc958cecbcd4c326e8daf36a
commit b001b6e129134e88dc958cecbcd4c326e8daf36a
Author: Alex Neundorf <neundorf at kde.org>
AuthorDate: Mon Aug 27 21:39:50 2012 +0200
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Mon Aug 27 21:39:50 2012 +0200
fix #13494: rerun automoc also if include dirs or moc options change
Until now it was only rerun if the compile definitions changed, but
of course it also has to rerun if the include dirs or moc options
change. Strange that I didn't notice this before...
Alex
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 65ecdf7..71feffd 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -321,12 +321,31 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
this->ProjectSourceDir = makefile->GetSafeDefinition("AM_CMAKE_SOURCE_DIR");
this->TargetName = makefile->GetSafeDefinition("AM_TARGET_NAME");
+ this->CurrentCompileSettingsStr = this->MakeCompileSettingsString(makefile);
+
this->RelaxedMode = makefile->IsOn("AM_RELAXED_MODE");
return true;
}
+std::string cmQtAutomoc::MakeCompileSettingsString(cmMakefile* makefile)
+{
+ std::string s;
+ s += makefile->GetSafeDefinition("AM_MOC_DEFINITIONS");
+ s += " ~~~ ";
+ s += makefile->GetSafeDefinition("AM_MOC_INCLUDES");
+ s += " ~~~ ";
+ s += makefile->GetSafeDefinition("AM_MOC_OPTIONS");
+ s += " ~~~ ";
+ s += makefile->IsOn("AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE") ? "TRUE"
+ : "FALSE";
+ s += " ~~~ ";
+
+ return s;
+}
+
+
bool cmQtAutomoc::ReadOldMocDefinitionsFile(cmMakefile* makefile,
const char* targetDirectory)
{
@@ -336,8 +355,8 @@ bool cmQtAutomoc::ReadOldMocDefinitionsFile(cmMakefile* makefile,
if (makefile->ReadListFile(0, filename.c_str()))
{
- this->OldMocDefinitionsStr =
- makefile->GetSafeDefinition("AM_OLD_MOC_DEFINITIONS");
+ this->OldCompileSettingsStr =
+ makefile->GetSafeDefinition("AM_OLD_COMPILE_SETTINGS");
}
return true;
}
@@ -352,9 +371,9 @@ void cmQtAutomoc::WriteOldMocDefinitionsFile(const char* targetDirectory)
std::fstream outfile;
outfile.open(filename.c_str(),
std::ios::out | std::ios::trunc);
- outfile << "set(AM_OLD_MOC_DEFINITIONS "
+ outfile << "set(AM_OLD_COMPILE_SETTINGS "
<< cmLocalGenerator::EscapeForCMake(
- this->Join(this->MocDefinitions, ' ').c_str()) << ")\n";
+ this->CurrentCompileSettingsStr.c_str()) << ")\n";
outfile.close();
}
@@ -471,7 +490,7 @@ void cmQtAutomoc::Init()
bool cmQtAutomoc::RunAutomoc()
{
if (!cmsys::SystemTools::FileExists(this->OutMocCppFilename.c_str())
- || (this->OldMocDefinitionsStr != this->Join(this->MocDefinitions, ' ')))
+ || (this->OldCompileSettingsStr != this->CurrentCompileSettingsStr))
{
this->GenerateAll = true;
}
diff --git a/Source/cmQtAutomoc.h b/Source/cmQtAutomoc.h
index 8cbbac1..f6d72e2 100644
--- a/Source/cmQtAutomoc.h
+++ b/Source/cmQtAutomoc.h
@@ -35,6 +35,8 @@ private:
const char* targetDirectory);
void WriteOldMocDefinitionsFile(const char* targetDirectory);
+ std::string MakeCompileSettingsString(cmMakefile* makefile);
+
bool RunAutomoc();
bool GenerateMoc(const std::string& sourceFile,
const std::string& mocFileName);
@@ -74,7 +76,8 @@ private:
std::string ProjectSourceDir;
std::string TargetName;
- std::string OldMocDefinitionsStr;
+ std::string CurrentCompileSettingsStr;
+ std::string OldCompileSettingsStr;
std::string OutMocCppFilename;
std::list<std::string> MocIncludes;
-----------------------------------------------------------------------
Summary of changes:
Source/cmQtAutomoc.cxx | 29 ++++++++++++++++++++++++-----
Source/cmQtAutomoc.h | 5 ++++-
2 files changed, 28 insertions(+), 6 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list