[Cmake-commits] CMake branch, next, updated. v2.8.6-1616-gf973e10

Alexander Neundorf neundorf at kde.org
Sat Oct 22 15:22:03 EDT 2011


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  f973e10b58af9e6820c852477fc1d4423023c8b9 (commit)
       via  5e8e9ad68ca9e617ef5442236247a49e3b246a5d (commit)
      from  94a04b36bb45a36d441dcb384721ba2ff5349c7d (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=f973e10b58af9e6820c852477fc1d4423023c8b9
commit f973e10b58af9e6820c852477fc1d4423023c8b9
Merge: 94a04b3 5e8e9ad
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Sat Oct 22 15:21:40 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Oct 22 15:21:40 2011 -0400

    Merge topic 'AutomocFindQ_OBJECTAlwaysInHeader' into next
    
    5e8e9ad automoc: always run moc on the cpp file if there is a foo.moc included


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5e8e9ad68ca9e617ef5442236247a49e3b246a5d
commit 5e8e9ad68ca9e617ef5442236247a49e3b246a5d
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Sat Oct 22 21:16:39 2011 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Sat Oct 22 21:16:39 2011 +0200

    automoc: always run moc on the cpp file if there is a foo.moc included
    
    This makes automoc behaves as the documentation says.
    If there is a #include "foo.moc" in the source file, moc
    will be executed on foo.cpp.
    Before it was also executed on foo.cpp, but only if foo.cpp
    contained a Q_OBJECT macro, otherwise moc was executed on
    foo.h. This was confusing, and this change also shouldn't break
    anything, since the headers are moc'ed anyway if they contain
    a Q_OBJECT macro.
    
    Alex

diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index edf1d57..a839489 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -492,7 +492,6 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
   cmsys::RegularExpression mocIncludeRegExp(
               "[\n][ \t]*#[ \t]*include[ \t]+"
               "[\"<](([^ \">]+/)?moc_[^ \">/]+\\.cpp|[^ \">]+\\.moc)[\">]");
-  cmsys::RegularExpression qObjectRegExp("[\n][ \t]*Q_OBJECT[^a-zA-Z0-9_]");
   std::list<std::string> headerExtensions;
   headerExtensions.push_back(".h");
   headerExtensions.push_back(".hpp");
@@ -536,17 +535,13 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
       // the Q_OBJECT class declaration in a header file.
       // If the moc include is of the foo.moc style we need to look for
       // a Q_OBJECT macro in the current source file, if it contains the
-      // macro we generate the moc file from the source file, else from the
-      // header.
+      // macro we generate the moc file from the source file.
       // Q_OBJECT
-      if (moc_style || !qObjectRegExp.find(contentsString))
+      if (moc_style)
         {
-        if (moc_style)
-          {
-          // basename should be the part of the moc filename used for
-          // finding the correct header, so we need to remove the moc_ part
-          basename = basename.substr(4);
-          }
+        // basename should be the part of the moc filename used for
+        // finding the correct header, so we need to remove the moc_ part
+        basename = basename.substr(4);
 
         bool headerFound = false;
         for(std::list<std::string>::const_iterator ext =

-----------------------------------------------------------------------

Summary of changes:
 Source/cmQtAutomoc.cxx |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list