diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index c8caddfe7a0e5d83ea697d6a939d7cfa2ece1703..d8b91001eb21cb9a0f6a4c1a28c53d2927ca4ccb 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1508,6 +1508,7 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
   info.SetConfig("PARSE_CACHE_FILE", this->AutogenTarget.ParseCacheFile);
   info.Set("DEP_FILE", this->AutogenTarget.DepFile);
   info.Set("DEP_FILE_RULE_NAME", this->AutogenTarget.DepFileRuleName);
+  info.SetArray("CMAKE_LIST_FILES", this->Makefile->GetListFiles());
   info.SetArray("HEADER_EXTENSIONS",
                 this->Makefile->GetCMakeInstance()->GetHeaderExtensions());
   info.SetArrayArray(
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index f159a3da7689068a159c65d5f69216afdcbb03a1..49eb018e7c89ad30ff3678e660fe5f8464a486c1 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -184,6 +184,7 @@ public:
     std::string DepFile;
     std::string DepFileRuleName;
     std::vector<std::string> HeaderExtensions;
+    std::vector<std::string> ListFiles;
   };
 
   /** Shared common variables.  */
@@ -2176,7 +2177,7 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
     return dependenciesFromDepFile(f.c_str());
   };
 
-  std::vector<std::string> dependencies;
+  std::vector<std::string> dependencies = BaseConst().ListFiles;
   ParseCacheT& parseCache = BaseEval().ParseCache;
   auto processMappingEntry = [&](const MappingMapT::value_type& m) {
     auto cacheEntry = parseCache.GetOrInsert(m.first);
@@ -2258,6 +2259,7 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
       !info.GetString("DEP_FILE_RULE_NAME", BaseConst_.DepFileRuleName,
                       false) ||
       !info.GetStringConfig("SETTINGS_FILE", SettingsFile_, true) ||
+      !info.GetArray("CMAKE_LIST_FILES", BaseConst_.ListFiles, true) ||
       !info.GetArray("HEADER_EXTENSIONS", BaseConst_.HeaderExtensions, true) ||
       !info.GetString("QT_MOC_EXECUTABLE", MocConst_.Executable, false) ||
       !info.GetString("QT_UIC_EXECUTABLE", UicConst_.Executable, false)) {
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt b/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..26776595d96e3f28ba492ce80a190d960611a0c5
--- /dev/null
+++ b/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt
@@ -0,0 +1,96 @@
+# This test checks whether adding a source file to the project triggers an AUTOMOC re-run.
+
+cmake_minimum_required(VERSION 3.10)
+project(RerunMocOnAddFile)
+include("../AutogenCoreTest.cmake")
+
+# Create an executable to generate a clean target
+set(main_source "${CMAKE_CURRENT_BINARY_DIR}/generated_main.cpp")
+file(WRITE "${main_source}" "int main() {}")
+add_executable(exe "${main_source}")
+
+# Utility variables
+set(timeformat "%Y.%j.%H.%M%S")
+set(testProjectTemplateDir "${CMAKE_CURRENT_SOURCE_DIR}/MocOnAddFile")
+set(testProjectSrc "${CMAKE_CURRENT_BINARY_DIR}/MocOnAddFile")
+set(testProjectBinDir "${CMAKE_CURRENT_BINARY_DIR}/MocOnAddFile-build")
+
+# Utility macros
+macro(sleep)
+  message(STATUS "Sleeping for a few seconds.")
+  execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1)
+endmacro()
+
+macro(acquire_timestamp When)
+  file(TIMESTAMP "${mocBasicBin}" time${When} "${timeformat}")
+endmacro()
+
+macro(rebuild buildName)
+  message(STATUS "Starting build ${buildName}.")
+  execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${testProjectBinDir}" RESULT_VARIABLE result)
+  if (result)
+    message(FATAL_ERROR "Build ${buildName} failed.")
+  else()
+    message(STATUS "Build ${buildName} finished.")
+  endif()
+endmacro()
+
+macro(require_change)
+  if (timeAfter VERSION_GREATER timeBefore)
+    message(STATUS "As expected the file ${mocBasicBin} changed.")
+  else()
+    message(SEND_ERROR "Unexpectedly the file ${mocBasicBin} did not change!\nTimestamp pre: ${timeBefore}\nTimestamp aft: ${timeAfter}\n")
+  endif()
+endmacro()
+
+macro(require_change_not)
+  if (timeAfter VERSION_GREATER timeBefore)
+    message(SEND_ERROR "Unexpectedly the file ${mocBasicBin} changed!\nTimestamp pre: ${timeBefore}\nTimestamp aft: ${timeAfter}\n")
+  else()
+    message(STATUS "As expected the file ${mocBasicBin} did not change.")
+  endif()
+endmacro()
+
+# Create the test project from the template
+unset(additional_project_sources)
+unset(main_cpp_includes)
+configure_file("${testProjectTemplateDir}/CMakeLists.txt.in" "${testProjectSrc}/CMakeLists.txt")
+configure_file("${testProjectTemplateDir}/main.cpp.in" "${testProjectSrc}/main.cpp")
+
+# Initial build
+try_compile(MOC_RERUN
+  "${testProjectBinDir}"
+  "${testProjectSrc}"
+  MocOnAddFile
+  CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+              "-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+              "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
+  OUTPUT_VARIABLE output
+)
+if (NOT MOC_RERUN)
+  message(FATAL_ERROR "Initial build of mocOnAddFile failed. Output: ${output}")
+endif()
+
+# Sleep to ensure new timestamps
+sleep()
+
+# Add a QObject class (defined in header) to the project and build
+set(additional_project_sources myobject.cpp)
+set(main_cpp_includes "#include \"myobject.h\"")
+configure_file("${testProjectTemplateDir}/CMakeLists.txt.in" "${testProjectSrc}/CMakeLists.txt"
+    @ONLY)
+configure_file("${testProjectTemplateDir}/main.cpp.in" "${testProjectSrc}/main.cpp" @ONLY)
+configure_file("${testProjectTemplateDir}/myobject.h" "${testProjectSrc}/myobject.h" COPYONLY)
+configure_file("${testProjectTemplateDir}/myobject.cpp" "${testProjectSrc}/myobject.cpp" COPYONLY)
+rebuild(2)
+
+# Sleep to ensure new timestamps
+sleep()
+
+# Add a QObject class (defined in source) to the project and build
+set(additional_project_sources myobject.cpp anotherobject.cpp)
+configure_file("${testProjectTemplateDir}/CMakeLists.txt.in" "${testProjectSrc}/CMakeLists.txt"
+    @ONLY)
+configure_file("${testProjectTemplateDir}/anotherobject.cpp" "${testProjectSrc}/anotherobject.cpp"
+    COPYONLY)
+rebuild(3)
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in
new file mode 100644
index 0000000000000000000000000000000000000000..9e5e21c30ac56d064299ebaebbdf048a83898e65
--- /dev/null
+++ b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in
@@ -0,0 +1,9 @@
+cmake_minimum_required(VERSION 3.10)
+project(MocOnAddFile)
+include("@CMAKE_CURRENT_LIST_DIR@/../AutogenCoreTest.cmake")
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+
+add_executable(mocOnAddFile main.cpp @additional_project_sources@)
+target_link_libraries(mocOnAddFile ${QT_QTCORE_TARGET})
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..45c5af681ca199ca6f948ca5a9c6b8b9519167f0
--- /dev/null
+++ b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp
@@ -0,0 +1,15 @@
+#include <qobject.h>
+
+class AnotherObject : public QObject
+{
+  Q_OBJECT
+public:
+  AnotherObject() {}
+};
+
+AnotherObject* createAnotherObject()
+{
+  return new AnotherObject();
+}
+
+#include "anotherobject.moc"
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/main.cpp.in b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/main.cpp.in
new file mode 100644
index 0000000000000000000000000000000000000000..f62027acbba5867fe7fb5c95ea950c1faef0831f
--- /dev/null
+++ b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/main.cpp.in
@@ -0,0 +1,6 @@
+@main_cpp_includes@
+
+int main(int argc, char *argv[])
+{
+    return 0;
+}
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.cpp b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7a15300586cbc6fd85865ef985bca238bc30cd6e
--- /dev/null
+++ b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.cpp
@@ -0,0 +1,6 @@
+#include "myobject.h"
+
+MyObject::MyObject(QObject* parent)
+  : QObject(parent)
+{
+}
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.h b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.h
new file mode 100644
index 0000000000000000000000000000000000000000..e373ee89c7967a018d9b1a8959ba609717a68023
--- /dev/null
+++ b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.h
@@ -0,0 +1,13 @@
+#ifndef MYOBJECT_H
+#define MYOBJECT_H
+
+#include <qobject.h>
+
+class MyObject : public QObject
+{
+  Q_OBJECT
+public:
+  MyObject(QObject* parent = 0);
+};
+
+#endif
diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake
index a19a9aeec8be2c67e6444dbd106d65af17f0402f..97efa720f9f0210bd26b935979c79d49847d312a 100644
--- a/Tests/QtAutogen/Tests.cmake
+++ b/Tests/QtAutogen/Tests.cmake
@@ -20,6 +20,7 @@ ADD_AUTOGEN_TEST(RccOffMocLibrary)
 ADD_AUTOGEN_TEST(RccOnly rccOnly)
 ADD_AUTOGEN_TEST(RccSkipSource)
 ADD_AUTOGEN_TEST(RerunMocBasic)
+ADD_AUTOGEN_TEST(RerunMocOnAddFile)
 ADD_AUTOGEN_TEST(RerunRccConfigChange)
 ADD_AUTOGEN_TEST(RerunRccDepends)
 ADD_AUTOGEN_TEST(SameName sameName)