[Cmake-commits] CMake branch, master, updated. v3.13.3-1116-g40628b2

Kitware Robot kwrobot at kitware.com
Fri Jan 25 08:13:03 EST 2019


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  40628b2519ae1553a33f701cf46ee8fbbd013b85 (commit)
       via  24b6e4830d9027e63db7dfafa500aaeb652d3a4c (commit)
       via  15bc4a25e50d18ba081f31ffd8fc4724b83460b5 (commit)
       via  9a2bddb7042485a35329cf8644f8da1cbfd2398f (commit)
       via  a8f51555235a1a747e540a0859ab146f927dfd0b (commit)
       via  26b7a8e77ecafea417a0430276533ec5e58fa33a (commit)
       via  de13c55d74e0e95aa3799ba132db668212721776 (commit)
       via  c3203bf31637a960d1bf579fb7092a1ae850cdb5 (commit)
       via  68eabb357616f7ef469b20dd8d9cb8ce588e113d (commit)
       via  a6982cff0d3910723ad4fd40b9c63cf77c872d30 (commit)
       via  dc6888573da15cd7ddb9f91b70ef3e6c4e7cae15 (commit)
      from  b4ccb6cd32029efa802dfdfa889c75bc16f65cf1 (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=40628b2519ae1553a33f701cf46ee8fbbd013b85
commit 40628b2519ae1553a33f701cf46ee8fbbd013b85
Merge: 24b6e48 a6982cf
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 25 13:09:28 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jan 25 08:09:37 2019 -0500

    Merge topic 'max-recursion-depth'
    
    a6982cff0d cmMakefile: Impose maximum recursion limit
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Acked-by: Juraj Oršulić <juraj.orsulic at fer.hr>
    Merge-request: !2746

diff --cc Source/cmMakefile.cxx
index 7eed837,ca5047a..b59a733
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@@ -2721,9 -2747,20 +2747,19 @@@ bool cmMakefile::IsProjectFile(const ch
  {
    return cmSystemTools::IsSubDirectory(filename, this->GetHomeDirectory()) ||
      (cmSystemTools::IsSubDirectory(filename, this->GetHomeOutputDirectory()) &&
 -     !cmSystemTools::IsSubDirectory(filename,
 -                                    cmake::GetCMakeFilesDirectory()));
 +     !cmSystemTools::IsSubDirectory(filename, "/CMakeFiles"));
  }
  
+ int cmMakefile::GetRecursionDepth() const
+ {
+   return this->RecursionDepth;
+ }
+ 
+ void cmMakefile::SetRecursionDepth(int recursionDepth)
+ {
+   this->RecursionDepth = recursionDepth;
+ }
+ 
  MessageType cmMakefile::ExpandVariablesInStringNew(
    std::string& errorstr, std::string& source, bool escapeQuotes,
    bool noEscapes, bool atOnly, const char* filename, long line,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=24b6e4830d9027e63db7dfafa500aaeb652d3a4c
commit 24b6e4830d9027e63db7dfafa500aaeb652d3a4c
Merge: 15bc4a2 dc68885
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 25 13:05:45 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jan 25 08:06:54 2019 -0500

    Merge topic 'exclude_from_all'
    
    dc6888573d Pass EXCLUDE_FROM_ALL from directory to targets
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2816


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15bc4a25e50d18ba081f31ffd8fc4724b83460b5
commit 15bc4a25e50d18ba081f31ffd8fc4724b83460b5
Merge: 9a2bddb de13c55
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 25 13:04:58 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jan 25 08:06:01 2019 -0500

    Merge topic 'swift'
    
    de13c55d74 Ninja: support `SWIFT_MODULE_NAME` property
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2850


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a2bddb7042485a35329cf8644f8da1cbfd2398f
commit 9a2bddb7042485a35329cf8644f8da1cbfd2398f
Merge: a8f5155 26b7a8e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 25 13:04:36 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jan 25 08:05:06 2019 -0500

    Merge topic 'FindICU-win64'
    
    26b7a8e77e FindICU: Find 64-bit Windows builds under CMP0074 NEW behavior
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2859


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a8f51555235a1a747e540a0859ab146f927dfd0b
commit a8f51555235a1a747e540a0859ab146f927dfd0b
Merge: b4ccb6c c3203bf
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 25 13:04:13 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Jan 25 08:04:19 2019 -0500

    Merge topic 'clang-warnings'
    
    c3203bf316 Silence -Wcomma warning
    68eabb3576 Avoid -Wstring-plus-int warning
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2846


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=26b7a8e77ecafea417a0430276533ec5e58fa33a
commit 26b7a8e77ecafea417a0430276533ec5e58fa33a
Author:     Johannes Reiff <mail at jreiff.de>
AuthorDate: Thu Jan 24 14:44:18 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Jan 24 14:55:35 2019 -0500

    FindICU: Find 64-bit Windows builds under CMP0074 NEW behavior
    
    CMP0074 causes FindICU.cmake to always prefer the 32-bit version of ICU
    programs/libraries on Windows. NO_PACKAGE_ROOT_PATH reverts this behavior.
    
    Fixes: #18742

diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake
index 70e10f5..e4b4909 100644
--- a/Modules/FindICU.cmake
+++ b/Modules/FindICU.cmake
@@ -165,7 +165,9 @@ function(_ICU_FIND)
     find_program("${cache_var}" "${program}"
       HINTS ${icu_roots}
       PATH_SUFFIXES ${icu_binary_suffixes}
-      DOC "ICU ${program} executable")
+      DOC "ICU ${program} executable"
+      NO_PACKAGE_ROOT_PATH
+      )
     mark_as_advanced(cache_var)
     set("${program_var}" "${${cache_var}}" PARENT_SCOPE)
   endforeach()
@@ -229,11 +231,15 @@ function(_ICU_FIND)
     find_library("${component_cache_release}" ${component_libnames}
       HINTS ${icu_roots}
       PATH_SUFFIXES ${icu_library_suffixes}
-      DOC "ICU ${component} library (release)")
+      DOC "ICU ${component} library (release)"
+      NO_PACKAGE_ROOT_PATH
+      )
     find_library("${component_cache_debug}" ${component_debug_libnames}
       HINTS ${icu_roots}
       PATH_SUFFIXES ${icu_library_suffixes}
-      DOC "ICU ${component} library (debug)")
+      DOC "ICU ${component} library (debug)"
+      NO_PACKAGE_ROOT_PATH
+      )
     include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
     select_library_configurations(ICU_${component_upcase})
     mark_as_advanced("${component_cache_release}" "${component_cache_debug}")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de13c55d74e0e95aa3799ba132db668212721776
commit de13c55d74e0e95aa3799ba132db668212721776
Author:     Saleem Abdulrasool <compnerd at compnerd.org>
AuthorDate: Wed Jan 16 11:42:10 2019 -0800
Commit:     Saleem Abdulrasool <compnerd at compnerd.org>
CommitDate: Wed Jan 23 21:21:07 2019 -0800

    Ninja: support `SWIFT_MODULE_NAME` property
    
    Add a new `SWIFT_MODULE_NAME` property that defaults to the target name.
    This can be adjusted via `set_target_properties`.  This is needed as
    otherwise, the first source file determines the module name.
    
    Issue: #18800

diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index c959a04..edb0ef3 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -919,7 +919,12 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
     }
     vars["SWIFT_AUXILIARY_SOURCES"] = aux_sources;
 
-    vars["SWIFT_MODULE_NAME"] = this->GeneratorTarget->GetName();
+    if (const char* name =
+          this->GeneratorTarget->GetProperty("SWIFT_MODULE_NAME")) {
+      vars["SWIFT_MODULE_NAME"] = name;
+    } else {
+      vars["SWIFT_MODULE_NAME"] = this->GeneratorTarget->GetName();
+    }
   }
 
   if (!this->NeedDepTypeMSVC(language)) {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c3203bf31637a960d1bf579fb7092a1ae850cdb5
commit c3203bf31637a960d1bf579fb7092a1ae850cdb5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 23 13:20:14 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 23 13:20:14 2019 -0500

    Silence -Wcomma warning
    
    We use a comma-in-paren expression to evaluate multiple statements
    in a condition.  Clang warns that this may be incorrect.  Follow
    its suggestion to cast all but the last expression to `void` to
    silence the warning.

diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index ff793f6..cc2c09f 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -193,8 +193,9 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
   unsigned long lastLine;
   unsigned long parenDepth = 0;
   this->Separation = SeparationOkay;
-  while ((lastLine = cmListFileLexer_GetCurrentLine(this->Lexer),
-          token = cmListFileLexer_Scan(this->Lexer))) {
+  while (
+    (static_cast<void>(lastLine = cmListFileLexer_GetCurrentLine(this->Lexer)),
+     token = cmListFileLexer_Scan(this->Lexer))) {
     if (token->type == cmListFileLexer_Token_Space ||
         token->type == cmListFileLexer_Token_Newline) {
       this->Separation = SeparationOkay;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68eabb357616f7ef469b20dd8d9cb8ce588e113d
commit 68eabb357616f7ef469b20dd8d9cb8ce588e113d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 23 13:17:22 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 23 13:17:22 2019 -0500

    Avoid -Wstring-plus-int warning
    
    In `cmState::GetGlobalProperty` we use a macro to produce a string of
    the form ";a;b;c" and want to return "a;b;c" by skipping the leading
    ";".  Switch from pointer arithmetic to indexing+addressing to silence
    the "warning: adding 'int' to a string does not append to the string"
    diagnostic from Clang.

diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index d4d3df5..fdd7b3d 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -545,10 +545,10 @@ const char* cmState::GetGlobalProperty(const std::string& prop)
   }
 #define STRING_LIST_ELEMENT(F) ";" #F
   if (prop == "CMAKE_C_KNOWN_FEATURES") {
-    return FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT) + 1;
+    return &FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT)[1];
   }
   if (prop == "CMAKE_CXX_KNOWN_FEATURES") {
-    return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1;
+    return &FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT)[1];
   }
 #undef STRING_LIST_ELEMENT
   return this->GlobalProperties.GetPropertyValue(prop);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6982cff0d3910723ad4fd40b9c63cf77c872d30
commit a6982cff0d3910723ad4fd40b9c63cf77c872d30
Author:     Kyle Edwards <kyle.edwards at kitware.com>
AuthorDate: Fri Dec 14 17:24:52 2018 -0500
Commit:     Kyle Edwards <kyle.edwards at kitware.com>
CommitDate: Wed Jan 23 09:52:29 2019 -0500

    cmMakefile: Impose maximum recursion limit
    
    In order to keep infinitely-recursive scripts from causing a stack
    overflow in the CMake executable, CMake now imposes a maximum
    recursion limit before issuing an error message. The limit can be
    adjusted at runtime with CMAKE_MAXIMUM_RECURSION_DEPTH.
    
    Fixes: #18694

diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index bd6a58f..de4ce3d 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -190,6 +190,7 @@ Variables that Change Behavior
    /variable/CMAKE_LIBRARY_PATH
    /variable/CMAKE_LINK_DIRECTORIES_BEFORE
    /variable/CMAKE_MFC_FLAG
+   /variable/CMAKE_MAXIMUM_RECURSION_DEPTH
    /variable/CMAKE_MODULE_PATH
    /variable/CMAKE_NOT_USING_CONFIG_FLAGS
    /variable/CMAKE_POLICY_DEFAULT_CMPNNNN
diff --git a/Help/release/dev/max-recursion-depth.rst b/Help/release/dev/max-recursion-depth.rst
new file mode 100644
index 0000000..3d9c781
--- /dev/null
+++ b/Help/release/dev/max-recursion-depth.rst
@@ -0,0 +1,6 @@
+max-recursion-depth
+-------------------
+
+* CMake now imposes a maximum recursion limit to prevent a stack overflow on
+  scripts that recurse infinitely. The limit can be adjusted at runtime with
+  :variable:`CMAKE_MAXIMUM_RECURSION_DEPTH`.
diff --git a/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst b/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
new file mode 100644
index 0000000..7110b16
--- /dev/null
+++ b/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
@@ -0,0 +1,33 @@
+CMAKE_MAXIMUM_RECURSION_DEPTH
+-----------------------------
+
+Maximum recursion depth for CMake scripts. It is intended to be set on the
+command line with ``-DCMAKE_MAXIMUM_RECURSION_DEPTH=<x>``, or within
+``CMakeLists.txt`` by projects that require a large recursion depth. Projects
+that set this variable should provide the user with a way to override it. For
+example:
+
+.. code-block:: cmake
+
+  # About to perform deeply recursive actions
+  if(NOT CMAKE_MAXIMUM_RECURSION_DEPTH)
+    set(CMAKE_MAXIMUM_RECURSION_DEPTH 2000)
+  endif()
+
+If it is not set, or is set to a non-integer value, a sensible default limit is
+used. If the recursion limit is reached, the script terminates immediately with
+a fatal error.
+
+Calling any of the following commands increases the recursion depth:
+
+* :command:`include`
+* :command:`find_package`
+* :command:`add_subdirectory`
+* :command:`try_compile`
+* :command:`ctest_read_custom_files`
+* :command:`ctest_run_script` (unless ``NEW_PROCESS`` is specified)
+* User-defined :command:`function`'s and :command:`macro`'s (note that
+  :command:`function` and :command:`macro` themselves don't increase recursion
+  depth)
+* Reading or writing variables that are being watched by a
+  :command:`variable_watch`
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 9e753e6..c73c6df 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -31,6 +31,16 @@ else()
   set(CMAKE_USE_ELF_PARSER)
 endif()
 
+if(NOT CMake_DEFAULT_RECURSION_LIMIT)
+  if(DEFINED ENV{DASHBOARD_TEST_FROM_CTEST})
+    set(CMake_DEFAULT_RECURSION_LIMIT 100)
+  elseif(MINGW)
+    set(CMake_DEFAULT_RECURSION_LIMIT 400)
+  else()
+    set(CMake_DEFAULT_RECURSION_LIMIT 1000)
+  endif()
+endif()
+
 if(APPLE)
   set(CMAKE_USE_MACH_PARSER 1)
 endif()
diff --git a/Source/CTest/cmCTestRunScriptCommand.cxx b/Source/CTest/cmCTestRunScriptCommand.cxx
index 238284a..a7e47d3 100644
--- a/Source/CTest/cmCTestRunScriptCommand.cxx
+++ b/Source/CTest/cmCTestRunScriptCommand.cxx
@@ -39,7 +39,8 @@ bool cmCTestRunScriptCommand::InitialPass(std::vector<std::string> const& args,
       ++i;
     } else {
       int ret;
-      cmCTestScriptHandler::RunScript(this->CTest, args[i].c_str(), !np, &ret);
+      cmCTestScriptHandler::RunScript(this->CTest, this->Makefile,
+                                      args[i].c_str(), !np, &ret);
       std::ostringstream str;
       str << ret;
       this->Makefile->AddDefinition(returnVariable, str.str().c_str());
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index f417f53..b949023 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -78,6 +78,7 @@ cmCTestScriptHandler::cmCTestScriptHandler()
   this->EmptyBinDir = false;
   this->EmptyBinDirOnce = false;
   this->Makefile = nullptr;
+  this->ParentMakefile = nullptr;
   this->CMake = nullptr;
   this->GlobalGenerator = nullptr;
 
@@ -117,6 +118,7 @@ void cmCTestScriptHandler::Initialize()
 
   delete this->Makefile;
   this->Makefile = nullptr;
+  this->ParentMakefile = nullptr;
 
   delete this->GlobalGenerator;
   this->GlobalGenerator = nullptr;
@@ -292,6 +294,10 @@ void cmCTestScriptHandler::CreateCMake()
   snapshot.GetDirectory().SetCurrentSource(cwd);
   snapshot.GetDirectory().SetCurrentBinary(cwd);
   this->Makefile = new cmMakefile(this->GlobalGenerator, snapshot);
+  if (this->ParentMakefile) {
+    this->Makefile->SetRecursionDepth(
+      this->ParentMakefile->GetRecursionDepth());
+  }
 
   this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest);
 
@@ -891,11 +897,13 @@ void cmCTestScriptHandler::RestoreBackupDirectories()
   }
 }
 
-bool cmCTestScriptHandler::RunScript(cmCTest* ctest, const char* sname,
-                                     bool InProcess, int* returnValue)
+bool cmCTestScriptHandler::RunScript(cmCTest* ctest, cmMakefile* mf,
+                                     const char* sname, bool InProcess,
+                                     int* returnValue)
 {
   cmCTestScriptHandler* sh = new cmCTestScriptHandler();
   sh->SetCTestInstance(ctest);
+  sh->ParentMakefile = mf;
   sh->AddConfigurationScript(sname, InProcess);
   int res = sh->ProcessHandler();
   if (returnValue) {
diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h
index cf0762e..d93b5f8 100644
--- a/Source/CTest/cmCTestScriptHandler.h
+++ b/Source/CTest/cmCTestScriptHandler.h
@@ -72,8 +72,8 @@ public:
   /*
    * Run a script
    */
-  static bool RunScript(cmCTest* ctest, const char* script, bool InProcess,
-                        int* returnValue);
+  static bool RunScript(cmCTest* ctest, cmMakefile* mf, const char* script,
+                        bool InProcess, int* returnValue);
   int RunCurrentScript();
 
   /*
@@ -166,6 +166,7 @@ private:
   std::chrono::steady_clock::time_point ScriptStartTime;
 
   cmMakefile* Makefile;
+  cmMakefile* ParentMakefile;
   cmGlobalGenerator* GlobalGenerator;
   cmake* CMake;
 };
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index c80439b..9d00c21 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -20,6 +20,7 @@
 #cmakedefine CMAKE_USE_ELF_PARSER
 #cmakedefine CMAKE_USE_MACH_PARSER
 #cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
+#define CMake_DEFAULT_RECURSION_LIMIT @CMake_DEFAULT_RECURSION_LIMIT@
 #define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
 #define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
 
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index b2b0e38..acd666f 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -98,6 +98,8 @@ cmGlobalGenerator::cmGlobalGenerator(cmake* cm)
   this->ConfigureDoneCMP0026AndCMP0024 = false;
   this->FirstTimeProgress = 0.0f;
 
+  this->RecursionDepth = 0;
+
   cm->GetState()->SetIsGeneratorMultiConfig(false);
   cm->GetState()->SetMinGWMake(false);
   cm->GetState()->SetMSYSShell(false);
@@ -1166,6 +1168,7 @@ void cmGlobalGenerator::Configure()
     this->CMakeInstance->GetHomeOutputDirectory());
 
   cmMakefile* dirMf = new cmMakefile(this, snapshot);
+  dirMf->SetRecursionDepth(this->RecursionDepth);
   this->Makefiles.push_back(dirMf);
   this->IndexMakefile(dirMf);
 
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 36d3d10..fa16180 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -432,6 +432,8 @@ public:
 
   std::string MakeSilentFlag;
 
+  int RecursionDepth;
+
 protected:
   typedef std::vector<cmLocalGenerator*> GeneratorVector;
   // for a project collect all its targets by following depend
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 500776e..ca5047a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -45,6 +45,8 @@
 #include "cm_sys_stat.h"
 #include "cmake.h"
 
+#include "cmConfigure.h" // IWYU pragma: keep
+
 #ifdef CMAKE_BUILD_WITH_CMAKE
 #  include "cmVariableWatch.h"
 #endif
@@ -83,6 +85,7 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
   this->StateSnapshot =
     this->StateSnapshot.GetState()->CreatePolicyScopeSnapshot(
       this->StateSnapshot);
+  this->RecursionDepth = 0;
 
   // Enter a policy level for this directory.
   this->PushPolicy();
@@ -333,12 +336,14 @@ public:
     cmListFileContext const& lfc = cmListFileContext::FromCommandContext(
       cc, this->Makefile->StateSnapshot.GetExecutionListFile());
     this->Makefile->Backtrace = this->Makefile->Backtrace.Push(lfc);
+    ++this->Makefile->RecursionDepth;
     this->Makefile->ExecutionStatusStack.push_back(&status);
   }
 
   ~cmMakefileCall()
   {
     this->Makefile->ExecutionStatusStack.pop_back();
+    --this->Makefile->RecursionDepth;
     this->Makefile->Backtrace = this->Makefile->Backtrace.Pop();
   }
 
@@ -361,6 +366,24 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
   cmMakefileCall stack_manager(this, lff, status);
   static_cast<void>(stack_manager);
 
+  // Check for maximum recursion depth.
+  int depth = CMake_DEFAULT_RECURSION_LIMIT;
+  const char* depthStr = this->GetDefinition("CMAKE_MAXIMUM_RECURSION_DEPTH");
+  if (depthStr) {
+    std::istringstream s(depthStr);
+    int d;
+    if (s >> d) {
+      depth = d;
+    }
+  }
+  if (this->RecursionDepth > depth) {
+    std::ostringstream e;
+    e << "Maximum recursion depth of " << depth << " exceeded";
+    this->IssueMessage(MessageType::FATAL_ERROR, e.str());
+    cmSystemTools::SetFatalErrorOccured();
+    return false;
+  }
+
   // Lookup the command prototype.
   if (cmCommand* proto =
         this->GetState()->GetCommandByExactName(lff.Name.Lower)) {
@@ -1369,6 +1392,9 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent)
 
   // Imported targets.
   this->ImportedTargets = parent->ImportedTargets;
+
+  // Recursion depth.
+  this->RecursionDepth = parent->RecursionDepth;
 }
 
 void cmMakefile::PushFunctionScope(std::string const& fileName,
@@ -2725,6 +2751,16 @@ bool cmMakefile::IsProjectFile(const char* filename) const
                                     cmake::GetCMakeFilesDirectory()));
 }
 
+int cmMakefile::GetRecursionDepth() const
+{
+  return this->RecursionDepth;
+}
+
+void cmMakefile::SetRecursionDepth(int recursionDepth)
+{
+  this->RecursionDepth = recursionDepth;
+}
+
 MessageType cmMakefile::ExpandVariablesInStringNew(
   std::string& errorstr, std::string& source, bool escapeQuotes,
   bool noEscapes, bool atOnly, const char* filename, long line,
@@ -3388,6 +3424,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
     this->IsSourceFileTryCompile = false;
     return 1;
   }
+  gg->RecursionDepth = this->RecursionDepth;
   cm.SetGlobalGenerator(gg);
 
   // do a configure
@@ -3407,6 +3444,12 @@ int cmMakefile::TryCompile(const std::string& srcdir,
                        cmStateEnums::STRING);
     }
   }
+  const char* recursionDepth =
+    this->GetDefinition("CMAKE_MAXIMUM_RECURSION_DEPTH");
+  if (recursionDepth) {
+    cm.AddCacheEntry("CMAKE_MAXIMUM_RECURSION_DEPTH", recursionDepth,
+                     "Maximum recursion depth", cmStateEnums::STRING);
+  }
   // if cmake args were provided then pass them in
   if (cmakeArgs) {
     // FIXME: Workaround to ignore unused CLI variables in try-compile.
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index e88bb0b..2bd44e2 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -870,6 +870,9 @@ public:
                               const char* sourceFilename) const;
   bool IsProjectFile(const char* filename) const;
 
+  int GetRecursionDepth() const;
+  void SetRecursionDepth(int recursionDepth);
+
 protected:
   // add link libraries and directories to the target
   void AddGlobalLinkInformation(cmTarget& target);
@@ -930,6 +933,7 @@ protected:
 private:
   cmStateSnapshot StateSnapshot;
   cmListFileBacktrace Backtrace;
+  int RecursionDepth;
 
   void ReadListFile(cmListFile const& listFile,
                     const std::string& filenametoread);
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index bf18efe..e6c90b4 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -215,6 +215,7 @@ endif()
 add_RunCMake_test(CompatibleInterface)
 add_RunCMake_test(Syntax)
 add_RunCMake_test(WorkingDirectory)
+add_RunCMake_test(MaxRecursionDepth)
 
 add_RunCMake_test(add_custom_command)
 add_RunCMake_test(add_custom_target)
diff --git a/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt b/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt
new file mode 100644
index 0000000..d2cd86d
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.13)
+if(DEFINED CMAKE_GENERATOR)
+  project(${RunCMake_TEST} NONE)
+endif()
+include("${CMAKE_CURRENT_LIST_DIR}/${TEST_NAME}.cmake")
diff --git a/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt.in b/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt.in
new file mode 100644
index 0000000..fee3eda
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt.in
@@ -0,0 +1,2 @@
+cmake_minimum_required(VERSION 3.12)
+project(MaxRecursionDepth NONE)
diff --git a/Tests/RunCMake/MaxRecursionDepth/CTestCustom.cmake b/Tests/RunCMake/MaxRecursionDepth/CTestCustom.cmake
new file mode 100644
index 0000000..354bc7a
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/CTestCustom.cmake
@@ -0,0 +1,3 @@
+message("${x}")
+math(EXPR x "${x} + 1")
+ctest_read_custom_files("${CMAKE_CURRENT_LIST_DIR}")
diff --git a/Tests/RunCMake/MaxRecursionDepth/FindRecursivePackage.cmake b/Tests/RunCMake/MaxRecursionDepth/FindRecursivePackage.cmake
new file mode 100644
index 0000000..3cbb99e
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/FindRecursivePackage.cmake
@@ -0,0 +1,3 @@
+message("${x}")
+math(EXPR x "${x} + 1")
+find_package(RecursivePackage)
diff --git a/Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake b/Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake
new file mode 100644
index 0000000..c5a859d
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake
@@ -0,0 +1,49 @@
+include(RunCMake)
+include(RunCTest)
+
+function(run_cmake_recursive name)
+  set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
+  run_cmake(${name}-default)
+  unset(RunCMake_TEST_OPTIONS)
+  set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
+  run_cmake(${name}-var)
+  unset(RunCMake_TEST_OPTIONS)
+  set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a)
+  run_cmake(${name}-invalid-var)
+  unset(RunCMake_TEST_OPTIONS)
+
+  run_cmake_command(${name}-default-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
+  run_cmake_command(${name}-var-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10 -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
+  run_cmake_command(${name}-invalid-var-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
+endfunction()
+
+function(run_ctest_recursive name)
+  run_ctest(${name}-default "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
+  run_ctest(${name}-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
+  run_ctest(${name}-invalid-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a)
+endfunction()
+
+run_cmake_recursive(function)
+run_cmake_recursive(macro)
+run_cmake_recursive(include)
+run_cmake_recursive(find_package)
+run_cmake_recursive(variable_watch)
+
+# We run these tests separately and only with a small limit because they are
+# taxing and slow. The "implicit" and "invalid" cases are already thoroughly
+# covered by the other tests above.
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=add_subdirectory -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
+run_cmake(add_subdirectory-var)
+unset(RunCMake_TEST_OPTIONS)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=try_compile -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
+run_cmake(try_compile-var)
+unset(RunCMake_TEST_OPTIONS)
+
+run_ctest_recursive(ctest_read_custom_files)
+
+# We run the ctest_run_script() test separately and only with an explicit limit
+# because ctest_run_script() is taxing and slow, and because the implicit
+# recursion limit is hit by CTestScriptMode.cmake before we can test it
+# properly. The "implicit" and "invalid" cases are already thoroughly covered
+# by the other tests above.
+run_ctest(ctest_run_script-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=ctest_run_script -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
diff --git a/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-stderr.txt
new file mode 100644
index 0000000..23fb5c6
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-stderr.txt
@@ -0,0 +1,10 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at add_subdirectory/CMakeLists\.txt:1 \(message\):
+  Maximum recursion depth of 10 exceeded$
diff --git a/Tests/RunCMake/MaxRecursionDepth/add_subdirectory.cmake b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory.cmake
new file mode 100644
index 0000000..36c21f3
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory.cmake
@@ -0,0 +1,2 @@
+set(x 3)
+add_subdirectory(add_subdirectory)
diff --git a/Tests/RunCMake/MaxRecursionDepth/add_subdirectory/CMakeLists.txt b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory/CMakeLists.txt
new file mode 100644
index 0000000..a8244af
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory/CMakeLists.txt
@@ -0,0 +1,3 @@
+message("${x}")
+math(EXPR x "${x} + 1")
+add_subdirectory(. dir)
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-result.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-stderr.txt
new file mode 100644
index 0000000..7dbbb3e
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-stderr.txt
new file mode 100644
index 0000000..7dbbb3e
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-stderr.txt
new file mode 100644
index 0000000..bc89703
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-stderr.txt
@@ -0,0 +1,34 @@
+^2
+3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:1 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+  .*/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var/test\.cmake:10 \(ctest_read_custom_files\)
+
+
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake$
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-stderr.txt
new file mode 100644
index 0000000..b10b26d
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-stderr.txt
@@ -0,0 +1,51 @@
+^2
+3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_11\.cmake:1 \(cmake_minimum_required\):
+  Maximum recursion depth of 10 exceeded
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_10\.cmake:13 \(message\):
+  Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_9\.cmake:13 \(message\):
+  Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_8\.cmake:13 \(message\):
+  Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_7\.cmake:13 \(message\):
+  Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_6\.cmake:13 \(message\):
+  Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_5\.cmake:13 \(message\):
+  Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_4\.cmake:13 \(message\):
+  Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_3\.cmake:13 \(message\):
+  Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_2\.cmake:13 \(message\):
+  Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var/test\.cmake:19 \(message\):
+  Nested script failed$
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_run_script.cmake.in b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script.cmake.in
new file mode 100644
index 0000000..d4f28c4
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script.cmake.in
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.12)
+set(CTEST_RUN_CURRENT_SCRIPT 0)
+
+message("@LEVEL_CURRENT@")
+
+set(CTEST_SOURCE_DIRECTORY "@CTEST_SOURCE_DIRECTORY@")
+set(CTEST_BINARY_DIRECTORY "@CTEST_BINARY_DIRECTORY@")
+set(CTEST_COMMAND "@CTEST_COMMAND@")
+
+ctest_run_script("${CMAKE_CURRENT_LIST_DIR}/ctest_run_script_ at LEVEL_NEXT@.cmake" RETURN_VALUE val)
+
+if(NOT val EQUAL 0)
+  message(FATAL_ERROR "Nested script failed")
+endif()
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-default-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-default-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-default-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-stderr.txt
new file mode 100644
index 0000000..b8557ab
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/FindRecursivePackage\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-default-stderr.txt
new file mode 100644
index 0000000..5d31e29
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-default-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at FindRecursivePackage\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  FindRecursivePackage\.cmake:3 \(find_package\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-stderr.txt
new file mode 100644
index 0000000..b8557ab
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/FindRecursivePackage\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-stderr.txt
new file mode 100644
index 0000000..5d31e29
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at FindRecursivePackage\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  FindRecursivePackage\.cmake:3 \(find_package\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-stderr.txt
new file mode 100644
index 0000000..5314551
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/FindRecursivePackage\.cmake:1 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/FindRecursivePackage\.cmake:3 \(find_package\)
+  .*/find_package\.cmake:2 \(find_package\)
+  .*/CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-var-stderr.txt
new file mode 100644
index 0000000..b47a13a
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-var-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at FindRecursivePackage\.cmake:1 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  FindRecursivePackage\.cmake:3 \(find_package\)
+  find_package\.cmake:2 \(find_package\)
+  CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package.cmake b/Tests/RunCMake/MaxRecursionDepth/find_package.cmake
new file mode 100644
index 0000000..a235f7d
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package.cmake
@@ -0,0 +1,2 @@
+set(x 3)
+find_package(RecursivePackage)
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-default-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-default-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-default-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-default-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-default-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-default-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-default-script-stderr.txt
new file mode 100644
index 0000000..92de1fb
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-default-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/function\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/function\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-default-stderr.txt
new file mode 100644
index 0000000..5c25c4b
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-default-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at function\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  function\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-stderr.txt
new file mode 100644
index 0000000..92de1fb
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/function\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/function\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-stderr.txt
new file mode 100644
index 0000000..5c25c4b
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at function\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  function\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-var-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-var-script-stderr.txt
new file mode 100644
index 0000000..61304b1
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-var-script-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/function\.cmake:2 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:4 \(recursive\)
+  .*/function\.cmake:7 \(recursive\)
+  .*/CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-var-stderr.txt
new file mode 100644
index 0000000..54e72af
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-var-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at function\.cmake:2 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:4 \(recursive\)
+  function\.cmake:7 \(recursive\)
+  CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/function.cmake b/Tests/RunCMake/MaxRecursionDepth/function.cmake
new file mode 100644
index 0000000..581cb89
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function.cmake
@@ -0,0 +1,7 @@
+function(recursive x)
+  message("${x}")
+  math(EXPR y "${x} + 1")
+  recursive(${y})
+endfunction()
+
+recursive(3)
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-default-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-default-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-default-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-default-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-default-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-default-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-default-script-stderr.txt
new file mode 100644
index 0000000..0510e7c
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-default-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/include_recursive\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/include_recursive\.cmake:3 \(include\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-default-stderr.txt
new file mode 100644
index 0000000..b1494a8
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-default-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at include_recursive\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  include_recursive\.cmake:3 \(include\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-stderr.txt
new file mode 100644
index 0000000..0510e7c
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/include_recursive\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/include_recursive\.cmake:3 \(include\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-stderr.txt
new file mode 100644
index 0000000..b1494a8
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at include_recursive\.cmake:1 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  include_recursive\.cmake:3 \(include\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-var-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-var-script-stderr.txt
new file mode 100644
index 0000000..f55f505
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-var-script-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/include_recursive\.cmake:1 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include_recursive\.cmake:3 \(include\)
+  .*/include\.cmake:2 \(include\)
+  .*/CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-var-stderr.txt
new file mode 100644
index 0000000..ff33985
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-var-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at include_recursive\.cmake:1 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include_recursive\.cmake:3 \(include\)
+  include\.cmake:2 \(include\)
+  CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/include.cmake b/Tests/RunCMake/MaxRecursionDepth/include.cmake
new file mode 100644
index 0000000..5e86a40
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include.cmake
@@ -0,0 +1,2 @@
+set(x 3)
+include("${CMAKE_CURRENT_LIST_DIR}/include_recursive.cmake")
diff --git a/Tests/RunCMake/MaxRecursionDepth/include_recursive.cmake b/Tests/RunCMake/MaxRecursionDepth/include_recursive.cmake
new file mode 100644
index 0000000..b3f744e
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include_recursive.cmake
@@ -0,0 +1,3 @@
+message("${x}")
+math(EXPR x "${x} + 1")
+include("${CMAKE_CURRENT_LIST_FILE}")
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-default-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-default-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-default-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-default-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-default-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-default-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-default-script-stderr.txt
new file mode 100644
index 0000000..c67be57
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-default-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/macro\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/macro\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-default-stderr.txt
new file mode 100644
index 0000000..0b27162
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-default-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at macro\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  macro\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-stderr.txt
new file mode 100644
index 0000000..c67be57
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/macro\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/macro\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-stderr.txt
new file mode 100644
index 0000000..0b27162
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at macro\.cmake:2 \(message\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  macro\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-var-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-var-script-stderr.txt
new file mode 100644
index 0000000..142e068
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-var-script-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/macro\.cmake:2 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:4 \(recursive\)
+  .*/macro\.cmake:7 \(recursive\)
+  .*/CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-var-stderr.txt
new file mode 100644
index 0000000..71de553
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-var-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at macro\.cmake:2 \(message\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:4 \(recursive\)
+  macro\.cmake:7 \(recursive\)
+  CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro.cmake b/Tests/RunCMake/MaxRecursionDepth/macro.cmake
new file mode 100644
index 0000000..a7cbfc2
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro.cmake
@@ -0,0 +1,7 @@
+macro(recursive x)
+  message("${x}")
+  math(EXPR y "${x} + 1")
+  recursive(${y})
+endmacro()
+
+recursive(3)
diff --git a/Tests/RunCMake/MaxRecursionDepth/test.cmake.in b/Tests/RunCMake/MaxRecursionDepth/test.cmake.in
new file mode 100644
index 0000000..fd1fc10
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/test.cmake.in
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 3.12)
+set(CTEST_RUN_CURRENT_SCRIPT 0)
+
+set(CTEST_SOURCE_DIRECTORY "@RunCMake_SOURCE_DIR@")
+set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@")
+set(CTEST_COMMAND "${CMAKE_CTEST_COMMAND}")
+
+if(TEST_NAME STREQUAL "ctest_read_custom_files")
+  set(x 2)
+  ctest_read_custom_files("@RunCMake_SOURCE_DIR@")
+elseif(TEST_NAME STREQUAL "ctest_run_script")
+  foreach(LEVEL_CURRENT RANGE 2 15)
+    math(EXPR LEVEL_NEXT "${LEVEL_CURRENT} + 1")
+    configure_file("@RunCMake_SOURCE_DIR@/ctest_run_script.cmake.in" "@RunCMake_BINARY_DIR@/ctest_run_script_${LEVEL_CURRENT}.cmake" @ONLY)
+  endforeach()
+
+  ctest_run_script("@RunCMake_BINARY_DIR@/ctest_run_script_2.cmake" RETURN_VALUE val)
+  if(NOT val EQUAL 0)
+    message(FATAL_ERROR "Nested script failed")
+  endif()
+endif()
diff --git a/Tests/RunCMake/MaxRecursionDepth/try_compile-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/try_compile-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/try_compile-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/try_compile-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/try_compile-var-stderr.txt
new file mode 100644
index 0000000..130db34
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/try_compile-var-stderr.txt
@@ -0,0 +1,48 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:1 \(cmake_minimum_required\):
+  Maximum recursion depth of 10 exceeded
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+  Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+  Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+  Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+  Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+  Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+  Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+  Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+  Failed to configure test project build system\.
+
+
+CMake Error at try_compile\.cmake:1 \(try_compile\):
+  Failed to configure test project build system\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/try_compile.cmake b/Tests/RunCMake/MaxRecursionDepth/try_compile.cmake
new file mode 100644
index 0000000..c40fb06
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/try_compile.cmake
@@ -0,0 +1,6 @@
+try_compile(result
+  "${CMAKE_CURRENT_BINARY_DIR}/try_compile"
+  "${CMAKE_CURRENT_SOURCE_DIR}/try_compile"
+  try_compile
+  CMAKE_FLAGS -Dx:STRING=3
+  )
diff --git a/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists.txt b/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists.txt
new file mode 100644
index 0000000..2271090
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.12)
+
+message("${x}")
+math(EXPR x "${x} + 1")
+try_compile(result
+  "${CMAKE_CURRENT_BINARY_DIR}/try_compile"
+  "${CMAKE_CURRENT_SOURCE_DIR}"
+  try_compile
+  CMAKE_FLAGS -Dx:STRING=${x}
+  )
+
+# We put this last to avoid prematurely triggering the recursion limit
+project(try_compile NONE)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
new file mode 100644
index 0000000..4dddc96
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
@@ -0,0 +1,6 @@
+[0-9]+
+CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/variable_watch\.cmake:5 \(set\)
+  .*/variable_watch\.cmake:9999 \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
new file mode 100644
index 0000000..a8b4756
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
@@ -0,0 +1,6 @@
+[0-9]+
+CMake Error at variable_watch\.cmake:9999 \(update_x\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  variable_watch\.cmake:5 \(set\)
+  variable_watch\.cmake:9999 \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
new file mode 100644
index 0000000..4dddc96
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
@@ -0,0 +1,6 @@
+[0-9]+
+CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  .*/variable_watch\.cmake:5 \(set\)
+  .*/variable_watch\.cmake:9999 \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
new file mode 100644
index 0000000..a8b4756
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
@@ -0,0 +1,6 @@
+[0-9]+
+CMake Error at variable_watch\.cmake:9999 \(update_x\):
+  Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+  variable_watch\.cmake:5 \(set\)
+  variable_watch\.cmake:9999 \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
new file mode 100644
index 0000000..00b2b3c
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
@@ -0,0 +1,22 @@
+^4
+6
+8
+10
+CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  .*/variable_watch\.cmake:5 \(set\)
+  .*/variable_watch\.cmake:9999 \(update_x\)
+  .*/variable_watch\.cmake:5 \(set\)
+  .*/variable_watch\.cmake:9999 \(update_x\)
+  .*/variable_watch\.cmake:5 \(set\)
+  .*/variable_watch\.cmake:9999 \(update_x\)
+  .*/variable_watch\.cmake:5 \(set\)
+  .*/variable_watch\.cmake:9999 \(update_x\)
+  .*/variable_watch\.cmake:9 \(set\)
+  .*/CMakeLists\.txt:5 \(include\)
+
+
+CMake Error: Error in cmake code at
+Unknown:0:
+A command failed during the invocation of callback "update_x"\.$
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
new file mode 100644
index 0000000..8f27bf1
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
@@ -0,0 +1,22 @@
+^4
+6
+8
+10
+CMake Error at variable_watch\.cmake:9999 \(update_x\):
+  Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+  variable_watch\.cmake:5 \(set\)
+  variable_watch\.cmake:9999 \(update_x\)
+  variable_watch\.cmake:5 \(set\)
+  variable_watch\.cmake:9999 \(update_x\)
+  variable_watch\.cmake:5 \(set\)
+  variable_watch\.cmake:9999 \(update_x\)
+  variable_watch\.cmake:5 \(set\)
+  variable_watch\.cmake:9999 \(update_x\)
+  variable_watch\.cmake:9 \(set\)
+  CMakeLists\.txt:5 \(include\)
+
+
+CMake Error: Error in cmake code at
+Unknown:0:
+A command failed during the invocation of callback "update_x"\.$
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake b/Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake
new file mode 100644
index 0000000..b3c7b8d
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake
@@ -0,0 +1,9 @@
+function(update_x)
+  message("${x}")
+  math(EXPR y "${x} + 2")
+  variable_watch(x update_x)
+  set(x "${y}")
+endfunction()
+
+variable_watch(x update_x)
+set(x 4)
diff --git a/bootstrap b/bootstrap
index 901bc10..f185ea8 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1312,6 +1312,7 @@ cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_PATCH ${cmake_versi
 cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION \"${cmake_version}\""
 cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_SOURCE_DIR \"${CMAKE_BOOTSTRAP_SOURCE_DIR}\""
 cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_BOOTSTRAP_BINARY_DIR}\""
+cmake_report cmConfigure.h${_tmp} "#define CMake_DEFAULT_RECURSION_LIMIT 400"
 cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
 cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
 cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc6888573da15cd7ddb9f91b70ef3e6c4e7cae15
commit dc6888573da15cd7ddb9f91b70ef3e6c4e7cae15
Author:     Zack Galbreath <zack.galbreath at kitware.com>
AuthorDate: Tue Jan 15 17:26:02 2019 -0600
Commit:     Zack Galbreath <zack.galbreath at kitware.com>
CommitDate: Mon Jan 21 11:38:24 2019 -0500

    Pass EXCLUDE_FROM_ALL from directory to targets
    
    When a target is created it now inherits the EXCLUDE_FROM_ALL property
    from its directory. This change makes it possible to include a target
    in "all", even if its directory has been marked as EXCLUDE_FROM_ALL.

diff --git a/Help/prop_dir/EXCLUDE_FROM_ALL.rst b/Help/prop_dir/EXCLUDE_FROM_ALL.rst
index 1aa24e4..9d3192c 100644
--- a/Help/prop_dir/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_dir/EXCLUDE_FROM_ALL.rst
@@ -7,3 +7,9 @@ A property on a directory that indicates if its targets are excluded
 from the default build target.  If it is not, then with a Makefile for
 example typing make will cause the targets to be built.  The same
 concept applies to the default build of other generators.
+
+Targets inherit the :prop_tgt:`EXCLUDE_FROM_ALL` property from the directory
+that they are created in. When a directory is excluded, all of its targets will
+have :prop_tgt:`EXCLUDE_FROM_ALL` set to ``TRUE``. After creating such a target
+you can change its :prop_tgt:`EXCLUDE_FROM_ALL` property to ``FALSE``. This
+will cause the target to be included in the default build target.
diff --git a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
index caa5741..e7457e1 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
@@ -8,3 +8,6 @@ the default build target.  If it is not, then with a Makefile for
 example typing make will cause this target to be built.  The same
 concept applies to the default build of other generators.  Installing
 a target with EXCLUDE_FROM_ALL set to true has undefined behavior.
+
+This property is enabled by default for targets that are created in
+directories that have :prop_dir:`EXCLUDE_FROM_ALL` set to ``TRUE``.
diff --git a/Help/release/dev/EXCLUDE_FROM_ALL.rst b/Help/release/dev/EXCLUDE_FROM_ALL.rst
new file mode 100644
index 0000000..519ac42
--- /dev/null
+++ b/Help/release/dev/EXCLUDE_FROM_ALL.rst
@@ -0,0 +1,7 @@
+EXCLUDE_FROM_ALL
+----------------
+
+* A target's :prop_tgt:`EXCLUDE_FROM_ALL` property can now override the
+  setting of its directory. A target will now be built as part of "all"
+  if its :prop_tgt:`EXCLUDE_FROM_ALL` property is set to ``OFF``, even if its
+  containing directory is marked as :prop_dir:`EXCLUDE_FROM_ALL`.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 85c2345..1973282 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2034,17 +2034,10 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
   return this->IsExcluded(rootSnp, snp);
 }
 
-bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
-                                   cmGeneratorTarget* target) const
+bool cmGlobalGenerator::IsExcluded(cmGeneratorTarget* target) const
 {
-  if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
-      target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
-    // This target is excluded from its directory.
-    return true;
-  }
-  // This target is included in its directory.  Check whether the
-  // directory is excluded.
-  return this->IsExcluded(root, target->GetLocalGenerator());
+  return target->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
+    target->GetPropertyAsBool("EXCLUDE_FROM_ALL");
 }
 
 void cmGlobalGenerator::GetEnabledLanguages(
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 36d3d10..c251800 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -468,7 +468,7 @@ protected:
   bool IsExcluded(cmStateSnapshot const& root,
                   cmStateSnapshot const& snp) const;
   bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) const;
-  bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) const;
+  bool IsExcluded(cmGeneratorTarget* target) const;
   virtual void InitializeProgressMarks() {}
 
   struct GlobalTargetInfo
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 00fa348..f1ab852 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -331,9 +331,9 @@ public:
     return LocalGenerators;
   }
 
-  bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target)
+  bool IsExcluded(cmGeneratorTarget* target)
   {
-    return cmGlobalGenerator::IsExcluded(root, target);
+    return cmGlobalGenerator::IsExcluded(target);
   }
 
   int GetRuleCmdLength(const std::string& name) { return RuleCmdLength[name]; }
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index ceee500..5e45ae1 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -702,7 +702,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
                         localName, depends, commands, true);
 
       // add the all/all dependency
-      if (!this->IsExcluded(this->LocalGenerators[0], gtarget)) {
+      if (!this->IsExcluded(gtarget)) {
         depends.clear();
         depends.push_back(localName);
         commands.clear();
@@ -767,7 +767,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
                           "Pre-install relink rule for target.", localName,
                           depends, commands, true);
 
-        if (!this->IsExcluded(this->LocalGenerators[0], gtarget)) {
+        if (!this->IsExcluded(gtarget)) {
           depends.clear();
           depends.push_back(localName);
           commands.clear();
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 41d961c..cbea3dd 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -201,7 +201,7 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
               tgt->IsImported()) {
             continue;
           }
-          if (!this->IsExcluded(gen[0], tgt)) {
+          if (!this->IsExcluded(tgt)) {
             allBuild->AddUtility(tgt->GetName());
           }
         }
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 6618351..2cc3d41 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -522,10 +522,6 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
   // now make the allbuild depend on all the non-utility targets
   // in the project
   for (auto& gen : gens) {
-    if (this->IsExcluded(root, gen)) {
-      continue;
-    }
-
     for (auto target : gen->GetGeneratorTargets()) {
       if (target->GetType() == cmStateEnums::GLOBAL_TARGET) {
         continue;
@@ -558,8 +554,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
           false, "", false, cmMakefile::AcceptObjectLibraryCommands);
       }
 
-      if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
-          !target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
+      if (!this->IsExcluded(target)) {
         allbuild->AddUtility(target->GetName());
       }
     }
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index a8647b1..66a770c 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -90,9 +90,7 @@ void cmLocalNinjaGenerator::Generate()
     if (tg) {
       tg->Generate();
       // Add the target to "all" if required.
-      if (!this->GetGlobalNinjaGenerator()->IsExcluded(
-            this->GetGlobalNinjaGenerator()->GetLocalGenerators()[0],
-            target)) {
+      if (!this->GetGlobalNinjaGenerator()->IsExcluded(target)) {
         this->GetGlobalNinjaGenerator()->AddDependencyToAll(target);
       }
       delete tg;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 274c631..a3762ce 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1127,7 +1127,7 @@ cmTarget* cmMakefile::AddUtilityCommand(
   // Create a target instance for this utility.
   cmTarget* target = this->AddNewTarget(cmStateEnums::UTILITY, utilityName);
   target->SetIsGeneratorProvided(origin == TargetOrigin::Generator);
-  if (excludeFromAll) {
+  if (excludeFromAll || this->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
     target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
   }
   if (!comment) {
@@ -1662,7 +1662,7 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
   cmMakefile* subMf = new cmMakefile(this->GlobalGenerator, newSnapshot);
   this->GetGlobalGenerator()->AddMakefile(subMf);
 
-  if (excludeFromAll) {
+  if (excludeFromAll || this->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
     subMf->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
   }
 
@@ -1958,7 +1958,7 @@ cmTarget* cmMakefile::AddLibrary(const std::string& lname,
   // over changes in CMakeLists.txt, making the information stale and
   // hence useless.
   target->ClearDependencyInformation(*this);
-  if (excludeFromAll) {
+  if (excludeFromAll || this->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
     target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
   }
   target->AddSources(srcs);
@@ -1971,7 +1971,7 @@ cmTarget* cmMakefile::AddExecutable(const std::string& exeName,
                                     bool excludeFromAll)
 {
   cmTarget* target = this->AddNewTarget(cmStateEnums::EXECUTABLE, exeName);
-  if (excludeFromAll) {
+  if (excludeFromAll || this->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
     target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
   }
   target->AddSources(srcs);
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
index b1df6b0..9e6462b 100644
--- a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
@@ -1,4 +1,20 @@
 add_library(bar STATIC bar.cpp)
 
 add_library(foo STATIC foo.cpp)
+
+add_library(baz STATIC foo.cpp)
+set_target_properties(baz PROPERTIES EXCLUDE_FROM_ALL OFF)
+
+file(GENERATE
+  OUTPUT "${CMAKE_BINARY_DIR}/main.txt"
+  CONTENT "$<TARGET_FILE_NAME:main>")
+
+file(GENERATE
+  OUTPUT "${CMAKE_BINARY_DIR}/bar.txt"
+  CONTENT "$<TARGET_FILE_NAME:bar>")
+
+file(GENERATE
+  OUTPUT "${CMAKE_BINARY_DIR}/baz.txt"
+  CONTENT "$<TARGET_FILE_NAME:baz>")
+
 target_include_directories(foo PUBLIC .)
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake
new file mode 100644
index 0000000..14ec482
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake
@@ -0,0 +1,44 @@
+# Use globbing to check if exes / libs were built because determining
+# exactly where these files will live inside a CMake -P script is
+# pretty challenging.
+
+file(READ "${RunCMake_TEST_BINARY_DIR}/main.txt" main_exe)
+file(READ "${RunCMake_TEST_BINARY_DIR}/bar.txt" bar_lib)
+file(READ "${RunCMake_TEST_BINARY_DIR}/baz.txt" baz_lib)
+
+set(found_main FALSE)
+file(GLOB_RECURSE files
+  LIST_DIRECTORIES FALSE
+  RELATIVE "${RunCMake_TEST_BINARY_DIR}"
+  "${RunCMake_TEST_BINARY_DIR}/*")
+foreach (file IN LISTS files)
+  if (file MATCHES "${main_exe}")
+    set(found_main TRUE)
+  endif()
+endforeach()
+if (NOT found_main)
+  set(RunCMake_TEST_FAILED "'main' missing from ${RunCMake_TEST_BINARY_DIR}")
+endif()
+
+set(found_bar FALSE)
+set(found_baz FALSE)
+file(GLOB_RECURSE files
+  LIST_DIRECTORIES FALSE
+  RELATIVE "${RunCMake_TEST_BINARY_DIR}/ExcludeFromAll"
+  "${RunCMake_TEST_BINARY_DIR}/ExcludeFromAll/*")
+foreach (file IN LISTS files)
+  if (file MATCHES "${bar_lib}")
+    set(found_bar TRUE)
+  endif()
+  if (file MATCHES "${baz_lib}")
+    set(found_baz TRUE)
+  endif()
+endforeach()
+if (found_bar)
+  set(RunCMake_TEST_FAILED
+    "'bar' was not excluded from ${RunCMake_TEST_BINARY_DIR}/ExcludeFromAll")
+endif()
+if (NOT found_baz)
+  set(RunCMake_TEST_FAILED
+    "'baz' missing from ${RunCMake_TEST_BINARY_DIR}/ExcludeFromAll")
+endif()
diff --git a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
index 343e65b..781e483 100644
--- a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
@@ -33,6 +33,7 @@ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
 file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
 
 run_cmake(ExcludeFromAll)
+set(RunCMake-check-file ExcludeFromAll/check.cmake)
 run_cmake_command(ExcludeFromAll-build ${CMAKE_COMMAND} --build .)
 
 unset(RunCMake_TEST_BINARY_DIR)

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

Summary of changes:
 Help/manual/cmake-variables.7.rst                  |  1 +
 Help/prop_dir/EXCLUDE_FROM_ALL.rst                 |  6 +++
 Help/prop_tgt/EXCLUDE_FROM_ALL.rst                 |  3 ++
 Help/release/dev/EXCLUDE_FROM_ALL.rst              |  7 +++
 Help/release/dev/max-recursion-depth.rst           |  6 +++
 Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst    | 33 ++++++++++++++
 Modules/FindICU.cmake                              | 12 +++--
 Source/CMakeLists.txt                              | 10 +++++
 Source/CTest/cmCTestRunScriptCommand.cxx           |  3 +-
 Source/CTest/cmCTestScriptHandler.cxx              | 12 ++++-
 Source/CTest/cmCTestScriptHandler.h                |  5 ++-
 Source/cmConfigure.cmake.h.in                      |  1 +
 Source/cmGlobalGenerator.cxx                       | 16 +++----
 Source/cmGlobalGenerator.h                         |  4 +-
 Source/cmGlobalNinjaGenerator.h                    |  4 +-
 Source/cmGlobalUnixMakefileGenerator3.cxx          |  4 +-
 Source/cmGlobalVisualStudioGenerator.cxx           |  2 +-
 Source/cmGlobalXCodeGenerator.cxx                  |  7 +--
 Source/cmListFileCache.cxx                         |  5 ++-
 Source/cmLocalNinjaGenerator.cxx                   |  4 +-
 Source/cmMakefile.cxx                              | 51 ++++++++++++++++++++--
 Source/cmMakefile.h                                |  4 ++
 Source/cmNinjaTargetGenerator.cxx                  |  7 ++-
 Source/cmState.cxx                                 |  4 +-
 Tests/RunCMake/CMakeLists.txt                      |  1 +
 Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt    |  5 +++
 Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt.in |  2 +
 Tests/RunCMake/MaxRecursionDepth/CTestCustom.cmake |  3 ++
 .../MaxRecursionDepth/FindRecursivePackage.cmake   |  3 ++
 .../RunCMake/MaxRecursionDepth/RunCMakeTest.cmake  | 49 +++++++++++++++++++++
 .../add_subdirectory-var-result.txt}               |  0
 .../add_subdirectory-var-stderr.txt                | 10 +++++
 .../MaxRecursionDepth/add_subdirectory.cmake       |  2 +
 .../add_subdirectory/CMakeLists.txt                |  3 ++
 .../ctest_read_custom_files-default-result.txt}    |  0
 .../ctest_read_custom_files-default-stderr.txt     |  5 +++
 ...ctest_read_custom_files-invalid-var-result.txt} |  0
 .../ctest_read_custom_files-invalid-var-stderr.txt |  5 +++
 .../ctest_read_custom_files-var-result.txt}        |  0
 .../ctest_read_custom_files-var-stderr.txt         | 34 +++++++++++++++
 .../ctest_run_script-var-result.txt}               |  0
 .../ctest_run_script-var-stderr.txt                | 51 ++++++++++++++++++++++
 .../MaxRecursionDepth/ctest_run_script.cmake.in    | 14 ++++++
 .../find_package-default-result.txt}               |  0
 .../find_package-default-script-result.txt}        |  0
 .../find_package-default-script-stderr.txt         |  5 +++
 .../find_package-default-stderr.txt                |  5 +++
 .../find_package-invalid-var-result.txt}           |  0
 .../find_package-invalid-var-script-result.txt}    |  0
 .../find_package-invalid-var-script-stderr.txt     |  5 +++
 .../find_package-invalid-var-stderr.txt            |  5 +++
 .../find_package-var-result.txt}                   |  0
 .../find_package-var-script-result.txt}            |  0
 .../find_package-var-script-stderr.txt             | 21 +++++++++
 .../MaxRecursionDepth/find_package-var-stderr.txt  | 21 +++++++++
 .../RunCMake/MaxRecursionDepth/find_package.cmake  |  2 +
 .../function-default-result.txt}                   |  0
 .../function-default-script-result.txt}            |  0
 .../function-default-script-stderr.txt             |  5 +++
 .../MaxRecursionDepth/function-default-stderr.txt  |  5 +++
 .../function-invalid-var-result.txt}               |  0
 .../function-invalid-var-script-result.txt}        |  0
 .../function-invalid-var-script-stderr.txt         |  5 +++
 .../function-invalid-var-stderr.txt                |  5 +++
 .../function-var-result.txt}                       |  0
 .../function-var-script-result.txt}                |  0
 .../function-var-script-stderr.txt                 | 21 +++++++++
 .../MaxRecursionDepth/function-var-stderr.txt      | 21 +++++++++
 Tests/RunCMake/MaxRecursionDepth/function.cmake    |  7 +++
 .../include-default-result.txt}                    |  0
 .../include-default-script-result.txt}             |  0
 .../include-default-script-stderr.txt              |  5 +++
 .../MaxRecursionDepth/include-default-stderr.txt   |  5 +++
 .../include-invalid-var-result.txt}                |  0
 .../include-invalid-var-script-result.txt}         |  0
 .../include-invalid-var-script-stderr.txt          |  5 +++
 .../include-invalid-var-stderr.txt                 |  5 +++
 .../include-var-result.txt}                        |  0
 .../include-var-script-result.txt}                 |  0
 .../include-var-script-stderr.txt                  | 21 +++++++++
 .../MaxRecursionDepth/include-var-stderr.txt       | 21 +++++++++
 Tests/RunCMake/MaxRecursionDepth/include.cmake     |  2 +
 .../MaxRecursionDepth/include_recursive.cmake      |  3 ++
 .../macro-default-result.txt}                      |  0
 .../macro-default-script-result.txt}               |  0
 .../macro-default-script-stderr.txt                |  5 +++
 .../MaxRecursionDepth/macro-default-stderr.txt     |  5 +++
 .../macro-invalid-var-result.txt}                  |  0
 .../macro-invalid-var-script-result.txt}           |  0
 .../macro-invalid-var-script-stderr.txt            |  5 +++
 .../MaxRecursionDepth/macro-invalid-var-stderr.txt |  5 +++
 .../macro-var-result.txt}                          |  0
 .../macro-var-script-result.txt}                   |  0
 .../MaxRecursionDepth/macro-var-script-stderr.txt  | 21 +++++++++
 .../MaxRecursionDepth/macro-var-stderr.txt         | 21 +++++++++
 Tests/RunCMake/MaxRecursionDepth/macro.cmake       |  7 +++
 Tests/RunCMake/MaxRecursionDepth/test.cmake.in     | 21 +++++++++
 .../try_compile-var-result.txt}                    |  0
 .../MaxRecursionDepth/try_compile-var-stderr.txt   | 48 ++++++++++++++++++++
 Tests/RunCMake/MaxRecursionDepth/try_compile.cmake |  6 +++
 .../MaxRecursionDepth/try_compile/CMakeLists.txt   | 13 ++++++
 .../variable_watch-default-result.txt}             |  0
 .../variable_watch-default-script-result.txt}      |  0
 .../variable_watch-default-script-stderr.txt       |  6 +++
 .../variable_watch-default-stderr.txt              |  6 +++
 .../variable_watch-invalid-var-result.txt}         |  0
 .../variable_watch-invalid-var-script-result.txt}  |  0
 .../variable_watch-invalid-var-script-stderr.txt   |  6 +++
 .../variable_watch-invalid-var-stderr.txt          |  6 +++
 .../variable_watch-var-result.txt}                 |  0
 .../variable_watch-var-script-result.txt}          |  0
 .../variable_watch-var-script-stderr.txt           | 22 ++++++++++
 .../variable_watch-var-stderr.txt                  | 22 ++++++++++
 .../MaxRecursionDepth/variable_watch.cmake         |  9 ++++
 .../add_subdirectory/ExcludeFromAll/CMakeLists.txt | 16 +++++++
 .../add_subdirectory/ExcludeFromAll/check.cmake    | 44 +++++++++++++++++++
 Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake |  1 +
 bootstrap                                          |  1 +
 118 files changed, 852 insertions(+), 42 deletions(-)
 create mode 100644 Help/release/dev/EXCLUDE_FROM_ALL.rst
 create mode 100644 Help/release/dev/max-recursion-depth.rst
 create mode 100644 Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt.in
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/CTestCustom.cmake
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/FindRecursivePackage.cmake
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/add_subdirectory-var-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/add_subdirectory.cmake
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/add_subdirectory/CMakeLists.txt
 copy Tests/RunCMake/{ctest_submit/RepeatRETURN_VALUE-result.txt => MaxRecursionDepth/ctest_read_custom_files-default-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-stderr.txt
 copy Tests/RunCMake/{ctest_submit/RepeatRETURN_VALUE-result.txt => MaxRecursionDepth/ctest_read_custom_files-invalid-var-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-stderr.txt
 copy Tests/RunCMake/{ctest_submit/RepeatRETURN_VALUE-result.txt => MaxRecursionDepth/ctest_read_custom_files-var-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-stderr.txt
 copy Tests/RunCMake/{ctest_submit/RepeatRETURN_VALUE-result.txt => MaxRecursionDepth/ctest_run_script-var-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/ctest_run_script.cmake.in
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/find_package-default-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/find_package-default-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/find_package-default-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/find_package-default-stderr.txt
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/find_package-invalid-var-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/find_package-invalid-var-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-stderr.txt
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/find_package-var-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/find_package-var-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/find_package-var-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/find_package-var-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/find_package.cmake
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/function-default-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/function-default-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/function-default-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/function-default-stderr.txt
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/function-invalid-var-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/function-invalid-var-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/function-invalid-var-stderr.txt
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/function-var-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/function-var-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/function-var-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/function-var-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/function.cmake
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/include-default-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/include-default-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/include-default-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/include-default-stderr.txt
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/include-invalid-var-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/include-invalid-var-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/include-invalid-var-stderr.txt
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/include-var-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/include-var-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/include-var-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/include-var-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/include.cmake
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/include_recursive.cmake
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/macro-default-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/macro-default-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/macro-default-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/macro-default-stderr.txt
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/macro-invalid-var-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/macro-invalid-var-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-stderr.txt
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/macro-var-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/macro-var-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/macro-var-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/macro-var-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/macro.cmake
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/test.cmake.in
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/try_compile-var-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/try_compile-var-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/try_compile.cmake
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists.txt
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/variable_watch-default-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/variable_watch-default-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/variable_watch-invalid-var-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/variable_watch-invalid-var-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/variable_watch-var-result.txt} (100%)
 copy Tests/RunCMake/{while/MissingArgument-result.txt => MaxRecursionDepth/variable_watch-var-script-result.txt} (100%)
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
 create mode 100644 Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake
 create mode 100644 Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list