[Cmake-commits] CMake branch, master, updated. v3.9.0-338-gaf97088

Kitware Robot kwrobot at kitware.com
Fri Jul 21 10:25:05 EDT 2017


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, master has been updated
       via  af9708881f4c2d8f501ae63a4088c020edb6f070 (commit)
       via  81005ff16b9fe0177e6d5bea29d087ec1a658716 (commit)
       via  b7e8b0e2604f36294f34228b912d94f321ec381d (commit)
       via  b7941641430feeefadc6f16e2cecf6b50bd9fbe3 (commit)
       via  351c1b1ad6d68c9c029ae9d92f656b467cd350d0 (commit)
       via  f5ccef17515ed4794659923706989fa059b4df38 (commit)
      from  5e3b29f03af342f301c301abddf7a9af868ce211 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af9708881f4c2d8f501ae63a4088c020edb6f070
commit af9708881f4c2d8f501ae63a4088c020edb6f070
Merge: 81005ff f5ccef1
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jul 21 14:17:04 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jul 21 10:17:09 2017 -0400

    Merge topic 'autogen-include-tests'
    
    f5ccef17 Autogen: Extended mocInclude tests
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1070


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=81005ff16b9fe0177e6d5bea29d087ec1a658716
commit 81005ff16b9fe0177e6d5bea29d087ec1a658716
Merge: b7e8b0e b794164
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jul 21 14:16:22 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jul 21 10:16:26 2017 -0400

    Merge topic 'string-clear-intermediate-matches'
    
    b7941641 cmStringCommand: clear intermediate matches
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1065


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b7e8b0e2604f36294f34228b912d94f321ec381d
commit b7e8b0e2604f36294f34228b912d94f321ec381d
Merge: 5e3b29f 351c1b1
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jul 21 14:15:05 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jul 21 10:15:09 2017 -0400

    Merge topic 'cpack-dmg-applescript-argv'
    
    351c1b1a CPack: Pass volume mount name to AppleScript instead of volume name.
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1069


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b7941641430feeefadc6f16e2cecf6b50bd9fbe3
commit b7941641430feeefadc6f16e2cecf6b50bd9fbe3
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Jul 18 11:08:10 2017 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Fri Jul 21 09:09:56 2017 -0400

    cmStringCommand: clear intermediate matches
    
    When `string(REGEX REPLACE)` or `string(REGEX MATCHALL)` loop
    internally, they store their matches, but they do not clear the previous
    match from an earlier iteration. This can leave the contents of
    `CMAKE_MATCH_<N>` with bogus values for later matches in the string if
    they have groups which earlier matched a non-empty string, but now match
    an empty string.
    
    Fixes #17079.

diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 7a097ba..5a6cf48 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -309,6 +309,7 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args)
   std::string output;
   const char* p = input.c_str();
   while (re.find(p)) {
+    this->Makefile->ClearMatches();
     this->Makefile->StoreMatches(re);
     std::string::size_type l = re.start();
     std::string::size_type r = re.end();
@@ -391,6 +392,7 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args)
   std::string output;
   std::string::size_type base = 0;
   while (re.find(input.c_str() + base)) {
+    this->Makefile->ClearMatches();
     this->Makefile->StoreMatches(re);
     std::string::size_type l2 = re.start();
     std::string::size_type r = re.end();
diff --git a/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt b/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
new file mode 100644
index 0000000..4360d79
--- /dev/null
+++ b/Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
@@ -0,0 +1,12 @@
+^matches: Some::;Scope
+results from: string\(REGEX MATCHALL\)
+CMAKE_MATCH_0: -->Scope<--
+CMAKE_MATCH_1: -->Scope<--
+CMAKE_MATCH_2: --><--
+CMAKE_MATCH_COUNT: -->1<--
+replace: \[Some\]\[Scope\]
+results from: string\(REGEX REPLACE\)
+CMAKE_MATCH_0: -->Scope<--
+CMAKE_MATCH_1: -->Scope<--
+CMAKE_MATCH_2: --><--
+CMAKE_MATCH_COUNT: -->1<--$
diff --git a/Tests/RunCMake/string/RegexMultiMatchClear.cmake b/Tests/RunCMake/string/RegexMultiMatchClear.cmake
new file mode 100644
index 0000000..80b6b3c
--- /dev/null
+++ b/Tests/RunCMake/string/RegexMultiMatchClear.cmake
@@ -0,0 +1,20 @@
+cmake_minimum_required (VERSION 3.0)
+project (RegexClear NONE)
+
+function (output_results msg)
+  message("results from: ${msg}")
+  message("CMAKE_MATCH_0: -->${CMAKE_MATCH_0}<--")
+  message("CMAKE_MATCH_1: -->${CMAKE_MATCH_1}<--")
+  message("CMAKE_MATCH_2: -->${CMAKE_MATCH_2}<--")
+  message("CMAKE_MATCH_COUNT: -->${CMAKE_MATCH_COUNT}<--")
+endfunction ()
+
+set(haystack "Some::Scope")
+
+string(REGEX MATCHALL "^([^:]+)(::)?" matches "${haystack}")
+message("matches: ${matches}")
+output_results("string(REGEX MATCHALL)")
+
+string(REGEX REPLACE "^([^:]+)(::)?" "[\\1]" replace "${haystack}")
+message("replace: ${replace}")
+output_results("string(REGEX REPLACE)")
diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake
index 38a77b0..32b61b5 100644
--- a/Tests/RunCMake/string/RunCMakeTest.cmake
+++ b/Tests/RunCMake/string/RunCMakeTest.cmake
@@ -20,6 +20,7 @@ run_cmake(UuidMissingTypeValue)
 run_cmake(UuidBadType)
 
 run_cmake(RegexClear)
+run_cmake(RegexMultiMatchClear)
 
 run_cmake(UTF-16BE)
 run_cmake(UTF-16LE)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=351c1b1ad6d68c9c029ae9d92f656b467cd350d0
commit 351c1b1ad6d68c9c029ae9d92f656b467cd350d0
Author:     Gusts Kaksis <gkaksis at whitecryption.com>
AuthorDate: Thu Jul 20 14:43:39 2017 +0300
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jul 20 11:22:03 2017 -0400

    CPack: Pass volume mount name to AppleScript instead of volume name.
    
    Get the mount name from mount point path returned by hdiutil instead of
    assuming it is the volume name.  They can be different in case of
    conflict with an already-mounted volume.

diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 9864cf3..d4d2fdb 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -447,6 +447,8 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
     cmsys::RegularExpression mountpoint_regex(".*(/Volumes/[^\n]+)\n.*");
     mountpoint_regex.find(attach_output.c_str());
     std::string const temp_mount = mountpoint_regex.match(1);
+    std::string const temp_mount_name =
+      temp_mount.substr(sizeof("/Volumes/") - 1);
 
     // Remove dummy padding file so we have enough space on RW image ...
     std::ostringstream dummy_padding;
@@ -480,7 +482,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
       std::ostringstream setup_script_command;
       setup_script_command << "osascript"
                            << " \"" << cpack_dmg_ds_store_setup_script << "\""
-                           << " \"" << cpack_dmg_volume_name << "\"";
+                           << " \"" << temp_mount_name << "\"";
       std::string error;
       if (!this->RunCommand(setup_script_command, &error)) {
         cmCPackLogger(cmCPackLog::LOG_ERROR,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f5ccef17515ed4794659923706989fa059b4df38
commit f5ccef17515ed4794659923706989fa059b4df38
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Sun Jul 9 12:45:07 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Thu Jul 20 16:55:11 2017 +0200

    Autogen: Extended mocInclude tests
    
    The extended tests cover more AUTOMOC use cases.

diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 9393f1e..b3e83fd 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -22,6 +22,9 @@ if (QT_TEST_VERSION STREQUAL 4)
   macro(qtx_wrap_cpp)
     qt4_wrap_cpp(${ARGN})
   endmacro()
+  macro(qtx_generate_moc)
+    qt4_generate_moc(${ARGN})
+  endmacro()
 
 else()
   if (NOT QT_TEST_VERSION STREQUAL 5)
@@ -41,6 +44,9 @@ else()
   macro(qtx_wrap_cpp)
     qt5_wrap_cpp(${ARGN})
   endmacro()
+  macro(qtx_generate_moc)
+    qt5_generate_moc(${ARGN})
+  endmacro()
 
 endif()
 
diff --git a/Tests/QtAutogen/mocInclude/EObjA.cpp b/Tests/QtAutogen/mocInclude/EObjA.cpp
new file mode 100644
index 0000000..ca713b2
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjA.cpp
@@ -0,0 +1,43 @@
+#include "EObjA.hpp"
+#include "EObjAExtra.hpp"
+#include "EObjA_p.hpp"
+
+class EObjALocal : public QObject
+{
+  Q_OBJECT
+public:
+  EObjALocal();
+  ~EObjALocal();
+};
+
+EObjALocal::EObjALocal()
+{
+}
+
+EObjALocal::~EObjALocal()
+{
+}
+
+EObjAPrivate::EObjAPrivate()
+{
+  EObjALocal localObj;
+  EObjAExtra extraObj;
+}
+
+EObjAPrivate::~EObjAPrivate()
+{
+}
+
+EObjA::EObjA()
+  : d(new EObjAPrivate)
+{
+}
+
+EObjA::~EObjA()
+{
+}
+
+// For EObjALocal
+#include "EObjA.moc"
+// - Not the own header
+#include "moc_EObjAExtra.cpp"
diff --git a/Tests/QtAutogen/mocInclude/EObjA.hpp b/Tests/QtAutogen/mocInclude/EObjA.hpp
new file mode 100644
index 0000000..0939ab6
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjA.hpp
@@ -0,0 +1,19 @@
+#ifndef EOBJA_HPP
+#define EOBJA_HPP
+
+#include <QObject>
+
+// Sources includes a moc_ includes of an extra object
+class EObjAPrivate;
+class EObjA : public QObject
+{
+  Q_OBJECT
+public:
+  EObjA();
+  ~EObjA();
+
+private:
+  EObjAPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/EObjAExtra.cpp b/Tests/QtAutogen/mocInclude/EObjAExtra.cpp
new file mode 100644
index 0000000..369ca8f
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjAExtra.cpp
@@ -0,0 +1,20 @@
+#include "EObjAExtra.hpp"
+#include "EObjAExtra_p.hpp"
+
+EObjAExtraPrivate::EObjAExtraPrivate()
+{
+}
+
+EObjAExtraPrivate::~EObjAExtraPrivate()
+{
+}
+
+EObjAExtra::EObjAExtra()
+  : d(new EObjAExtraPrivate)
+{
+}
+
+EObjAExtra::~EObjAExtra()
+{
+  delete d;
+}
diff --git a/Tests/QtAutogen/mocInclude/EObjAExtra.hpp b/Tests/QtAutogen/mocInclude/EObjAExtra.hpp
new file mode 100644
index 0000000..b10681d
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjAExtra.hpp
@@ -0,0 +1,18 @@
+#ifndef EOBJAEXTRA_HPP
+#define EOBJAEXTRA_HPP
+
+#include <QObject>
+
+class EObjAExtraPrivate;
+class EObjAExtra : public QObject
+{
+  Q_OBJECT
+public:
+  EObjAExtra();
+  ~EObjAExtra();
+
+private:
+  EObjAExtraPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp b/Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp
new file mode 100644
index 0000000..dea6cb5
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp
@@ -0,0 +1,12 @@
+#ifndef EOBJAEXTRA_P_HPP
+#define EOBJAEXTRA_P_HPP
+
+class EObjAExtraPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  EObjAExtraPrivate();
+  ~EObjAExtraPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/EObjA_p.hpp b/Tests/QtAutogen/mocInclude/EObjA_p.hpp
new file mode 100644
index 0000000..1e0d7e1
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjA_p.hpp
@@ -0,0 +1,12 @@
+#ifndef EOBJA_P_HPP
+#define EOBJA_P_HPP
+
+class EObjAPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  EObjAPrivate();
+  ~EObjAPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/EObjB.cpp b/Tests/QtAutogen/mocInclude/EObjB.cpp
new file mode 100644
index 0000000..d19fbfa
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjB.cpp
@@ -0,0 +1,44 @@
+#include "EObjB.hpp"
+#include "EObjB_p.hpp"
+#include "subExtra/EObjBExtra.hpp"
+
+class EObjBLocal : public QObject
+{
+  Q_OBJECT
+public:
+  EObjBLocal();
+  ~EObjBLocal();
+};
+
+EObjBLocal::EObjBLocal()
+{
+}
+
+EObjBLocal::~EObjBLocal()
+{
+}
+
+EObjBPrivate::EObjBPrivate()
+{
+  EObjBLocal localObj;
+  EObjBExtra extraObj;
+}
+
+EObjBPrivate::~EObjBPrivate()
+{
+}
+
+EObjB::EObjB()
+  : d(new EObjBPrivate)
+{
+}
+
+EObjB::~EObjB()
+{
+}
+
+// For EObjBLocal
+#include "EObjB.moc"
+// - Not the own header
+// - in a subdirectory
+#include "subExtra/moc_EObjBExtra.cpp"
diff --git a/Tests/QtAutogen/mocInclude/EObjB.hpp b/Tests/QtAutogen/mocInclude/EObjB.hpp
new file mode 100644
index 0000000..6632bdb
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjB.hpp
@@ -0,0 +1,19 @@
+#ifndef EOBJB_HPP
+#define EOBJB_HPP
+
+#include <QObject>
+
+// Sources includes a moc_ includes of an extra object in a subdirectory
+class EObjBPrivate;
+class EObjB : public QObject
+{
+  Q_OBJECT
+public:
+  EObjB();
+  ~EObjB();
+
+private:
+  EObjBPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/EObjB_p.hpp b/Tests/QtAutogen/mocInclude/EObjB_p.hpp
new file mode 100644
index 0000000..2905f28
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/EObjB_p.hpp
@@ -0,0 +1,12 @@
+#ifndef EOBJB_P_HPP
+#define EOBJB_P_HPP
+
+class EObjBPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  EObjBPrivate();
+  ~EObjBPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/LObjA.cpp b/Tests/QtAutogen/mocInclude/LObjA.cpp
new file mode 100644
index 0000000..9aae991
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjA.cpp
@@ -0,0 +1,39 @@
+#include "LObjA.hpp"
+#include "LObjA_p.h"
+
+class LObjALocal : public QObject
+{
+  Q_OBJECT
+public:
+  LObjALocal();
+  ~LObjALocal();
+};
+
+LObjALocal::LObjALocal()
+{
+}
+
+LObjALocal::~LObjALocal()
+{
+}
+
+LObjAPrivate::LObjAPrivate()
+{
+  LObjALocal localObj;
+}
+
+LObjAPrivate::~LObjAPrivate()
+{
+}
+
+LObjA::LObjA()
+  : d(new LObjAPrivate)
+{
+}
+
+LObjA::~LObjA()
+{
+  delete d;
+}
+
+#include "LObjA.moc"
diff --git a/Tests/QtAutogen/mocInclude/LObjA.hpp b/Tests/QtAutogen/mocInclude/LObjA.hpp
new file mode 100644
index 0000000..aac670c
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjA.hpp
@@ -0,0 +1,19 @@
+#ifndef LOBJA_HPP
+#define LOBJA_HPP
+
+#include <QObject>
+
+// Object source comes with a .moc include
+class LObjAPrivate;
+class LObjA : public QObject
+{
+  Q_OBJECT
+public:
+  LObjA();
+  ~LObjA();
+
+private:
+  LObjAPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/LObjA_p.h b/Tests/QtAutogen/mocInclude/LObjA_p.h
new file mode 100644
index 0000000..ebe8395
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjA_p.h
@@ -0,0 +1,12 @@
+#ifndef LOBJA_P_HPP
+#define LOBJA_P_HPP
+
+class LObjAPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  LObjAPrivate();
+  ~LObjAPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/LObjB.cpp b/Tests/QtAutogen/mocInclude/LObjB.cpp
new file mode 100644
index 0000000..7485d8f
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjB.cpp
@@ -0,0 +1,40 @@
+#include "LObjB.hpp"
+#include "LObjB_p.h"
+
+class LObjBLocal : public QObject
+{
+  Q_OBJECT
+public:
+  LObjBLocal();
+  ~LObjBLocal();
+};
+
+LObjBLocal::LObjBLocal()
+{
+}
+
+LObjBLocal::~LObjBLocal()
+{
+}
+
+LObjBPrivate::LObjBPrivate()
+{
+  LObjBLocal localObj;
+}
+
+LObjBPrivate::~LObjBPrivate()
+{
+}
+
+LObjB::LObjB()
+  : d(new LObjBPrivate)
+{
+}
+
+LObjB::~LObjB()
+{
+  delete d;
+}
+
+#include "LObjB.moc"
+#include "moc_LObjB.cpp"
diff --git a/Tests/QtAutogen/mocInclude/LObjB.hpp b/Tests/QtAutogen/mocInclude/LObjB.hpp
new file mode 100644
index 0000000..eb4e58d
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjB.hpp
@@ -0,0 +1,19 @@
+#ifndef LLObjB_HPP
+#define LLObjB_HPP
+
+#include <QObject>
+
+// Object source comes with a .moc and a _moc include
+class LObjBPrivate;
+class LObjB : public QObject
+{
+  Q_OBJECT
+public:
+  LObjB();
+  ~LObjB();
+
+private:
+  LObjBPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/LObjB_p.h b/Tests/QtAutogen/mocInclude/LObjB_p.h
new file mode 100644
index 0000000..b871f2d
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/LObjB_p.h
@@ -0,0 +1,12 @@
+#ifndef LOBJB_P_HPP
+#define LOBJB_P_HPP
+
+class LObjBPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  LObjBPrivate();
+  ~LObjBPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/ObjA.cpp b/Tests/QtAutogen/mocInclude/ObjA.cpp
index 1b0311d..6f6b90e 100644
--- a/Tests/QtAutogen/mocInclude/ObjA.cpp
+++ b/Tests/QtAutogen/mocInclude/ObjA.cpp
@@ -1,24 +1,20 @@
 #include "ObjA.hpp"
+#include "ObjA_p.h"
 
-class SubObjA : public QObject
+ObjAPrivate::ObjAPrivate()
 {
-  Q_OBJECT
-
-public:
-  SubObjA() {}
-  ~SubObjA() {}
-
-  Q_SLOT
-  void aSlot();
-};
+}
 
-void SubObjA::aSlot()
+ObjAPrivate::~ObjAPrivate()
 {
 }
 
-void ObjA::go()
+ObjA::ObjA()
+  : d(new ObjAPrivate)
 {
-  SubObjA subObj;
 }
 
-#include "ObjA.moc"
+ObjA::~ObjA()
+{
+  delete d;
+}
diff --git a/Tests/QtAutogen/mocInclude/ObjA.hpp b/Tests/QtAutogen/mocInclude/ObjA.hpp
index 281e90d..f16c924 100644
--- a/Tests/QtAutogen/mocInclude/ObjA.hpp
+++ b/Tests/QtAutogen/mocInclude/ObjA.hpp
@@ -3,11 +3,17 @@
 
 #include <QObject>
 
+// Object source comes without any _moc/.moc includes
+class ObjAPrivate;
 class ObjA : public QObject
 {
   Q_OBJECT
-  Q_SLOT
-  void go();
+public:
+  ObjA();
+  ~ObjA();
+
+private:
+  ObjAPrivate* const d;
 };
 
 #endif
diff --git a/Tests/QtAutogen/mocInclude/ObjA_p.h b/Tests/QtAutogen/mocInclude/ObjA_p.h
new file mode 100644
index 0000000..eb60c98
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/ObjA_p.h
@@ -0,0 +1,12 @@
+#ifndef OBJA_P_HPP
+#define OBJA_P_HPP
+
+class ObjAPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  ObjAPrivate();
+  ~ObjAPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/ObjB.cpp b/Tests/QtAutogen/mocInclude/ObjB.cpp
index 5ff315d..a6f2509 100644
--- a/Tests/QtAutogen/mocInclude/ObjB.cpp
+++ b/Tests/QtAutogen/mocInclude/ObjB.cpp
@@ -1,25 +1,22 @@
 #include "ObjB.hpp"
+#include "ObjB_p.h"
 
-class SubObjB : public QObject
+ObjBPrivate::ObjBPrivate()
 {
-  Q_OBJECT
-
-public:
-  SubObjB() {}
-  ~SubObjB() {}
+}
 
-  Q_SLOT
-  void aSlot();
-};
+ObjBPrivate::~ObjBPrivate()
+{
+}
 
-void SubObjB::aSlot()
+ObjB::ObjB()
+  : d(new ObjBPrivate)
 {
 }
 
-void ObjB::go()
+ObjB::~ObjB()
 {
-  SubObjB subObj;
+  delete d;
 }
 
-#include "ObjB.moc"
 #include "moc_ObjB.cpp"
diff --git a/Tests/QtAutogen/mocInclude/ObjB.hpp b/Tests/QtAutogen/mocInclude/ObjB.hpp
index 94f3d49..2ac8d17 100644
--- a/Tests/QtAutogen/mocInclude/ObjB.hpp
+++ b/Tests/QtAutogen/mocInclude/ObjB.hpp
@@ -1,13 +1,19 @@
-#ifndef OBJB_HPP
-#define OBJB_HPP
+#ifndef ObjB_HPP
+#define ObjB_HPP
 
 #include <QObject>
 
+// Object source comes with a _moc include
+class ObjBPrivate;
 class ObjB : public QObject
 {
   Q_OBJECT
-  Q_SLOT
-  void go();
+public:
+  ObjB();
+  ~ObjB();
+
+private:
+  ObjBPrivate* const d;
 };
 
 #endif
diff --git a/Tests/QtAutogen/mocInclude/ObjB_p.h b/Tests/QtAutogen/mocInclude/ObjB_p.h
new file mode 100644
index 0000000..418da65
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/ObjB_p.h
@@ -0,0 +1,12 @@
+#ifndef OBJB_P_HPP
+#define OBJB_P_HPP
+
+class ObjBPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  ObjBPrivate();
+  ~ObjBPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/ObjC.cpp b/Tests/QtAutogen/mocInclude/ObjC.cpp
deleted file mode 100644
index 8ca34cb..0000000
--- a/Tests/QtAutogen/mocInclude/ObjC.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "ObjC.hpp"
-
-class SubObjC : public QObject
-{
-  Q_OBJECT
-
-public:
-  SubObjC() {}
-  ~SubObjC() {}
-
-  Q_SLOT
-  void aSlot();
-};
-
-void SubObjC::aSlot()
-{
-}
-
-void ObjC::go()
-{
-  SubObjC subObj;
-}
-
-#include "ObjC.moc"
-// Not the own header
-#include "moc_ObjD.cpp"
diff --git a/Tests/QtAutogen/mocInclude/ObjC.hpp b/Tests/QtAutogen/mocInclude/ObjC.hpp
deleted file mode 100644
index a8e98eb..0000000
--- a/Tests/QtAutogen/mocInclude/ObjC.hpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef OBJC_HPP
-#define OBJC_HPP
-
-#include <QObject>
-
-class ObjC : public QObject
-{
-  Q_OBJECT
-  Q_SLOT
-  void go();
-};
-
-#endif
diff --git a/Tests/QtAutogen/mocInclude/ObjD.cpp b/Tests/QtAutogen/mocInclude/ObjD.cpp
deleted file mode 100644
index c18aec1..0000000
--- a/Tests/QtAutogen/mocInclude/ObjD.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "ObjD.hpp"
-
-class SubObjD : public QObject
-{
-  Q_OBJECT
-
-public:
-  SubObjD() {}
-  ~SubObjD() {}
-
-  Q_SLOT
-  void aSlot();
-};
-
-void SubObjD::aSlot()
-{
-}
-
-void ObjD::go()
-{
-  SubObjD subObj;
-}
-
-#include "ObjD.moc"
-// Header in subdirectory
-#include "subA/moc_SubObjA.cpp"
diff --git a/Tests/QtAutogen/mocInclude/ObjD.hpp b/Tests/QtAutogen/mocInclude/ObjD.hpp
deleted file mode 100644
index b6ee098..0000000
--- a/Tests/QtAutogen/mocInclude/ObjD.hpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef OBJD_HPP
-#define OBJD_HPP
-
-#include <QObject>
-
-class ObjD : public QObject
-{
-  Q_OBJECT
-  Q_SLOT
-  void go();
-};
-
-#endif
diff --git a/Tests/QtAutogen/mocInclude/SObjA.cpp b/Tests/QtAutogen/mocInclude/SObjA.cpp
new file mode 100644
index 0000000..7e75bf9
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjA.cpp
@@ -0,0 +1,11 @@
+#include "SObjA.hpp"
+
+SObjA::SObjA()
+{
+}
+
+SObjA::~SObjA()
+{
+}
+
+#include "SObjA.moc"
diff --git a/Tests/QtAutogen/mocInclude/SObjA.hpp b/Tests/QtAutogen/mocInclude/SObjA.hpp
new file mode 100644
index 0000000..1436abc
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjA.hpp
@@ -0,0 +1,15 @@
+#ifndef SOBJA_HPP
+#define SOBJA_HPP
+
+#include <QObject>
+
+// Object source includes externally generated .moc file
+class SObjA : public QObject
+{
+  Q_OBJECT
+public:
+  SObjA();
+  ~SObjA();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/SObjB.cpp.in b/Tests/QtAutogen/mocInclude/SObjB.cpp.in
new file mode 100644
index 0000000..b1cc12a
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjB.cpp.in
@@ -0,0 +1,11 @@
+#include "SObjB.hpp"
+
+SObjB::SObjB()
+{
+}
+
+SObjB::~SObjB()
+{
+}
+
+#include "SObjB.moc"
diff --git a/Tests/QtAutogen/mocInclude/SObjB.hpp.in b/Tests/QtAutogen/mocInclude/SObjB.hpp.in
new file mode 100644
index 0000000..5e396ae
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjB.hpp.in
@@ -0,0 +1,15 @@
+#ifndef SOBJB_HPP
+#define SOBJB_HPP
+
+#include <QObject>
+
+// Object source includes externally generated .moc file
+class SObjB : public QObject
+{
+  Q_OBJECT
+public:
+  SObjB();
+  ~SObjB();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/SObjC.cpp b/Tests/QtAutogen/mocInclude/SObjC.cpp
new file mode 100644
index 0000000..1e8d397
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjC.cpp
@@ -0,0 +1,35 @@
+#include "SObjC.hpp"
+
+void SObjCLocalFunction();
+
+class SObjCLocal : public QObject
+{
+  Q_OBJECT
+
+public:
+  SObjCLocal();
+  ~SObjCLocal();
+};
+
+SObjCLocal::SObjCLocal()
+{
+}
+
+SObjCLocal::~SObjCLocal()
+{
+}
+
+SObjC::SObjC()
+{
+  SObjCLocal localObject;
+  SObjCLocalFunction();
+}
+
+SObjC::~SObjC()
+{
+}
+
+#include "SObjC.moc"
+#include "moc_SObjC.cpp"
+// Include moc_ file for which the header is SKIP_AUTOMOC enabled
+#include "moc_SObjCExtra.cpp"
diff --git a/Tests/QtAutogen/mocInclude/SObjC.hpp b/Tests/QtAutogen/mocInclude/SObjC.hpp
new file mode 100644
index 0000000..def0f9d
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjC.hpp
@@ -0,0 +1,15 @@
+#ifndef SOBJC_HPP
+#define SOBJC_HPP
+
+#include <QObject>
+
+// Object source includes externally generated .moc file
+class SObjC : public QObject
+{
+  Q_OBJECT
+public:
+  SObjC();
+  ~SObjC();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/SObjCExtra.cpp b/Tests/QtAutogen/mocInclude/SObjCExtra.cpp
new file mode 100644
index 0000000..55dd1c3
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjCExtra.cpp
@@ -0,0 +1,31 @@
+#include "SObjCExtra.hpp"
+
+class SObjCLocalExtra : public QObject
+{
+  Q_OBJECT
+
+public:
+  SObjCLocalExtra();
+  ~SObjCLocalExtra();
+};
+
+SObjCLocalExtra::SObjCLocalExtra()
+{
+}
+
+SObjCLocalExtra::~SObjCLocalExtra()
+{
+}
+
+SObjCExtra::SObjCExtra()
+{
+}
+
+SObjCExtra::~SObjCExtra()
+{
+}
+
+// Externally generated header moc
+#include "SObjCExtra_extMoc.cpp"
+// AUTOMOC generated source moc
+#include "SObjCExtra.moc"
diff --git a/Tests/QtAutogen/mocInclude/SObjCExtra.hpp b/Tests/QtAutogen/mocInclude/SObjCExtra.hpp
new file mode 100644
index 0000000..08545ac
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjCExtra.hpp
@@ -0,0 +1,15 @@
+#ifndef SOBJCEXTRA_HPP
+#define SOBJCEXTRA_HPP
+
+#include <QObject>
+
+// Object source includes externally generated .moc file
+class SObjCExtra : public QObject
+{
+  Q_OBJECT
+public:
+  SObjCExtra();
+  ~SObjCExtra();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/SObjCExtra.moc.in b/Tests/QtAutogen/mocInclude/SObjCExtra.moc.in
new file mode 100644
index 0000000..00fc4aa
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/SObjCExtra.moc.in
@@ -0,0 +1,4 @@
+
+void SObjCLocalFunction()
+{
+}
diff --git a/Tests/QtAutogen/mocInclude/shared.cmake b/Tests/QtAutogen/mocInclude/shared.cmake
new file mode 100644
index 0000000..c426050
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/shared.cmake
@@ -0,0 +1,69 @@
+# Test moc include patterns
+include_directories("../mocInclude")
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+# Generate .moc file externally and enabled SKIP_AUTOMOC on the file
+qtx_generate_moc(
+  ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjA.hpp
+  ${CMAKE_CURRENT_BINARY_DIR}/SObjA.moc)
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjA.cpp PROPERTY SKIP_AUTOMOC ON)
+
+# Generate .moc file externally from generated source file
+# and enabled SKIP_AUTOMOC on the source file
+add_custom_command(
+  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp
+  COMMAND ${CMAKE_COMMAND} -E copy
+    ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjB.hpp.in
+    ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp)
+add_custom_command(
+  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp
+  COMMAND ${CMAKE_COMMAND} -E copy
+    ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjB.cpp.in
+    ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp)
+qtx_generate_moc(
+  ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp
+  ${CMAKE_CURRENT_BINARY_DIR}/SObjB.moc)
+set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp PROPERTY SKIP_AUTOMOC ON)
+
+# Generate moc file externally and enabled SKIP_AUTOMOC on the header
+qtx_generate_moc(
+  ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjCExtra.hpp
+  ${CMAKE_CURRENT_BINARY_DIR}/SObjCExtra_extMoc.cpp)
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjCExtra.hpp PROPERTY SKIP_AUTOMOC ON)
+# Custom target to depend on
+set(SOBJC_MOC ${CMAKE_CURRENT_BINARY_DIR}/${MOC_INCLUDE_NAME}_autogen/include/moc_SObjCExtra.cpp)
+add_custom_target("${MOC_INCLUDE_NAME}_SOBJC"
+  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/SObjCExtra_extMoc.cpp
+  BYPRODUCTS ${SOBJC_MOC}
+  COMMAND ${CMAKE_COMMAND} -E copy
+    ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjCExtra.moc.in
+    ${SOBJC_MOC})
+
+# MOC_INCLUDE_NAME must be defined by the includer
+add_executable(${MOC_INCLUDE_NAME}
+  # Common sources
+  ../mocInclude/ObjA.cpp
+  ../mocInclude/ObjB.cpp
+
+  ../mocInclude/LObjA.cpp
+  ../mocInclude/LObjB.cpp
+
+  ../mocInclude/EObjA.cpp
+  ../mocInclude/EObjAExtra.cpp
+  ../mocInclude/EObjB.cpp
+  ../mocInclude/subExtra/EObjBExtra.cpp
+
+  ../mocInclude/SObjA.cpp
+  ${CMAKE_CURRENT_BINARY_DIR}/SObjA.moc
+  ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp
+  ${CMAKE_CURRENT_BINARY_DIR}/SObjB.moc
+  ../mocInclude/SObjC.cpp
+  ../mocInclude/SObjCExtra.hpp
+  ../mocInclude/SObjCExtra.cpp
+
+  ../mocInclude/subGlobal/GObj.cpp
+  main.cpp
+)
+add_dependencies(${MOC_INCLUDE_NAME} "${MOC_INCLUDE_NAME}_SOBJC")
+target_link_libraries(${MOC_INCLUDE_NAME} ${QT_LIBRARIES})
+set_target_properties(${MOC_INCLUDE_NAME} PROPERTIES AUTOMOC ON)
diff --git a/Tests/QtAutogen/mocInclude/subA/SubObjA.cpp b/Tests/QtAutogen/mocInclude/subA/SubObjA.cpp
deleted file mode 100644
index a05f6e3..0000000
--- a/Tests/QtAutogen/mocInclude/subA/SubObjA.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "SubObjA.hpp"
-
-namespace subA {
-
-class SubObjA : public QObject
-{
-  Q_OBJECT
-
-public:
-  SubObjA() {}
-  ~SubObjA() {}
-
-  Q_SLOT
-  void aSlot();
-};
-
-void SubObjA::aSlot()
-{
-}
-
-void ObjA::go()
-{
-  SubObjA subObj;
-}
-}
-
-#include "SubObjA.moc"
diff --git a/Tests/QtAutogen/mocInclude/subA/SubObjA.hpp b/Tests/QtAutogen/mocInclude/subA/SubObjA.hpp
deleted file mode 100644
index 31a18b6..0000000
--- a/Tests/QtAutogen/mocInclude/subA/SubObjA.hpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef SUBOBJA_HPP
-#define SUBOBJA_HPP
-
-#include <QObject>
-
-namespace subA {
-
-class ObjA : public QObject
-{
-  Q_OBJECT
-  Q_SLOT
-  void go();
-};
-}
-
-#endif
diff --git a/Tests/QtAutogen/mocInclude/subB/SubObjB.cpp b/Tests/QtAutogen/mocInclude/subB/SubObjB.cpp
deleted file mode 100644
index 1e77639..0000000
--- a/Tests/QtAutogen/mocInclude/subB/SubObjB.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "SubObjB.hpp"
-
-namespace subB {
-
-class SubObjB : public QObject
-{
-  Q_OBJECT
-
-public:
-  SubObjB() {}
-  ~SubObjB() {}
-
-  Q_SLOT
-  void aSlot();
-};
-
-void SubObjB::aSlot()
-{
-}
-
-void ObjB::go()
-{
-  SubObjB subObj;
-}
-}
-
-#include "SubObjB.moc"
diff --git a/Tests/QtAutogen/mocInclude/subB/SubObjB.hpp b/Tests/QtAutogen/mocInclude/subB/SubObjB.hpp
deleted file mode 100644
index 3f29fa2..0000000
--- a/Tests/QtAutogen/mocInclude/subB/SubObjB.hpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef SUBOBJB_HPP
-#define SUBOBJB_HPP
-
-#include <QObject>
-
-namespace subB {
-
-class ObjB : public QObject
-{
-  Q_OBJECT
-  Q_SLOT
-  void go();
-};
-}
-
-#endif
diff --git a/Tests/QtAutogen/mocInclude/subC/SubObjC.cpp b/Tests/QtAutogen/mocInclude/subC/SubObjC.cpp
deleted file mode 100644
index c2d94ef..0000000
--- a/Tests/QtAutogen/mocInclude/subC/SubObjC.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "SubObjC.hpp"
-
-namespace subC {
-
-class SubObjC : public QObject
-{
-  Q_OBJECT
-
-public:
-  SubObjC() {}
-  ~SubObjC() {}
-
-  Q_SLOT
-  void aSlot();
-};
-
-void SubObjC::aSlot()
-{
-}
-
-void ObjC::go()
-{
-  SubObjC subObj;
-}
-}
-
-#include "SubObjC.moc"
diff --git a/Tests/QtAutogen/mocInclude/subC/SubObjC.hpp b/Tests/QtAutogen/mocInclude/subC/SubObjC.hpp
deleted file mode 100644
index dc251fd..0000000
--- a/Tests/QtAutogen/mocInclude/subC/SubObjC.hpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef SUBOBJC_HPP
-#define SUBOBJC_HPP
-
-#include <QObject>
-
-namespace subC {
-
-class ObjC : public QObject
-{
-  Q_OBJECT
-  Q_SLOT
-  void go();
-};
-}
-
-#endif
diff --git a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp
new file mode 100644
index 0000000..c697866
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp
@@ -0,0 +1,20 @@
+#include "EObjBExtra.hpp"
+#include "EObjBExtra_p.hpp"
+
+EObjBExtraPrivate::EObjBExtraPrivate()
+{
+}
+
+EObjBExtraPrivate::~EObjBExtraPrivate()
+{
+}
+
+EObjBExtra::EObjBExtra()
+  : d(new EObjBExtraPrivate)
+{
+}
+
+EObjBExtra::~EObjBExtra()
+{
+  delete d;
+}
diff --git a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp
new file mode 100644
index 0000000..3798d7f
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp
@@ -0,0 +1,18 @@
+#ifndef EOBJBEXTRA_HPP
+#define EOBJBEXTRA_HPP
+
+#include <QObject>
+
+class EObjBExtraPrivate;
+class EObjBExtra : public QObject
+{
+  Q_OBJECT
+public:
+  EObjBExtra();
+  ~EObjBExtra();
+
+private:
+  EObjBExtraPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp
new file mode 100644
index 0000000..db8a096
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp
@@ -0,0 +1,12 @@
+#ifndef EOBJBEXTRA_P_HPP
+#define EOBJBEXTRA_P_HPP
+
+class EObjBExtraPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  EObjBExtraPrivate();
+  ~EObjBExtraPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp b/Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp
new file mode 100644
index 0000000..6b92f21
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp
@@ -0,0 +1,41 @@
+#include "GObj.hpp"
+#include "GObj_p.hpp"
+
+namespace subGlobal {
+
+class GObjLocal : public QObject
+{
+  Q_OBJECT
+public:
+  GObjLocal();
+  ~GObjLocal();
+};
+
+GObjLocal::GObjLocal()
+{
+}
+
+GObjLocal::~GObjLocal()
+{
+}
+
+GObjPrivate::GObjPrivate()
+{
+}
+
+GObjPrivate::~GObjPrivate()
+{
+}
+
+GObj::GObj()
+{
+  GObjLocal localObj;
+}
+
+GObj::~GObj()
+{
+}
+}
+
+// For the local QObject
+#include "GObj.moc"
diff --git a/Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp b/Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp
new file mode 100644
index 0000000..2f9ee82
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp
@@ -0,0 +1,17 @@
+#ifndef GOBJ_HPP
+#define GOBJ_HPP
+
+#include <QObject>
+
+namespace subGlobal {
+
+class GObj : public QObject
+{
+  Q_OBJECT
+public:
+  GObj();
+  ~GObj();
+};
+}
+
+#endif
diff --git a/Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp b/Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp
new file mode 100644
index 0000000..7b37dfd
--- /dev/null
+++ b/Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp
@@ -0,0 +1,15 @@
+#ifndef GOBJ_P_HPP
+#define GOBJ_P_HPP
+
+namespace subGlobal {
+
+class GObjPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  GObjPrivate();
+  ~GObjPrivate();
+};
+}
+
+#endif
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt b/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt
index 6a0829d..97ba1df 100644
--- a/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt
+++ b/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt
@@ -2,17 +2,16 @@
 
 set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
 
-include_directories("../mocInclude")
+# Shared executable
+set(MOC_INCLUDE_NAME "mocIncludeRelaxed")
+include(${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/shared.cmake)
 
-add_executable(mocIncludeRelaxed
-  ../mocInclude/ObjA.cpp
-  ../mocInclude/ObjB.cpp
-  ../mocInclude/ObjC.cpp
-  ../mocInclude/ObjD.cpp
-  ../mocInclude/subA/SubObjA.cpp
-  ../mocInclude/subB/SubObjB.cpp
-  ../mocInclude/subC/SubObjC.cpp
-  main.cpp
+# Relaxed ony executable
+add_executable(mocIncludeRelaxedOnly
+  RObjA.cpp
+  RObjB.cpp
+  RObjC.cpp
+  RMain.cpp
 )
-target_link_libraries(mocIncludeRelaxed ${QT_LIBRARIES})
-set_target_properties(mocIncludeRelaxed PROPERTIES AUTOMOC ON)
+target_link_libraries(mocIncludeRelaxedOnly ${QT_LIBRARIES})
+set_target_properties(mocIncludeRelaxedOnly PROPERTIES AUTOMOC ON)
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp
new file mode 100644
index 0000000..5b2c070
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp
@@ -0,0 +1,12 @@
+// Relaxed AUTOMOC objects
+#include "RObjA.hpp"
+#include "RObjB.hpp"
+#include "RObjC.hpp"
+
+int main(int argv, char** args)
+{
+  RObjA rObjA;
+  RObjB rObjB;
+  RObjC rObjC;
+  return 0;
+}
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp
new file mode 100644
index 0000000..2e2cf6a
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp
@@ -0,0 +1,12 @@
+#include "RObjA.hpp"
+
+RObjA::RObjA()
+{
+}
+
+RObjA::~RObjA()
+{
+}
+
+// Relaxed include should moc the header instead
+#include "RObjA.moc"
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp
new file mode 100644
index 0000000..5974187
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp
@@ -0,0 +1,14 @@
+#ifndef ROBJA_HPP
+#define ROBJA_HPP
+
+#include <QObject>
+
+class RObjA : public QObject
+{
+  Q_OBJECT
+public:
+  RObjA();
+  ~RObjA();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp
new file mode 100644
index 0000000..c56d10f
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp
@@ -0,0 +1,22 @@
+#include "RObjB.hpp"
+#include "RObjBExtra.hpp"
+
+RObjBExtra::RObjBExtra()
+{
+}
+
+RObjBExtra::~RObjBExtra()
+{
+}
+
+RObjB::RObjB()
+{
+  RObjBExtra extraObject;
+}
+
+RObjB::~RObjB()
+{
+}
+
+// Relaxed mode should run moc on RObjBExtra.hpp instead
+#include "RObjBExtra.moc"
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp
new file mode 100644
index 0000000..d6d0474
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp
@@ -0,0 +1,14 @@
+#ifndef ROBJB_HPP
+#define ROBJB_HPP
+
+#include <QObject>
+
+class RObjB : public QObject
+{
+  Q_OBJECT
+public:
+  RObjB();
+  ~RObjB();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp
new file mode 100644
index 0000000..5d6be75
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp
@@ -0,0 +1,14 @@
+#ifndef ROBJBEXTRA_HPP
+#define ROBJBEXTRA_HPP
+
+#include <QObject>
+
+class RObjBExtra : public QObject
+{
+  Q_OBJECT
+public:
+  RObjBExtra();
+  ~RObjBExtra();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp
new file mode 100644
index 0000000..4ba32f5
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp
@@ -0,0 +1,30 @@
+#include "RObjC.hpp"
+#include <QObject>
+
+class RObjCPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  RObjCPrivate();
+  ~RObjCPrivate();
+};
+
+RObjCPrivate::RObjCPrivate()
+{
+}
+
+RObjCPrivate::~RObjCPrivate()
+{
+}
+
+RObjC::RObjC()
+{
+  RObjCPrivate privateObject;
+}
+
+RObjC::~RObjC()
+{
+}
+
+// Relaxed include should moc this source instead of the header
+#include "moc_RObjC.cpp"
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp
new file mode 100644
index 0000000..5552ede
--- /dev/null
+++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp
@@ -0,0 +1,14 @@
+#ifndef ROBJC_HPP
+#define ROBJC_HPP
+
+#include <QObject>
+
+class RObjC : public QObject
+{
+  Q_OBJECT
+public:
+  RObjC();
+  ~RObjC();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/main.cpp b/Tests/QtAutogen/mocIncludeRelaxed/main.cpp
index 142d59e..5a3148d 100644
--- a/Tests/QtAutogen/mocIncludeRelaxed/main.cpp
+++ b/Tests/QtAutogen/mocIncludeRelaxed/main.cpp
@@ -1,14 +1,26 @@
+#include "EObjA.hpp"
+#include "EObjB.hpp"
+#include "LObjA.hpp"
+#include "LObjB.hpp"
 #include "ObjA.hpp"
 #include "ObjB.hpp"
-#include "ObjC.hpp"
+#include "SObjA.hpp"
+#include "SObjB.hpp"
+#include "subGlobal/GObj.hpp"
 
 int main(int argv, char** args)
 {
+  subGlobal::GObj gObj;
   ObjA objA;
   ObjB objB;
-  ObjC objC;
+  LObjA lObjA;
+  LObjB lObjB;
+  EObjA eObjA;
+  EObjB eObjB;
+  SObjA sObjA;
+  SObjB sObjB;
   return 0;
 }
 
 // Header in global subdirectory
-#include "subB/moc_SubObjB.cpp"
+#include "subGlobal/moc_GObj.cpp"
diff --git a/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt b/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt
index 22e93a8..789354a 100644
--- a/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt
+++ b/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt
@@ -1,18 +1,6 @@
 # Test moc include patterns
 
 set(CMAKE_AUTOMOC_RELAXED_MODE FALSE)
+set(MOC_INCLUDE_NAME "mocIncludeStrict")
 
-include_directories("../mocInclude")
-
-add_executable(mocIncludeStrict
-  ../mocInclude/ObjA.cpp
-  ../mocInclude/ObjB.cpp
-  ../mocInclude/ObjC.cpp
-  ../mocInclude/ObjD.cpp
-  ../mocInclude/subA/SubObjA.cpp
-  ../mocInclude/subB/SubObjB.cpp
-  ../mocInclude/subC/SubObjC.cpp
-  main.cpp
-)
-target_link_libraries(mocIncludeStrict ${QT_LIBRARIES})
-set_target_properties(mocIncludeStrict PROPERTIES AUTOMOC ON)
+include(${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/shared.cmake)
diff --git a/Tests/QtAutogen/mocIncludeStrict/main.cpp b/Tests/QtAutogen/mocIncludeStrict/main.cpp
index 142d59e..5a3148d 100644
--- a/Tests/QtAutogen/mocIncludeStrict/main.cpp
+++ b/Tests/QtAutogen/mocIncludeStrict/main.cpp
@@ -1,14 +1,26 @@
+#include "EObjA.hpp"
+#include "EObjB.hpp"
+#include "LObjA.hpp"
+#include "LObjB.hpp"
 #include "ObjA.hpp"
 #include "ObjB.hpp"
-#include "ObjC.hpp"
+#include "SObjA.hpp"
+#include "SObjB.hpp"
+#include "subGlobal/GObj.hpp"
 
 int main(int argv, char** args)
 {
+  subGlobal::GObj gObj;
   ObjA objA;
   ObjB objB;
-  ObjC objC;
+  LObjA lObjA;
+  LObjB lObjB;
+  EObjA eObjA;
+  EObjB eObjB;
+  SObjA sObjA;
+  SObjB sObjB;
   return 0;
 }
 
 // Header in global subdirectory
-#include "subB/moc_SubObjB.cpp"
+#include "subGlobal/moc_GObj.cpp"

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

Summary of changes:
 Source/CPack/cmCPackDragNDropGenerator.cxx         |    4 +-
 Source/cmStringCommand.cxx                         |    2 +
 Tests/QtAutogen/CMakeLists.txt                     |    6 ++
 Tests/QtAutogen/mocInclude/EObjA.cpp               |   43 ++++++++++++
 Tests/QtAutogen/mocInclude/EObjA.hpp               |   19 ++++++
 Tests/QtAutogen/mocInclude/EObjAExtra.cpp          |   20 ++++++
 Tests/QtAutogen/mocInclude/EObjAExtra.hpp          |   18 +++++
 Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp        |   12 ++++
 Tests/QtAutogen/mocInclude/EObjA_p.hpp             |   12 ++++
 Tests/QtAutogen/mocInclude/EObjB.cpp               |   44 +++++++++++++
 Tests/QtAutogen/mocInclude/EObjB.hpp               |   19 ++++++
 Tests/QtAutogen/mocInclude/EObjB_p.hpp             |   12 ++++
 Tests/QtAutogen/mocInclude/LObjA.cpp               |   39 +++++++++++
 Tests/QtAutogen/mocInclude/LObjA.hpp               |   19 ++++++
 Tests/QtAutogen/mocInclude/LObjA_p.h               |   12 ++++
 Tests/QtAutogen/mocInclude/LObjB.cpp               |   40 ++++++++++++
 Tests/QtAutogen/mocInclude/LObjB.hpp               |   19 ++++++
 Tests/QtAutogen/mocInclude/LObjB_p.h               |   12 ++++
 Tests/QtAutogen/mocInclude/ObjA.cpp                |   24 +++----
 Tests/QtAutogen/mocInclude/ObjA.hpp                |   10 ++-
 Tests/QtAutogen/mocInclude/ObjA_p.h                |   12 ++++
 Tests/QtAutogen/mocInclude/ObjB.cpp                |   23 +++----
 Tests/QtAutogen/mocInclude/ObjB.hpp                |   14 ++--
 Tests/QtAutogen/mocInclude/ObjB_p.h                |   12 ++++
 Tests/QtAutogen/mocInclude/ObjC.cpp                |   26 --------
 Tests/QtAutogen/mocInclude/ObjC.hpp                |   13 ----
 Tests/QtAutogen/mocInclude/ObjD.cpp                |   26 --------
 Tests/QtAutogen/mocInclude/ObjD.hpp                |   13 ----
 Tests/QtAutogen/mocInclude/SObjA.cpp               |   11 ++++
 Tests/QtAutogen/mocInclude/SObjA.hpp               |   15 +++++
 Tests/QtAutogen/mocInclude/SObjB.cpp.in            |   11 ++++
 Tests/QtAutogen/mocInclude/SObjB.hpp.in            |   15 +++++
 Tests/QtAutogen/mocInclude/SObjC.cpp               |   35 ++++++++++
 Tests/QtAutogen/mocInclude/SObjC.hpp               |   15 +++++
 Tests/QtAutogen/mocInclude/SObjCExtra.cpp          |   31 +++++++++
 Tests/QtAutogen/mocInclude/SObjCExtra.hpp          |   15 +++++
 Tests/QtAutogen/mocInclude/SObjCExtra.moc.in       |    4 ++
 Tests/QtAutogen/mocInclude/shared.cmake            |   69 ++++++++++++++++++++
 Tests/QtAutogen/mocInclude/subA/SubObjA.cpp        |   27 --------
 Tests/QtAutogen/mocInclude/subA/SubObjA.hpp        |   16 -----
 Tests/QtAutogen/mocInclude/subB/SubObjB.cpp        |   27 --------
 Tests/QtAutogen/mocInclude/subB/SubObjB.hpp        |   16 -----
 Tests/QtAutogen/mocInclude/subC/SubObjC.cpp        |   27 --------
 Tests/QtAutogen/mocInclude/subC/SubObjC.hpp        |   16 -----
 Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp |   20 ++++++
 Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp |   18 +++++
 .../QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp |   12 ++++
 Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp      |   41 ++++++++++++
 Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp      |   17 +++++
 Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp    |   15 +++++
 Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt   |   23 ++++---
 Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp        |   12 ++++
 Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp        |   12 ++++
 Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp        |   14 ++++
 Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp        |   22 +++++++
 Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp        |   14 ++++
 Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp   |   14 ++++
 Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp        |   30 +++++++++
 Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp        |   14 ++++
 Tests/QtAutogen/mocIncludeRelaxed/main.cpp         |   18 ++++-
 Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt    |   16 +----
 Tests/QtAutogen/mocIncludeStrict/main.cpp          |   18 ++++-
 .../string/RegexMultiMatchClear-stderr.txt         |   12 ++++
 Tests/RunCMake/string/RegexMultiMatchClear.cmake   |   20 ++++++
 Tests/RunCMake/string/RunCMakeTest.cmake           |    1 +
 65 files changed, 965 insertions(+), 273 deletions(-)
 create mode 100644 Tests/QtAutogen/mocInclude/EObjA.cpp
 create mode 100644 Tests/QtAutogen/mocInclude/EObjA.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/EObjAExtra.cpp
 create mode 100644 Tests/QtAutogen/mocInclude/EObjAExtra.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/EObjA_p.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/EObjB.cpp
 create mode 100644 Tests/QtAutogen/mocInclude/EObjB.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/EObjB_p.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/LObjA.cpp
 create mode 100644 Tests/QtAutogen/mocInclude/LObjA.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/LObjA_p.h
 create mode 100644 Tests/QtAutogen/mocInclude/LObjB.cpp
 create mode 100644 Tests/QtAutogen/mocInclude/LObjB.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/LObjB_p.h
 create mode 100644 Tests/QtAutogen/mocInclude/ObjA_p.h
 create mode 100644 Tests/QtAutogen/mocInclude/ObjB_p.h
 delete mode 100644 Tests/QtAutogen/mocInclude/ObjC.cpp
 delete mode 100644 Tests/QtAutogen/mocInclude/ObjC.hpp
 delete mode 100644 Tests/QtAutogen/mocInclude/ObjD.cpp
 delete mode 100644 Tests/QtAutogen/mocInclude/ObjD.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/SObjA.cpp
 create mode 100644 Tests/QtAutogen/mocInclude/SObjA.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/SObjB.cpp.in
 create mode 100644 Tests/QtAutogen/mocInclude/SObjB.hpp.in
 create mode 100644 Tests/QtAutogen/mocInclude/SObjC.cpp
 create mode 100644 Tests/QtAutogen/mocInclude/SObjC.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/SObjCExtra.cpp
 create mode 100644 Tests/QtAutogen/mocInclude/SObjCExtra.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/SObjCExtra.moc.in
 create mode 100644 Tests/QtAutogen/mocInclude/shared.cmake
 delete mode 100644 Tests/QtAutogen/mocInclude/subA/SubObjA.cpp
 delete mode 100644 Tests/QtAutogen/mocInclude/subA/SubObjA.hpp
 delete mode 100644 Tests/QtAutogen/mocInclude/subB/SubObjB.cpp
 delete mode 100644 Tests/QtAutogen/mocInclude/subB/SubObjB.hpp
 delete mode 100644 Tests/QtAutogen/mocInclude/subC/SubObjC.cpp
 delete mode 100644 Tests/QtAutogen/mocInclude/subC/SubObjC.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp
 create mode 100644 Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp
 create mode 100644 Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp
 create mode 100644 Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp
 create mode 100644 Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp
 create mode 100644 Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp
 create mode 100644 Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp
 create mode 100644 Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp
 create mode 100644 Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp
 create mode 100644 Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp
 create mode 100644 Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp
 create mode 100644 Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp
 create mode 100644 Tests/RunCMake/string/RegexMultiMatchClear-stderr.txt
 create mode 100644 Tests/RunCMake/string/RegexMultiMatchClear.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list