[Cmake-commits] CMake branch, master, updated. v3.11.0-443-g576d01f

Kitware Robot kwrobot at kitware.com
Fri Apr 6 10:35:06 EDT 2018


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  576d01fed4c760cd20e702cf064d207173b9f845 (commit)
       via  607b0ac2f3be1cbe7a0d8acbc711836935d5e3d6 (commit)
       via  5454b41e1b95d154c4f6a0c1f191a4e794765d95 (commit)
       via  58e847c49af0c9740c4e5d9648b180491e617266 (commit)
       via  d308e9442eb90db6fbd385374574ba5818001509 (commit)
       via  acda926a047c5958af32fd6f88dd184f5d769319 (commit)
       via  418541035f82327ff387363efebcf18de7feffc9 (commit)
       via  1519628e6042a09cac4733fe09850c61d8c74be1 (commit)
       via  2f87d008034d92a54beb586c031c636596055034 (commit)
       via  b0676cc5d48a5e7b79e8c95545b464b67248d96e (commit)
       via  966dba5b683149e8c42d35a89cd60d593e542593 (commit)
       via  12a145534ae04b99fdbd23aec53c9113718c9ad0 (commit)
       via  d6390ce26e6575d055f2ecda8642a2ad3568cb87 (commit)
       via  8592c6326bb43ec46cf43e77e51d62212c145dfe (commit)
       via  e0aa060352f0ea663500e87086192f52440952b9 (commit)
       via  0ad329f7c09f67aa2ebae059fbbef6266c8f6515 (commit)
       via  050ddfb3f3236fd03c72f7dc936332eed6b3997f (commit)
       via  6c4f8b4596fb48f5eeea905b7fbdd9350b9e7838 (commit)
       via  20612978c8d0880606632bf46f567218eae0b37b (commit)
       via  3f4b81f54096a90e2887ece75fff6cf4a8b93541 (commit)
       via  ca0befc2e10da59d2b82e4143ad913eb8322290f (commit)
       via  599c93e22d02d34d763d0156fcd29bb2930dec07 (commit)
      from  2e49bb643450d4b27788b6f86d58f13ca1fbf917 (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=576d01fed4c760cd20e702cf064d207173b9f845
commit 576d01fed4c760cd20e702cf064d207173b9f845
Merge: 607b0ac d6390ce
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Apr 6 14:30:36 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Apr 6 10:30:40 2018 -0400

    Merge topic 'ninja-fortran-rspfile'
    
    d6390ce26e Ninja: Fix Fortran support with response files
    8592c6326b cmNinjaTargetGenerator: Move force-rspfile check to earlier
    e0aa060352 cmNinjaTargetGenerator: Move depfile logic to later in its function
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1936


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=607b0ac2f3be1cbe7a0d8acbc711836935d5e3d6
commit 607b0ac2f3be1cbe7a0d8acbc711836935d5e3d6
Merge: 5454b41 acda926
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Apr 6 14:29:31 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Apr 6 10:29:38 2018 -0400

    Merge topic 'minor-cleanups'
    
    acda926a04 Replace some uses of sprintf with std::to_string
    418541035f cmCTestCurl: Fix UploadFile declared parameter names
    1519628e60 cmVisualStudio10TargetGenerator: Make NsightTegraVersion unsigned
    2f87d00803 cmMacroCommand: Fix format string to match type of argument
    b0676cc5d4 Add in-class initialization of some members
    966dba5b68 cmAlgorithms: Remove unnecessary typename keyword
    12a145534a gitignore: Ignore a .vs directory in the source tree
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1932


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5454b41e1b95d154c4f6a0c1f191a4e794765d95
commit 5454b41e1b95d154c4f6a0c1f191a4e794765d95
Merge: 58e847c 0ad329f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Apr 6 14:26:41 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Apr 6 10:26:47 2018 -0400

    Merge topic 'sanitize-LINK_DIRECTORIES'
    
    0ad329f7c0 Sanitize paths from LINK_DIRECTORIES directory property
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1920


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58e847c49af0c9740c4e5d9648b180491e617266
commit 58e847c49af0c9740c4e5d9648b180491e617266
Merge: d308e94 050ddfb
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Apr 6 14:25:42 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Apr 6 10:25:46 2018 -0400

    Merge topic 'xml-level'
    
    050ddfb3f3 cmXMLWriter: code improvement
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1925


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d308e9442eb90db6fbd385374574ba5818001509
commit d308e9442eb90db6fbd385374574ba5818001509
Merge: 2e49bb6 6c4f8b4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Apr 6 14:24:57 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Apr 6 10:25:08 2018 -0400

    Merge topic 'glob_configure_depends'
    
    6c4f8b4596 Adjust help documentation for file(GLOB), add topic notes
    20612978c8 Add tests for `file(GLOB)` CONFIGURE_DEPENDS flag
    3f4b81f540 Add glob verify support to XCode, VS, Ninja, and Makefile generators
    ca0befc2e1 Add `CONFIGURE_DEPENDS` flag support to cmFileCommand::HandleGlobCommand
    599c93e22d Add cmGlobVerificationManager class, integrate with cmake and cmState
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1767

diff --cc Source/cmake.cxx
index 83c5384,2266081..5bae4e7
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@@ -2431,40 -2462,52 +2459,52 @@@ int cmake::Build(const std::string& dir
    // to limitations of the underlying build system.
    std::string const stampList = cachePath + "/" +
      GetCMakeFilesDirectoryPostSlash() +
 -    cmGlobalVisualStudio8Generator::GetGenerateStampList();
 +    cmGlobalVisualStudio9Generator::GetGenerateStampList();
  
    // Note that the stampList file only exists for VS generators.
-   if (cmSystemTools::FileExists(stampList) &&
-       !cmakeCheckStampList(stampList.c_str(), false)) {
- 
-     // Correctly initialize the home (=source) and home output (=binary)
-     // directories, which is required for running the generation step.
-     std::string homeOrig = this->GetHomeDirectory();
-     std::string homeOutputOrig = this->GetHomeOutputDirectory();
-     this->SetDirectoriesFromFile(cachePath.c_str());
+   if (cmSystemTools::FileExists(stampList)) {
  
+     // Check if running for Visual Studio 9 - we need to explicitly run
+     // the glob verification script before starting the build
      this->AddScriptingCommands();
-     this->AddProjectCommands();
+     if (this->GlobalGenerator->MatchesGeneratorName("Visual Studio 9 2008")) {
+       std::string const globVerifyScript = cachePath + "/" +
+         GetCMakeFilesDirectoryPostSlash() + "VerifyGlobs.cmake";
+       if (cmSystemTools::FileExists(globVerifyScript)) {
+         std::vector<std::string> args;
+         this->ReadListFile(args, globVerifyScript.c_str());
+       }
+     }
  
-     int ret = this->Configure();
-     if (ret) {
-       cmSystemTools::Message("CMake Configure step failed.  "
-                              "Build files cannot be regenerated correctly.");
-       return ret;
-     }
-     ret = this->Generate();
-     if (ret) {
-       cmSystemTools::Message("CMake Generate step failed.  "
-                              "Build files cannot be regenerated correctly.");
-       return ret;
-     }
-     std::string message = "Build files have been written to: ";
-     message += this->GetHomeOutputDirectory();
-     this->UpdateProgress(message.c_str(), -1);
- 
-     // Restore the previously set directories to their original value.
-     this->SetHomeDirectory(homeOrig);
-     this->SetHomeOutputDirectory(homeOutputOrig);
+     if (!cmakeCheckStampList(stampList.c_str(), false)) {
+       // Correctly initialize the home (=source) and home output (=binary)
+       // directories, which is required for running the generation step.
+       std::string homeOrig = this->GetHomeDirectory();
+       std::string homeOutputOrig = this->GetHomeOutputDirectory();
+       this->SetDirectoriesFromFile(cachePath.c_str());
+ 
+       this->AddProjectCommands();
+ 
+       int ret = this->Configure();
+       if (ret) {
+         cmSystemTools::Message("CMake Configure step failed.  "
+                                "Build files cannot be regenerated correctly.");
+         return ret;
+       }
+       ret = this->Generate();
+       if (ret) {
+         cmSystemTools::Message("CMake Generate step failed.  "
+                                "Build files cannot be regenerated correctly.");
+         return ret;
+       }
+       std::string message = "Build files have been written to: ";
+       message += this->GetHomeOutputDirectory();
+       this->UpdateProgress(message.c_str(), -1);
+ 
+       // Restore the previously set directories to their original value.
+       this->SetHomeDirectory(homeOrig);
+       this->SetHomeOutputDirectory(homeOutputOrig);
+     }
    }
  #endif
  

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=acda926a047c5958af32fd6f88dd184f5d769319
commit acda926a047c5958af32fd6f88dd184f5d769319
Author:     jrp2014 <jrp2014 at users.noreply.github.com>
AuthorDate: Wed Apr 4 07:41:50 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 5 15:34:23 2018 -0400

    Replace some uses of sprintf with std::to_string

diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 85ac985..13407e5 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -8,6 +8,7 @@
 #include <sstream>
 #include <stdio.h>
 #include <string.h>
+#include <string>
 
 #include "cmGeneratedFileStream.h"
 #include "cmMessenger.h"
@@ -243,19 +244,18 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger)
   }
   // before writing the cache, update the version numbers
   // to the
-  char temp[1024];
-  sprintf(temp, "%d", cmVersion::GetMinorVersion());
-  this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", temp,
-                      "Minor version of cmake used to create the "
+  this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION",
+                      std::to_string(cmVersion::GetMajorVersion()).c_str(),
+                      "Major version of cmake used to create the "
                       "current loaded cache",
                       cmStateEnums::INTERNAL);
-  sprintf(temp, "%d", cmVersion::GetMajorVersion());
-  this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", temp,
-                      "Major version of cmake used to create the "
+  this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION",
+                      std::to_string(cmVersion::GetMinorVersion()).c_str(),
+                      "Minor version of cmake used to create the "
                       "current loaded cache",
                       cmStateEnums::INTERNAL);
-  sprintf(temp, "%d", cmVersion::GetPatchVersion());
-  this->AddCacheEntry("CMAKE_CACHE_PATCH_VERSION", temp,
+  this->AddCacheEntry("CMAKE_CACHE_PATCH_VERSION",
+                      std::to_string(cmVersion::GetPatchVersion()).c_str(),
                       "Patch version of cmake used to create the "
                       "current loaded cache",
                       cmStateEnums::INTERNAL);
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index 479ecd2..0d97c33 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -6,7 +6,7 @@
 #include <algorithm>
 #include <assert.h>
 #include <iterator>
-#include <stdio.h>
+#include <string>
 
 #include "cmAlgorithms.h"
 #include "cmDefinitions.h"
@@ -328,15 +328,14 @@ void cmStateSnapshot::SetDefaultDefinitions()
   this->SetDefinition("CMAKE_HOST_SOLARIS", "1");
 #endif
 
-  char temp[1024];
-  sprintf(temp, "%d", cmVersion::GetMinorVersion());
-  this->SetDefinition("CMAKE_MINOR_VERSION", temp);
-  sprintf(temp, "%d", cmVersion::GetMajorVersion());
-  this->SetDefinition("CMAKE_MAJOR_VERSION", temp);
-  sprintf(temp, "%d", cmVersion::GetPatchVersion());
-  this->SetDefinition("CMAKE_PATCH_VERSION", temp);
-  sprintf(temp, "%d", cmVersion::GetTweakVersion());
-  this->SetDefinition("CMAKE_TWEAK_VERSION", temp);
+  this->SetDefinition("CMAKE_MAJOR_VERSION",
+                      std::to_string(cmVersion::GetMajorVersion()));
+  this->SetDefinition("CMAKE_MINOR_VERSION",
+                      std::to_string(cmVersion::GetMinorVersion()));
+  this->SetDefinition("CMAKE_PATCH_VERSION",
+                      std::to_string(cmVersion::GetPatchVersion()));
+  this->SetDefinition("CMAKE_TWEAK_VERSION",
+                      std::to_string(cmVersion::GetTweakVersion()));
   this->SetDefinition("CMAKE_VERSION", cmVersion::GetCMakeVersion());
 
   this->SetDefinition("CMAKE_FILES_DIRECTORY",

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=418541035f82327ff387363efebcf18de7feffc9
commit 418541035f82327ff387363efebcf18de7feffc9
Author:     jrp2014 <jrp2014 at users.noreply.github.com>
AuthorDate: Tue Apr 3 16:59:31 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 5 13:42:49 2018 -0400

    cmCTestCurl: Fix UploadFile declared parameter names
    
    Match the order used in the definition.

diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h
index 427a392..86d9489 100644
--- a/Source/CTest/cmCTestCurl.h
+++ b/Source/CTest/cmCTestCurl.h
@@ -16,7 +16,7 @@ class cmCTestCurl
 public:
   cmCTestCurl(cmCTest*);
   ~cmCTestCurl();
-  bool UploadFile(std::string const& url, std::string const& file,
+  bool UploadFile(std::string const& local_file, std::string const& url,
                   std::string const& fields, std::string& response);
   bool HttpRequest(std::string const& url, std::string const& fields,
                    std::string& response);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1519628e6042a09cac4733fe09850c61d8c74be1
commit 1519628e6042a09cac4733fe09850c61d8c74be1
Author:     jrp2014 <jrp2014 at users.noreply.github.com>
AuthorDate: Tue Apr 3 17:39:11 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 5 13:42:49 2018 -0400

    cmVisualStudio10TargetGenerator: Make NsightTegraVersion unsigned
    
    It's used in unsigned contexts, such as with format strings.

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 4bd07ef..28e8b24 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -342,8 +342,8 @@ void cmVisualStudio10TargetGenerator::Generate()
 
   if (this->NsightTegra) {
     this->WriteString("<PropertyGroup Label=\"NsightTegraProject\">\n", 1);
-    const int nsightTegraMajorVersion = this->NsightTegraVersion[0];
-    const int nsightTegraMinorVersion = this->NsightTegraVersion[1];
+    const unsigned int nsightTegraMajorVersion = this->NsightTegraVersion[0];
+    const unsigned int nsightTegraMinorVersion = this->NsightTegraVersion[1];
     if (nsightTegraMajorVersion >= 2) {
       this->WriteString("<NsightTegraProjectRevisionNumber>", 2);
       if (nsightTegraMajorVersion > 3 ||
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 7106737..de3a8a6 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -203,7 +203,7 @@ private:
   bool MSTools;
   bool Managed;
   bool NsightTegra;
-  int NsightTegraVersion[4];
+  unsigned int NsightTegraVersion[4];
   bool TargetCompileAsWinRT;
   cmGlobalVisualStudio10Generator* const GlobalGenerator;
   cmGeneratedFileStream* BuildFileStream;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2f87d008034d92a54beb586c031c636596055034
commit 2f87d008034d92a54beb586c031c636596055034
Author:     jrp2014 <jrp2014 at users.noreply.github.com>
AuthorDate: Tue Apr 3 17:30:46 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 5 13:42:49 2018 -0400

    cmMacroCommand: Fix format string to match type of argument

diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 07943e3..6f4b930 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -93,7 +93,7 @@ bool cmMacroHelperCommand::InvokeInitialPass(
   argVs.reserve(expandedArgs.size());
   char argvName[60];
   for (unsigned int j = 0; j < expandedArgs.size(); ++j) {
-    sprintf(argvName, "${ARGV%i}", j);
+    sprintf(argvName, "${ARGV%u}", j);
     argVs.push_back(argvName);
   }
   // Invoke all the functions that were collected in the block.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0676cc5d48a5e7b79e8c95545b464b67248d96e
commit b0676cc5d48a5e7b79e8c95545b464b67248d96e
Author:     jrp2014 <jrp2014 at users.noreply.github.com>
AuthorDate: Tue Apr 3 22:18:48 2018 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 5 13:42:48 2018 -0400

    Add in-class initialization of some members
    
    Several class constructors leave members uninitialized.  The members are
    initialized before use in methods, but it is clearer and less
    error-prone to initialize them at their definition site.

diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h
index cff934b..5603c50 100644
--- a/Source/cmConfigureFileCommand.h
+++ b/Source/cmConfigureFileCommand.h
@@ -32,9 +32,9 @@ private:
 
   std::string InputFile;
   std::string OutputFile;
-  bool CopyOnly;
-  bool EscapeQuotes;
-  bool AtOnly;
+  bool CopyOnly = false;
+  bool EscapeQuotes = false;
+  bool AtOnly = false;
 };
 
 #endif
diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h
index 6f35a54..ae714a6 100644
--- a/Source/cmCoreTryCompile.h
+++ b/Source/cmCoreTryCompile.h
@@ -46,7 +46,7 @@ protected:
   std::string BinaryDirectory;
   std::string OutputFile;
   std::string FindErrorMessage;
-  bool SrcFileSignature;
+  bool SrcFileSignature = false;
 
 private:
   std::vector<std::string> WarnCMP0067;
diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h
index bf5e9bc..8414866 100644
--- a/Source/cmExportLibraryDependenciesCommand.h
+++ b/Source/cmExportLibraryDependenciesCommand.h
@@ -27,7 +27,7 @@ public:
 
 private:
   std::string Filename;
-  bool Append;
+  bool Append = false;
   void ConstFinalPass() const;
 };
 
diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h
index 5cc6442..d48abca 100644
--- a/Source/cmExternalMakefileProjectGenerator.h
+++ b/Source/cmExternalMakefileProjectGenerator.h
@@ -62,7 +62,7 @@ protected:
   ///! Contains the names of the global generators support by this generator.
   std::vector<std::string> SupportedGlobalGenerators;
   ///! the global generator which creates the makefiles
-  const cmGlobalGenerator* GlobalGenerator;
+  const cmGlobalGenerator* GlobalGenerator = nullptr;
 
   std::string Name;
 };
diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h
index 19f2559..a52f45e 100644
--- a/Source/cmInstallFilesCommand.h
+++ b/Source/cmInstallFilesCommand.h
@@ -48,7 +48,7 @@ protected:
 
 private:
   std::vector<std::string> FinalArgs;
-  bool IsFilesForm;
+  bool IsFilesForm = false;
   std::string Destination;
   std::vector<std::string> Files;
 };
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index a2f3ecd..54f8cf4 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -43,7 +43,7 @@ private:
   void LinkLibraryTypeSpecifierWarning(int left, int right);
   static const char* LinkLibraryTypeNames[3];
 
-  cmTarget* Target;
+  cmTarget* Target = nullptr;
   enum ProcessingState
   {
     ProcessingLinkLibraries,
@@ -55,7 +55,7 @@ private:
     ProcessingKeywordPrivateInterface
   };
 
-  ProcessingState CurrentProcessingState;
+  ProcessingState CurrentProcessingState = ProcessingLinkLibraries;
 
   bool HandleLibrary(const std::string& lib, cmTargetLinkLibraryType llt);
 };
diff --git a/Source/cmTargetPropCommandBase.h b/Source/cmTargetPropCommandBase.h
index 3c736fc..943285d 100644
--- a/Source/cmTargetPropCommandBase.h
+++ b/Source/cmTargetPropCommandBase.h
@@ -28,7 +28,7 @@ public:
 
 protected:
   std::string Property;
-  cmTarget* Target;
+  cmTarget* Target = nullptr;
 
   virtual void HandleInterfaceContent(cmTarget* tgt,
                                       const std::vector<std::string>& content,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=966dba5b683149e8c42d35a89cd60d593e542593
commit 966dba5b683149e8c42d35a89cd60d593e542593
Author:     jrp2014 <jrp2014 at users.noreply.github.com>
AuthorDate: Tue Apr 3 16:28:44 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 5 13:42:48 2018 -0400

    cmAlgorithms: Remove unnecessary typename keyword

diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 3380b78..244dc1c 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -311,7 +311,7 @@ struct RemoveDuplicatesAPI<Range, T*>
 template <typename Range>
 typename Range::const_iterator cmRemoveDuplicates(Range& r)
 {
-  typedef typename ContainerAlgorithms::RemoveDuplicatesAPI<Range> API;
+  typedef ContainerAlgorithms::RemoveDuplicatesAPI<Range> API;
   typedef typename API::value_type T;
   std::vector<T> unique;
   unique.reserve(r.size());

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12a145534ae04b99fdbd23aec53c9113718c9ad0
commit 12a145534ae04b99fdbd23aec53c9113718c9ad0
Author:     jrp2014 <jrp2014 at users.noreply.github.com>
AuthorDate: Sat Mar 31 19:28:03 2018 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 5 13:42:42 2018 -0400

    gitignore: Ignore a .vs directory in the source tree

diff --git a/.gitignore b/.gitignore
index 5d1732d..22e9800 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,6 @@
 
 *.pyc
 Testing
+
+# Visual Studio work directory
+.vs/

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d6390ce26e6575d055f2ecda8642a2ad3568cb87
commit d6390ce26e6575d055f2ecda8642a2ad3568cb87
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 5 11:38:36 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 5 13:02:27 2018 -0400

    Ninja: Fix Fortran support with response files
    
    The Ninja generator splits preprocessing and compilation steps for
    Fortran.  Fix this logic to work when using response files for
    compilation so that it works for the preprocessing step too.
    
    This fixes behavior under `CMAKE_NINJA_FORCE_RESPONSE_FILE`.
    
    Issue: #17877

diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index f213cc0..ddb1d54 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -445,24 +445,16 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
   cmMakefile* mf = this->GetMakefile();
 
   std::string flags = "$FLAGS";
-  std::string rspfile;
-  std::string rspcontent;
 
+  std::string responseFlag;
   bool const lang_supports_response = !(lang == "RC" || lang == "CUDA");
   if (lang_supports_response && this->ForceResponseFile()) {
     std::string const responseFlagVar =
       "CMAKE_" + lang + "_RESPONSE_FILE_FLAG";
-    std::string responseFlag =
-      this->Makefile->GetSafeDefinition(responseFlagVar);
+    responseFlag = this->Makefile->GetSafeDefinition(responseFlagVar);
     if (responseFlag.empty()) {
       responseFlag = "@";
     }
-    rspfile = "$RSP_FILE";
-    responseFlag += rspfile;
-    rspcontent = " $DEFINES $INCLUDES $FLAGS";
-    flags = std::move(responseFlag);
-    vars.Defines = "";
-    vars.Includes = "";
   }
 
   std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
@@ -514,6 +506,18 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
     // compilation rule still needs them for the INCLUDE directive.
     ppVars.Includes = vars.Includes;
 
+    // If using a response file, move defines, includes, and flags into it.
+    std::string ppRspFile;
+    std::string ppRspContent;
+    if (!responseFlag.empty()) {
+      ppRspFile = "$RSP_FILE";
+      ppRspContent = std::string(" ") + ppVars.Defines + " " +
+        ppVars.Includes + " " + ppFlags;
+      ppFlags = responseFlag + ppRspFile;
+      ppVars.Defines = "";
+      ppVars.Includes = "";
+    }
+
     ppVars.Flags = ppFlags.c_str();
 
     // Rule for preprocessing source file.
@@ -544,13 +548,11 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
     ppComment << "Rule for preprocessing " << lang << " files.";
     std::ostringstream ppDesc;
     ppDesc << "Building " << lang << " preprocessed $out";
-    this->GetGlobalGenerator()->AddRule(this->LanguagePreprocessRule(lang),
-                                        ppCmdLine, ppDesc.str(),
-                                        ppComment.str(), ppDepfile, ppDeptype,
-                                        /*rspfile*/ "",
-                                        /*rspcontent*/ "",
-                                        /*restat*/ "",
-                                        /*generator*/ false);
+    this->GetGlobalGenerator()->AddRule(
+      this->LanguagePreprocessRule(lang), ppCmdLine, ppDesc.str(),
+      ppComment.str(), ppDepfile, ppDeptype, ppRspFile, ppRspContent,
+      /*restat*/ "",
+      /*generator*/ false);
   }
 
   if (needDyndep) {
@@ -587,6 +589,18 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
       /*generator*/ false);
   }
 
+  // If using a response file, move defines, includes, and flags into it.
+  std::string rspfile;
+  std::string rspcontent;
+  if (!responseFlag.empty()) {
+    rspfile = "$RSP_FILE";
+    rspcontent =
+      std::string(" ") + vars.Defines + " " + vars.Includes + " " + flags;
+    flags = responseFlag + rspfile;
+    vars.Defines = "";
+    vars.Includes = "";
+  }
+
   // Tell ninja dependency format so all deps can be loaded into a database
   std::string deptype;
   std::string depfile;
@@ -1019,9 +1033,12 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
     this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(),
                                ppVars);
 
+    std::string const ppRspFile = ppFileName + ".rsp";
+
     this->GetGlobalGenerator()->WriteBuild(
       this->GetBuildFileStream(), ppComment, ppRule, ppOutputs, ppImplicitOuts,
-      ppExplicitDeps, ppImplicitDeps, ppOrderOnlyDeps, ppVars);
+      ppExplicitDeps, ppImplicitDeps, ppOrderOnlyDeps, ppVars, ppRspFile,
+      commandLineLengthLimit);
   }
   if (needDyndep) {
     std::string const dyndep = this->GetDyndepFilePath(language);
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index c0c361e..8837821 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -121,6 +121,9 @@ if(CMAKE_GENERATOR STREQUAL "Ninja")
     -DCMAKE_C_OUTPUT_EXTENSION=${CMAKE_C_OUTPUT_EXTENSION}
     -DCMAKE_SHARED_LIBRARY_PREFIX=${CMAKE_SHARED_LIBRARY_PREFIX}
     -DCMAKE_SHARED_LIBRARY_SUFFIX=${CMAKE_SHARED_LIBRARY_SUFFIX})
+  if(CMAKE_Fortran_COMPILER)
+    list(APPEND Ninja_ARGS -DTEST_Fortran=1)
+  endif()
   add_RunCMake_test(Ninja)
 endif()
 add_RunCMake_test(CTest)
diff --git a/Tests/RunCMake/Ninja/RspFileC.cmake b/Tests/RunCMake/Ninja/RspFileC.cmake
new file mode 100644
index 0000000..4a40682
--- /dev/null
+++ b/Tests/RunCMake/Ninja/RspFileC.cmake
@@ -0,0 +1,2 @@
+set(ENV{CMAKE_NINJA_FORCE_RESPONSE_FILE} 1)
+enable_language(C)
diff --git a/Tests/RunCMake/Ninja/RspFileCXX.cmake b/Tests/RunCMake/Ninja/RspFileCXX.cmake
new file mode 100644
index 0000000..9e61ffe
--- /dev/null
+++ b/Tests/RunCMake/Ninja/RspFileCXX.cmake
@@ -0,0 +1,2 @@
+set(ENV{CMAKE_NINJA_FORCE_RESPONSE_FILE} 1)
+enable_language(CXX)
diff --git a/Tests/RunCMake/Ninja/RspFileFortran.cmake b/Tests/RunCMake/Ninja/RspFileFortran.cmake
new file mode 100644
index 0000000..8c18e37
--- /dev/null
+++ b/Tests/RunCMake/Ninja/RspFileFortran.cmake
@@ -0,0 +1,2 @@
+set(ENV{CMAKE_NINJA_FORCE_RESPONSE_FILE} 1)
+enable_language(Fortran)
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index b3720fb..3bb2b6b 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -40,6 +40,12 @@ run_CMP0058(NEW-by)
 
 run_cmake(CustomCommandDepfile)
 
+run_cmake(RspFileC)
+run_cmake(RspFileCXX)
+if(TEST_Fortran)
+  run_cmake(RspFileFortran)
+endif()
+
 function(run_CommandConcat)
   set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CommandConcat-build)
   set(RunCMake_TEST_NO_CLEAN 1)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8592c6326bb43ec46cf43e77e51d62212c145dfe
commit 8592c6326bb43ec46cf43e77e51d62212c145dfe
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 5 11:37:32 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 5 12:51:21 2018 -0400

    cmNinjaTargetGenerator: Move force-rspfile check to earlier

diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index d982020..f213cc0 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -867,6 +867,11 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
   std::string const objectFileDir =
     cmSystemTools::GetFilenamePath(objectFileName);
 
+  bool const lang_supports_response =
+    !(language == "RC" || language == "CUDA");
+  int const commandLineLengthLimit =
+    ((lang_supports_response && this->ForceResponseFile())) ? -1 : 0;
+
   cmNinjaVars vars;
   vars["FLAGS"] = this->ComputeFlagsForObject(source, language);
   vars["DEFINES"] = this->ComputeDefines(source, language);
@@ -1036,10 +1041,6 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
 
   this->SetMsvcTargetPdbVariable(vars);
 
-  bool const lang_supports_response =
-    !(language == "RC" || language == "CUDA");
-  int const commandLineLengthLimit =
-    ((lang_supports_response && this->ForceResponseFile())) ? -1 : 0;
   std::string const rspfile = objectFileName + ".rsp";
 
   this->GetGlobalGenerator()->WriteBuild(

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0aa060352f0ea663500e87086192f52440952b9
commit e0aa060352f0ea663500e87086192f52440952b9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 5 11:04:23 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 5 12:50:57 2018 -0400

    cmNinjaTargetGenerator: Move depfile logic to later in its function
    
    Clarify that other compile rule generation logic does not depend on it.

diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index fa7d95a..d982020 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -465,52 +465,6 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
     vars.Includes = "";
   }
 
-  // Tell ninja dependency format so all deps can be loaded into a database
-  std::string deptype;
-  std::string depfile;
-  std::string cldeps;
-  if (explicitPP) {
-    // The explicit preprocessing step will handle dependency scanning.
-  } else if (this->NeedDepTypeMSVC(lang)) {
-    deptype = "msvc";
-    depfile.clear();
-    flags += " /showIncludes";
-  } else if (mf->IsOn("CMAKE_NINJA_CMCLDEPS_" + lang)) {
-    // For the MS resource compiler we need cmcldeps, but skip dependencies
-    // for source-file try_compile cases because they are always fresh.
-    if (!mf->GetIsSourceFileTryCompile()) {
-      deptype = "gcc";
-      depfile = "$DEP_FILE";
-      const std::string cl = mf->GetDefinition("CMAKE_C_COMPILER")
-        ? mf->GetSafeDefinition("CMAKE_C_COMPILER")
-        : mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
-      cldeps = "\"";
-      cldeps += cmSystemTools::GetCMClDepsCommand();
-      cldeps += "\" " + lang + " " + vars.Source + " $DEP_FILE $out \"";
-      cldeps += mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDES_PREFIX");
-      cldeps += "\" \"" + cl + "\" ";
-    }
-  } else {
-    deptype = "gcc";
-    const char* langdeptype = mf->GetDefinition("CMAKE_NINJA_DEPTYPE_" + lang);
-    if (langdeptype) {
-      deptype = langdeptype;
-    }
-    depfile = "$DEP_FILE";
-    const std::string flagsName = "CMAKE_DEPFILE_FLAGS_" + lang;
-    std::string depfileFlags = mf->GetSafeDefinition(flagsName);
-    if (!depfileFlags.empty()) {
-      cmSystemTools::ReplaceString(depfileFlags, "<DEPFILE>", "$DEP_FILE");
-      cmSystemTools::ReplaceString(depfileFlags, "<OBJECT>", "$out");
-      cmSystemTools::ReplaceString(depfileFlags, "<CMAKE_C_COMPILER>",
-                                   mf->GetDefinition("CMAKE_C_COMPILER"));
-      flags += " " + depfileFlags;
-    }
-  }
-
-  vars.Flags = flags.c_str();
-  vars.DependencyFile = depfile.c_str();
-
   std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
     this->GetLocalGenerator()->CreateRulePlaceholderExpander());
 
@@ -550,7 +504,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
     vars.Source = "$in";
 
     // Preprocessing and compilation use the same flags.
-    ppVars.Flags = vars.Flags;
+    std::string ppFlags = flags;
 
     // Move preprocessor definitions to the preprocessor rule.
     ppVars.Defines = vars.Defines;
@@ -560,6 +514,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
     // compilation rule still needs them for the INCLUDE directive.
     ppVars.Includes = vars.Includes;
 
+    ppVars.Flags = ppFlags.c_str();
+
     // Rule for preprocessing source file.
     std::vector<std::string> ppCmds;
     cmSystemTools::ExpandListArgument(ppCmd, ppCmds);
@@ -631,6 +587,52 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
       /*generator*/ false);
   }
 
+  // Tell ninja dependency format so all deps can be loaded into a database
+  std::string deptype;
+  std::string depfile;
+  std::string cldeps;
+  if (explicitPP) {
+    // The explicit preprocessing step will handle dependency scanning.
+  } else if (this->NeedDepTypeMSVC(lang)) {
+    deptype = "msvc";
+    depfile.clear();
+    flags += " /showIncludes";
+  } else if (mf->IsOn("CMAKE_NINJA_CMCLDEPS_" + lang)) {
+    // For the MS resource compiler we need cmcldeps, but skip dependencies
+    // for source-file try_compile cases because they are always fresh.
+    if (!mf->GetIsSourceFileTryCompile()) {
+      deptype = "gcc";
+      depfile = "$DEP_FILE";
+      const std::string cl = mf->GetDefinition("CMAKE_C_COMPILER")
+        ? mf->GetSafeDefinition("CMAKE_C_COMPILER")
+        : mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
+      cldeps = "\"";
+      cldeps += cmSystemTools::GetCMClDepsCommand();
+      cldeps += "\" " + lang + " " + vars.Source + " $DEP_FILE $out \"";
+      cldeps += mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDES_PREFIX");
+      cldeps += "\" \"" + cl + "\" ";
+    }
+  } else {
+    deptype = "gcc";
+    const char* langdeptype = mf->GetDefinition("CMAKE_NINJA_DEPTYPE_" + lang);
+    if (langdeptype) {
+      deptype = langdeptype;
+    }
+    depfile = "$DEP_FILE";
+    const std::string flagsName = "CMAKE_DEPFILE_FLAGS_" + lang;
+    std::string depfileFlags = mf->GetSafeDefinition(flagsName);
+    if (!depfileFlags.empty()) {
+      cmSystemTools::ReplaceString(depfileFlags, "<DEPFILE>", "$DEP_FILE");
+      cmSystemTools::ReplaceString(depfileFlags, "<OBJECT>", "$out");
+      cmSystemTools::ReplaceString(depfileFlags, "<CMAKE_C_COMPILER>",
+                                   mf->GetDefinition("CMAKE_C_COMPILER"));
+      flags += " " + depfileFlags;
+    }
+  }
+
+  vars.Flags = flags.c_str();
+  vars.DependencyFile = depfile.c_str();
+
   // Rule for compiling object file.
   std::vector<std::string> compileCmds;
   if (lang == "CUDA") {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0ad329f7c09f67aa2ebae059fbbef6266c8f6515
commit 0ad329f7c09f67aa2ebae059fbbef6266c8f6515
Author:     jrp2014 <jrp2014 at users.noreply.github.com>
AuthorDate: Tue Apr 3 19:20:39 2018 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 4 14:42:20 2018 -0400

    Sanitize paths from LINK_DIRECTORIES directory property
    
    Normally they are sanitized by the `link_directories` command before
    populating the property, but projects may set the property directly.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3ecd7eb..bbe6cc9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1836,12 +1836,10 @@ void cmMakefile::AddGlobalLinkInformation(cmTarget& target)
     std::vector<std::string> linkDirs;
     cmSystemTools::ExpandListArgument(linkDirsProp, linkDirs);
 
-    for (std::string const& linkDir : linkDirs) {
-      std::string newdir = linkDir;
-      // remove trailing slashes
-      if (*linkDir.rbegin() == '/') {
-        newdir = linkDir.substr(0, linkDir.size() - 1);
-      }
+    for (std::string& linkDir : linkDirs) {
+      // Sanitize the path the same way the link_directories command does
+      // in case projects set the LINK_DIRECTORIES property directly.
+      cmSystemTools::ConvertToUnixSlashes(linkDir);
       target.AddLinkDirectory(linkDir);
     }
   }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=050ddfb3f3236fd03c72f7dc936332eed6b3997f
commit 050ddfb3f3236fd03c72f7dc936332eed6b3997f
Author:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
AuthorDate: Tue Apr 3 17:28:08 2018 -0400
Commit:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
CommitDate: Tue Apr 3 17:28:08 2018 -0400

    cmXMLWriter: code improvement
    
    New Indent member will be used for XML indentation

diff --git a/Source/cmXMLWriter.cxx b/Source/cmXMLWriter.cxx
index 3cbc70d..9d2a3c4 100644
--- a/Source/cmXMLWriter.cxx
+++ b/Source/cmXMLWriter.cxx
@@ -9,6 +9,7 @@ cmXMLWriter::cmXMLWriter(std::ostream& output, std::size_t level)
   : Output(output)
   , IndentationElement(1, '\t')
   , Level(level)
+  , Indent(0)
   , ElementOpen(false)
   , BreakAttrib(false)
   , IsContent(false)
@@ -17,7 +18,7 @@ cmXMLWriter::cmXMLWriter(std::ostream& output, std::size_t level)
 
 cmXMLWriter::~cmXMLWriter()
 {
-  assert(this->Elements.empty());
+  assert(this->Indent == 0);
 }
 
 void cmXMLWriter::StartDocument(const char* encoding)
@@ -27,27 +28,29 @@ void cmXMLWriter::StartDocument(const char* encoding)
 
 void cmXMLWriter::EndDocument()
 {
-  assert(this->Elements.empty());
+  assert(this->Indent == 0);
   this->Output << '\n';
 }
 
 void cmXMLWriter::StartElement(std::string const& name)
 {
   this->CloseStartElement();
-  this->ConditionalLineBreak(!this->IsContent, this->Elements.size());
+  this->ConditionalLineBreak(!this->IsContent);
   this->Output << '<' << name;
   this->Elements.push(name);
+  ++this->Indent;
   this->ElementOpen = true;
   this->BreakAttrib = false;
 }
 
 void cmXMLWriter::EndElement()
 {
-  assert(!this->Elements.empty());
+  assert(this->Indent > 0);
+  --this->Indent;
   if (this->ElementOpen) {
     this->Output << "/>";
   } else {
-    this->ConditionalLineBreak(!this->IsContent, this->Elements.size() - 1);
+    this->ConditionalLineBreak(!this->IsContent);
     this->IsContent = false;
     this->Output << "</" << this->Elements.top() << '>';
   }
@@ -58,7 +61,7 @@ void cmXMLWriter::EndElement()
 void cmXMLWriter::Element(const char* name)
 {
   this->CloseStartElement();
-  this->ConditionalLineBreak(!this->IsContent, this->Elements.size());
+  this->ConditionalLineBreak(!this->IsContent);
   this->Output << '<' << name << "/>";
 }
 
@@ -70,7 +73,7 @@ void cmXMLWriter::BreakAttributes()
 void cmXMLWriter::Comment(const char* comment)
 {
   this->CloseStartElement();
-  this->ConditionalLineBreak(!this->IsContent, this->Elements.size());
+  this->ConditionalLineBreak(!this->IsContent);
   this->Output << "<!-- " << comment << " -->";
 }
 
@@ -83,14 +86,14 @@ void cmXMLWriter::CData(std::string const& data)
 void cmXMLWriter::Doctype(const char* doctype)
 {
   this->CloseStartElement();
-  this->ConditionalLineBreak(!this->IsContent, this->Elements.size());
+  this->ConditionalLineBreak(!this->IsContent);
   this->Output << "<!DOCTYPE " << doctype << ">";
 }
 
 void cmXMLWriter::ProcessingInstruction(const char* target, const char* data)
 {
   this->CloseStartElement();
-  this->ConditionalLineBreak(!this->IsContent, this->Elements.size());
+  this->ConditionalLineBreak(!this->IsContent);
   this->Output << "<?" << target << ' ' << data << "?>";
 }
 
@@ -106,11 +109,11 @@ void cmXMLWriter::SetIndentationElement(std::string const& element)
   this->IndentationElement = element;
 }
 
-void cmXMLWriter::ConditionalLineBreak(bool condition, std::size_t indent)
+void cmXMLWriter::ConditionalLineBreak(bool condition)
 {
   if (condition) {
     this->Output << '\n';
-    for (std::size_t i = 0; i < indent + this->Level; ++i) {
+    for (std::size_t i = 0; i < this->Indent + this->Level; ++i) {
       this->Output << this->IndentationElement;
     }
   }
@@ -119,7 +122,7 @@ void cmXMLWriter::ConditionalLineBreak(bool condition, std::size_t indent)
 void cmXMLWriter::PreAttribute()
 {
   assert(this->ElementOpen);
-  this->ConditionalLineBreak(this->BreakAttrib, this->Elements.size());
+  this->ConditionalLineBreak(this->BreakAttrib);
   if (!this->BreakAttrib) {
     this->Output << ' ';
   }
@@ -134,7 +137,7 @@ void cmXMLWriter::PreContent()
 void cmXMLWriter::CloseStartElement()
 {
   if (this->ElementOpen) {
-    this->ConditionalLineBreak(this->BreakAttrib, this->Elements.size());
+    this->ConditionalLineBreak(this->BreakAttrib);
     this->Output << '>';
     this->ElementOpen = false;
   }
diff --git a/Source/cmXMLWriter.h b/Source/cmXMLWriter.h
index 80940ee..ff0df18 100644
--- a/Source/cmXMLWriter.h
+++ b/Source/cmXMLWriter.h
@@ -67,7 +67,7 @@ public:
   void SetIndentationElement(std::string const& element);
 
 private:
-  void ConditionalLineBreak(bool condition, std::size_t indent);
+  void ConditionalLineBreak(bool condition);
 
   void PreAttribute();
   void PreContent();
@@ -128,6 +128,7 @@ private:
   std::stack<std::string, std::vector<std::string>> Elements;
   std::string IndentationElement;
   std::size_t Level;
+  std::size_t Indent;
   bool ElementOpen;
   bool BreakAttrib;
   bool IsContent;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c4f8b4596fb48f5eeea905b7fbdd9350b9e7838
commit 6c4f8b4596fb48f5eeea905b7fbdd9350b9e7838
Author:     Shane Parris <shane.lee.parris at gmail.com>
AuthorDate: Wed Feb 14 11:36:12 2018 -0500
Commit:     Shane Parris <shane.lee.parris at gmail.com>
CommitDate: Sun Apr 1 23:16:13 2018 -0400

    Adjust help documentation for file(GLOB), add topic notes

diff --git a/Help/command/file.rst b/Help/command/file.rst
index 5e18077..43ce3d9 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -98,10 +98,10 @@ command.
 ::
 
   file(GLOB <variable>
-       [LIST_DIRECTORIES true|false] [RELATIVE <path>]
+       [LIST_DIRECTORIES true|false] [RELATIVE <path>] [CONFIGURE_DEPENDS]
        [<globbing-expressions>...])
   file(GLOB_RECURSE <variable> [FOLLOW_SYMLINKS]
-       [LIST_DIRECTORIES true|false] [RELATIVE <path>]
+       [LIST_DIRECTORIES true|false] [RELATIVE <path>] [CONFIGURE_DEPENDS]
        [<globbing-expressions>...])
 
 Generate a list of files that match the ``<globbing-expressions>`` and
@@ -110,6 +110,11 @@ regular expressions, but much simpler.  If ``RELATIVE`` flag is
 specified, the results will be returned as relative paths to the given
 path.  The results will be ordered lexicographically.
 
+If the ``CONFIGURE_DEPENDS`` flag is specified, CMake will add logic
+to the main build system check target to rerun the flagged ``GLOB`` commands
+at build time. If any of the outputs change, CMake will regenerate the build
+system.
+
 By default ``GLOB`` lists directories - directories are omitted in result if
 ``LIST_DIRECTORIES`` is set to false.
 
@@ -118,6 +123,10 @@ By default ``GLOB`` lists directories - directories are omitted in result if
   your source tree.  If no CMakeLists.txt file changes when a source is
   added or removed then the generated build system cannot know when to
   ask CMake to regenerate.
+  The ``CONFIGURE_DEPENDS`` flag may not work reliably on all generators, or if
+  a new generator is added in the future that cannot support it, projects using
+  it will be stuck. Even if ``CONFIGURE_DEPENDS`` works reliably, there is
+  still a cost to perform the check on every rebuild.
 
 Examples of globbing expressions include::
 
diff --git a/Help/release/dev/glob_configure_depends.rst b/Help/release/dev/glob_configure_depends.rst
new file mode 100644
index 0000000..147e44a
--- /dev/null
+++ b/Help/release/dev/glob_configure_depends.rst
@@ -0,0 +1,6 @@
+glob_configure_depends
+----------------------
+
+* The :command:`file(GLOB)` and :command:`file(GLOB_RECURSE)` commands
+  learned a new flag ``CONFIGURE_DEPENDS`` which enables expression of
+  build system dependency on globbed directory's contents.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20612978c8d0880606632bf46f567218eae0b37b
commit 20612978c8d0880606632bf46f567218eae0b37b
Author:     Shane Parris <shane.lee.parris at gmail.com>
AuthorDate: Wed Feb 14 11:35:44 2018 -0500
Commit:     Shane Parris <shane.lee.parris at gmail.com>
CommitDate: Sun Apr 1 23:16:12 2018 -0400

    Add tests for `file(GLOB)` CONFIGURE_DEPENDS flag

diff --git a/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-build-stdout.txt b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-build-stdout.txt
new file mode 100644
index 0000000..71ab721
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-build-stdout.txt
@@ -0,0 +1 @@
+.*b9fbdd8803c036dbe9f5ea6b74db4b9670c78a72
diff --git a/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_first-stdout.txt b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_first-stdout.txt
new file mode 100644
index 0000000..ff90f9c
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_first-stdout.txt
@@ -0,0 +1,2 @@
+.*Running CMake on GLOB-CONFIGURE_DEPENDS-RerunCMake
+.*6bc141b40c0f851d20fa9a1fe5fbdae94acc5de0
diff --git a/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_second-stdout.txt b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_second-stdout.txt
new file mode 100644
index 0000000..cf2a5af
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_second-stdout.txt
@@ -0,0 +1,2 @@
+.*Running CMake on GLOB-CONFIGURE_DEPENDS-RerunCMake
+.*0c3ceab9daa7914fde7410c34cae4049e140aa51
diff --git a/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-stdout.txt b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-stdout.txt
new file mode 100644
index 0000000..66b6c44
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-stdout.txt
@@ -0,0 +1 @@
+.*Running CMake on GLOB-CONFIGURE_DEPENDS-RerunCMake
diff --git a/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake.cmake b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake.cmake
new file mode 100644
index 0000000..fe87c78
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake.cmake
@@ -0,0 +1,10 @@
+message(STATUS "Running CMake on GLOB-CONFIGURE_DEPENDS-RerunCMake")
+file(GLOB_RECURSE
+  CONTENT_LIST
+  CONFIGURE_DEPENDS
+  LIST_DIRECTORIES false
+  RELATIVE "${CMAKE_CURRENT_BINARY_DIR}"
+  "${CMAKE_CURRENT_BINARY_DIR}/test/*"
+  )
+string(SHA1 CONTENT_LIST_HASH "${CONTENT_LIST}")
+add_custom_target(CONTENT_ECHO ALL ${CMAKE_COMMAND} -E echo ${CONTENT_LIST_HASH})
diff --git a/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE-result.txt b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE-stderr.txt b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE-stderr.txt
new file mode 100644
index 0000000..40083c1
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE-stderr.txt
@@ -0,0 +1 @@
+.*CONFIGURE_DEPENDS is invalid for script and find package modes\.
diff --git a/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE.cmake b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE.cmake
new file mode 100644
index 0000000..9dc0f03
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE.cmake
@@ -0,0 +1 @@
+file(GLOB CONTENT_LIST CONFIGURE_DEPENDS)
diff --git a/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-modified-result.txt b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-modified-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-modified-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-modified-stderr.txt b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-modified-stderr.txt
new file mode 100644
index 0000000..d7b36eb
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-modified-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error: The glob expression
+.* at GLOB-error-CONFIGURE_DEPENDS-modified\.cmake:[0-9]+ \(file\)
+was already present in the glob cache but the directory
+contents have changed during the configuration run.
+Matching glob expressions:
+  CONTENT_LIST_1 at GLOB-error-CONFIGURE_DEPENDS-modified\.cmake:[0-9]+ \(file\)
+  CONTENT_LIST_2 at GLOB-error-CONFIGURE_DEPENDS-modified\.cmake:[0-9]+ \(file\)$
diff --git a/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-modified.cmake b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-modified.cmake
new file mode 100644
index 0000000..8d74dea
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-modified.cmake
@@ -0,0 +1,21 @@
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test/first")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test/second")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test/third")
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test/first/one" "one")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test/second/two" "two")
+file(GLOB_RECURSE CONTENT_LIST_1
+  CONFIGURE_DEPENDS
+  "${CMAKE_CURRENT_BINARY_DIR}/test/*"
+  )
+
+file(GLOB_RECURSE CONTENT_LIST_2
+  CONFIGURE_DEPENDS
+  "${CMAKE_CURRENT_BINARY_DIR}/test/*"
+  )
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test/third/three" "three")
+file(GLOB_RECURSE CONTENT_LIST_3
+  CONFIGURE_DEPENDS
+  "${CMAKE_CURRENT_BINARY_DIR}/test/*"
+  )
diff --git a/Tests/RunCMake/file/GLOB-noexp-CONFIGURE_DEPENDS-result.txt b/Tests/RunCMake/file/GLOB-noexp-CONFIGURE_DEPENDS-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-noexp-CONFIGURE_DEPENDS-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/GLOB-noexp-CONFIGURE_DEPENDS-stderr.txt b/Tests/RunCMake/file/GLOB-noexp-CONFIGURE_DEPENDS-stderr.txt
new file mode 100644
index 0000000..01d204f
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-noexp-CONFIGURE_DEPENDS-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at GLOB-noexp-CONFIGURE_DEPENDS\.cmake:[0-9]+ \(file\):
+  file GLOB requires a glob expression after CONFIGURE_DEPENDS\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/file/GLOB-noexp-CONFIGURE_DEPENDS.cmake b/Tests/RunCMake/file/GLOB-noexp-CONFIGURE_DEPENDS.cmake
new file mode 100644
index 0000000..9dc0f03
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-noexp-CONFIGURE_DEPENDS.cmake
@@ -0,0 +1 @@
+file(GLOB CONTENT_LIST CONFIGURE_DEPENDS)
diff --git a/Tests/RunCMake/file/GLOB-warn-CONFIGURE_DEPENDS-late-stderr.txt b/Tests/RunCMake/file/GLOB-warn-CONFIGURE_DEPENDS-late-stderr.txt
new file mode 100644
index 0000000..af722a4
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-warn-CONFIGURE_DEPENDS-late-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Warning \(dev\) at GLOB-warn-CONFIGURE_DEPENDS-late\.cmake:[0-9]+ \(file\):
+  CONFIGURE_DEPENDS flag was given after a glob expression was already
+  evaluated\.
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\.  Use -Wno-dev to suppress it\.$
diff --git a/Tests/RunCMake/file/GLOB-warn-CONFIGURE_DEPENDS-late.cmake b/Tests/RunCMake/file/GLOB-warn-CONFIGURE_DEPENDS-late.cmake
new file mode 100644
index 0000000..0b69552
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB-warn-CONFIGURE_DEPENDS-late.cmake
@@ -0,0 +1,11 @@
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test/first")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test/second")
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test/first/one" "Hi, Mom!")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test/second/two" "Love you!")
+
+file(GLOB CONTENT_LIST
+  "${CMAKE_CURRENT_BINARY_DIR}/test/first/*"
+  CONFIGURE_DEPENDS
+  "${CMAKE_CURRENT_BINARY_DIR}/test/second/*"
+  )
diff --git a/Tests/RunCMake/file/GLOB_RECURSE-warn-CONFIGURE_DEPENDS-ninja-version-stderr.txt b/Tests/RunCMake/file/GLOB_RECURSE-warn-CONFIGURE_DEPENDS-ninja-version-stderr.txt
new file mode 100644
index 0000000..8d22332
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB_RECURSE-warn-CONFIGURE_DEPENDS-ninja-version-stderr.txt
@@ -0,0 +1,13 @@
+^CMake Warning \(dev\):
+  The detected version of Ninja:
+
+    .*
+
+  is less than the version of Ninja required by CMake for adding restat
+  dependencies to the build\.ninja manifest regeneration target:
+
+    1\.8
+
+  Any pre-check scripts, such as those generated for file\(GLOB
+  CONFIGURE_DEPENDS\), will not be run by Ninja\.
+This warning is for project developers\.  Use -Wno-dev to suppress it\.$
diff --git a/Tests/RunCMake/file/GLOB_RECURSE-warn-CONFIGURE_DEPENDS-ninja-version.cmake b/Tests/RunCMake/file/GLOB_RECURSE-warn-CONFIGURE_DEPENDS-ninja-version.cmake
new file mode 100644
index 0000000..8e80895
--- /dev/null
+++ b/Tests/RunCMake/file/GLOB_RECURSE-warn-CONFIGURE_DEPENDS-ninja-version.cmake
@@ -0,0 +1,6 @@
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test/first")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test/first/one" "one")
+file(GLOB_RECURSE CONTENT_LIST
+  CONFIGURE_DEPENDS
+  "${CMAKE_CURRENT_BINARY_DIR}/test/*"
+  )
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index 4aab32d..342606b 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -43,10 +43,79 @@ run_cmake(GLOB-error-FOLLOW_SYMLINKS)
 run_cmake(GLOB-error-LIST_DIRECTORIES-not-boolean)
 run_cmake(GLOB-error-LIST_DIRECTORIES-no-arg)
 run_cmake(GLOB-error-RELATIVE-no-arg)
+run_cmake(GLOB-error-CONFIGURE_DEPENDS-modified)
+run_cmake(GLOB-noexp-CONFIGURE_DEPENDS)
 run_cmake(GLOB-noexp-LIST_DIRECTORIES)
 run_cmake(GLOB-noexp-RELATIVE)
+run_cmake_command(GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE ${CMAKE_COMMAND} -P
+  ${RunCMake_SOURCE_DIR}/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE.cmake)
 
 if(NOT WIN32 OR CYGWIN)
   run_cmake(GLOB_RECURSE-cyclic-recursion)
   run_cmake(INSTALL-SYMLINK)
 endif()
+
+if(RunCMake_GENERATOR STREQUAL "Ninja")
+  # Detect ninja version so we know what tests can be supported.
+  execute_process(
+    COMMAND "${RunCMake_MAKE_PROGRAM}" --version
+    OUTPUT_VARIABLE ninja_out
+    ERROR_VARIABLE ninja_out
+    RESULT_VARIABLE ninja_res
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+  if(ninja_res EQUAL 0 AND "x${ninja_out}" MATCHES "^x[0-9]+\\.[0-9]+")
+    set(ninja_version "${ninja_out}")
+    message(STATUS "ninja version: ${ninja_version}")
+  else()
+    message(FATAL_ERROR "'ninja --version' reported:\n${ninja_out}")
+  endif()
+
+  if("${ninja_version}" VERSION_LESS 1.8)
+    message(STATUS "Ninja is too old for GLOB CONFIGURE_DEPENDS; expect a warning.")
+  endif()
+endif()
+
+if(RunCMake_GENERATOR STREQUAL "Ninja" AND "${ninja_version}" VERSION_LESS 1.8)
+  run_cmake(GLOB_RECURSE-warn-CONFIGURE_DEPENDS-ninja-version)
+else()
+  run_cmake(GLOB-warn-CONFIGURE_DEPENDS-late)
+
+  # Use a single build tree for a few tests without cleaning.
+  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GLOB-CONFIGURE_DEPENDS-RerunCMake-build)
+  set(RunCMake_TEST_NO_CLEAN 1)
+  set(RunCMake_DEFAULT_stderr ".*")
+  if(RunCMake_GENERATOR STREQUAL "Borland Makefiles" OR
+     RunCMake_GENERATOR STREQUAL "Watcom WMake")
+    set(fs_delay 3)
+  else()
+    set(fs_delay 1.125)
+  endif()
+
+  file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+  file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/test")
+  set(tf_1  "${RunCMake_TEST_BINARY_DIR}/test/1.txt")
+  file(WRITE "${tf_1}" "1")
+
+  message(STATUS "GLOB-RerunCMake: first configuration...")
+  run_cmake(GLOB-CONFIGURE_DEPENDS-RerunCMake)
+  run_cmake_command(GLOB-CONFIGURE_DEPENDS-RerunCMake-build ${CMAKE_COMMAND} --build .)
+
+  execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${fs_delay})
+  message(STATUS "GLOB-CONFIGURE_DEPENDS-RerunCMake: add another file...")
+  file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/test/sub")
+  set(tf_2  "${RunCMake_TEST_BINARY_DIR}/test/sub/2.txt")
+  file(WRITE "${tf_2}" "2")
+  run_cmake_command(GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_first ${CMAKE_COMMAND} --build .)
+  run_cmake_command(GLOB-CONFIGURE_DEPENDS-RerunCMake-nowork ${CMAKE_COMMAND} --build .)
+
+  execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${fs_delay})
+  message(STATUS "GLOB-CONFIGURE_DEPENDS-RerunCMake: remove first test file...")
+  file(REMOVE "${RunCMake_TEST_BINARY_DIR}/test/1.txt")
+  run_cmake_command(GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_second ${CMAKE_COMMAND} --build .)
+  run_cmake_command(GLOB-CONFIGURE_DEPENDS-RerunCMake-nowork ${CMAKE_COMMAND} --build .)
+
+  unset(RunCMake_TEST_BINARY_DIR)
+  unset(RunCMake_TEST_NO_CLEAN)
+  unset(RunCMake_DEFAULT_stderr)
+endif()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f4b81f54096a90e2887ece75fff6cf4a8b93541
commit 3f4b81f54096a90e2887ece75fff6cf4a8b93541
Author:     Shane Parris <shane.lee.parris at gmail.com>
AuthorDate: Wed Feb 14 11:34:35 2018 -0500
Commit:     Shane Parris <shane.lee.parris at gmail.com>
CommitDate: Sun Apr 1 23:16:12 2018 -0400

    Add glob verify support to XCode, VS, Ninja, and Makefile generators

diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 55a403e..d562df7 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -475,6 +475,7 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm)
   , PolicyCMP0058(cmPolicies::WARN)
   , NinjaSupportsConsolePool(false)
   , NinjaSupportsImplicitOuts(false)
+  , NinjaSupportsManifestRestat(false)
   , NinjaSupportsDyndeps(0)
 {
 #ifdef _WIN32
@@ -597,6 +598,9 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
   this->NinjaSupportsImplicitOuts = !cmSystemTools::VersionCompare(
     cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
     this->RequiredNinjaVersionForImplicitOuts().c_str());
+  this->NinjaSupportsManifestRestat = !cmSystemTools::VersionCompare(
+    cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
+    RequiredNinjaVersionForManifestRestat().c_str());
   {
     // Our ninja branch adds ".dyndep-#" to its version number,
     // where '#' is a feature-specific version number.  Extract it.
@@ -1361,6 +1365,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
             /*generator=*/true);
 
   cmNinjaDeps implicitDeps;
+  cmNinjaDeps explicitDeps;
   for (cmLocalGenerator* localGen : this->LocalGenerators) {
     std::vector<std::string> const& lf =
       localGen->GetMakefile()->GetListFiles();
@@ -1370,10 +1375,6 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
   }
   implicitDeps.push_back(this->CMakeCacheFile);
 
-  std::sort(implicitDeps.begin(), implicitDeps.end());
-  implicitDeps.erase(std::unique(implicitDeps.begin(), implicitDeps.end()),
-                     implicitDeps.end());
-
   cmNinjaVars variables;
   // Use 'console' pool to get non buffered output of the CMake re-run call
   // Available since Ninja 1.5
@@ -1381,12 +1382,71 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
     variables["pool"] = "console";
   }
 
+  cmake* cm = this->GetCMakeInstance();
+  if (this->SupportsManifestRestat() && cm->DoWriteGlobVerifyTarget()) {
+    std::ostringstream verify_cmd;
+    verify_cmd << lg->ConvertToOutputFormat(cmSystemTools::GetCMakeCommand(),
+                                            cmOutputConverter::SHELL)
+               << " -P "
+               << lg->ConvertToOutputFormat(cm->GetGlobVerifyScript(),
+                                            cmOutputConverter::SHELL);
+
+    WriteRule(*this->RulesFileStream, "VERIFY_GLOBS", verify_cmd.str(),
+              "Re-checking globbed directories...",
+              "Rule for re-checking globbed directories.",
+              /*depfile=*/"",
+              /*deptype=*/"",
+              /*rspfile=*/"",
+              /*rspcontent*/ "",
+              /*restat=*/"",
+              /*generator=*/true);
+
+    std::string verifyForce = cm->GetGlobVerifyScript() + "_force";
+    cmNinjaDeps verifyForceDeps(1, this->NinjaOutputPath(verifyForce));
+
+    this->WritePhonyBuild(os, "Phony target to force glob verification run.",
+                          verifyForceDeps, cmNinjaDeps());
+
+    variables["restat"] = "1";
+    std::string const verifyScriptFile =
+      this->NinjaOutputPath(cm->GetGlobVerifyScript());
+    std::string const verifyStampFile =
+      this->NinjaOutputPath(cm->GetGlobVerifyStamp());
+    this->WriteBuild(os,
+                     "Re-run CMake to check if globbed directories changed.",
+                     "VERIFY_GLOBS",
+                     /*outputs=*/cmNinjaDeps(1, verifyStampFile),
+                     /*implicitOuts=*/cmNinjaDeps(),
+                     /*explicitDeps=*/cmNinjaDeps(),
+                     /*implicitDeps=*/verifyForceDeps,
+                     /*orderOnlyDeps=*/cmNinjaDeps(), variables);
+
+    variables.erase("restat");
+    implicitDeps.push_back(verifyScriptFile);
+    explicitDeps.push_back(verifyStampFile);
+  } else if (!this->SupportsManifestRestat() &&
+             cm->DoWriteGlobVerifyTarget()) {
+    std::ostringstream msg;
+    msg << "The detected version of Ninja:\n"
+        << "  " << this->NinjaVersion << "\n"
+        << "is less than the version of Ninja required by CMake for adding "
+           "restat dependencies to the build.ninja manifest regeneration "
+           "target:\n"
+        << "  " << this->RequiredNinjaVersionForManifestRestat() << "\n";
+    msg << "Any pre-check scripts, such as those generated for file(GLOB "
+           "CONFIGURE_DEPENDS), will not be run by Ninja.";
+    this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
+  }
+
+  std::sort(implicitDeps.begin(), implicitDeps.end());
+  implicitDeps.erase(std::unique(implicitDeps.begin(), implicitDeps.end()),
+                     implicitDeps.end());
+
   std::string const ninjaBuildFile = this->NinjaOutputPath(NINJA_BUILD_FILE);
   this->WriteBuild(os, "Re-run CMake if any of its inputs changed.",
                    "RERUN_CMAKE",
                    /*outputs=*/cmNinjaDeps(1, ninjaBuildFile),
-                   /*implicitOuts=*/cmNinjaDeps(),
-                   /*explicitDeps=*/cmNinjaDeps(), implicitDeps,
+                   /*implicitOuts=*/cmNinjaDeps(), explicitDeps, implicitDeps,
                    /*orderOnlyDeps=*/cmNinjaDeps(), variables);
 
   cmNinjaDeps missingInputs;
@@ -1419,6 +1479,11 @@ bool cmGlobalNinjaGenerator::SupportsImplicitOuts() const
   return this->NinjaSupportsImplicitOuts;
 }
 
+bool cmGlobalNinjaGenerator::SupportsManifestRestat() const
+{
+  return this->NinjaSupportsManifestRestat;
+}
+
 void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
 {
   WriteRule(*this->RulesFileStream, "CLEAN", ninjaCmd() + " -t clean",
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 7f80d08..a779919 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -346,8 +346,10 @@ public:
   static std::string RequiredNinjaVersion() { return "1.3"; }
   static std::string RequiredNinjaVersionForConsolePool() { return "1.5"; }
   static std::string RequiredNinjaVersionForImplicitOuts() { return "1.7"; }
+  static std::string RequiredNinjaVersionForManifestRestat() { return "1.8"; }
   bool SupportsConsolePool() const;
   bool SupportsImplicitOuts() const;
+  bool SupportsManifestRestat() const;
 
   std::string NinjaOutputPath(std::string const& path) const;
   bool HasOutputPathPrefix() const { return !this->OutputPathPrefix.empty(); }
@@ -460,6 +462,7 @@ private:
   std::string NinjaVersion;
   bool NinjaSupportsConsolePool;
   bool NinjaSupportsImplicitOuts;
+  bool NinjaSupportsManifestRestat;
   unsigned long NinjaSupportsDyndeps;
 
 private:
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index c92df55..a005885 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -301,6 +301,13 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
     lfiles.insert(lfiles.end(), lg->GetMakefile()->GetListFiles().begin(),
                   lg->GetMakefile()->GetListFiles().end());
   }
+
+  cmake* cm = this->GetCMakeInstance();
+  if (cm->DoWriteGlobVerifyTarget()) {
+    lfiles.push_back(cm->GetGlobVerifyScript());
+    lfiles.push_back(cm->GetGlobVerifyStamp());
+  }
+
   // Sort the list and remove duplicates.
   std::sort(lfiles.begin(), lfiles.end(), std::less<std::string>());
 #if !defined(__VMS) // The Compaq STL on VMS crashes, so accept duplicates.
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 87804ff..a4fe3d5 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -209,18 +209,18 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
 {
   // Add a special target on which all other targets depend that
   // checks the build system and optionally re-runs CMake.
-  const char* no_working_directory = 0;
+  // Skip the target if no regeneration is to be done.
+  if (this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION")) {
+    return false;
+  }
+
+  const char* no_working_directory = nullptr;
   std::vector<std::string> no_depends;
   std::vector<cmLocalGenerator*> const& generators = this->LocalGenerators;
   cmLocalVisualStudio7Generator* lg =
     static_cast<cmLocalVisualStudio7Generator*>(generators[0]);
   cmMakefile* mf = lg->GetMakefile();
 
-  // Skip the target if no regeneration is to be done.
-  if (this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION")) {
-    return false;
-  }
-
   cmCustomCommandLines noCommandLines;
   cmTarget* tgt = mf->AddUtilityCommand(
     CMAKE_CHECK_BUILD_SYSTEM_TARGET, cmMakefile::TargetOrigin::Generator,
@@ -266,6 +266,30 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
       listFiles.insert(listFiles.end(), lmf->GetListFiles().begin(),
                        lmf->GetListFiles().end());
     }
+
+    // Add a custom prebuild target to run the VerifyGlobs script.
+    cmake* cm = this->GetCMakeInstance();
+    if (cm->DoWriteGlobVerifyTarget()) {
+      cmCustomCommandLine verifyCommandLine;
+      verifyCommandLine.push_back(cmSystemTools::GetCMakeCommand());
+      verifyCommandLine.push_back("-P");
+      verifyCommandLine.push_back(cm->GetGlobVerifyScript());
+      cmCustomCommandLines verifyCommandLines;
+      verifyCommandLines.push_back(verifyCommandLine);
+      std::vector<std::string> byproducts;
+      byproducts.push_back(cm->GetGlobVerifyStamp());
+
+      mf->AddCustomCommandToTarget(CMAKE_CHECK_BUILD_SYSTEM_TARGET, byproducts,
+                                   no_depends, verifyCommandLines,
+                                   cmTarget::PRE_BUILD, "Checking File Globs",
+                                   no_working_directory, false);
+
+      // Ensure ZERO_CHECK always runs in Visual Studio using MSBuild,
+      // otherwise the prebuild command will not be run.
+      tgt->SetProperty("VS_GLOBAL_DisableFastUpToDateCheck", "true");
+      listFiles.push_back(cm->GetGlobVerifyStamp());
+    }
+
     // Sort the list of input files and remove duplicates.
     std::sort(listFiles.begin(), listFiles.end(), std::less<std::string>());
     std::vector<std::string>::iterator new_end =
@@ -273,8 +297,6 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
     listFiles.erase(new_end, listFiles.end());
 
     // Create a rule to re-run CMake.
-    std::string stampName = cmake::GetCMakeFilesDirectoryPostSlash();
-    stampName += "generate.stamp";
     cmCustomCommandLine commandLine;
     commandLine.push_back(cmSystemTools::GetCMakeCommand());
     std::string argH = "-H";
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f8597af..df671c2 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -537,6 +537,12 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
   std::vector<std::string>::iterator new_end =
     std::unique(lfiles.begin(), lfiles.end());
   lfiles.erase(new_end, lfiles.end());
+
+  cmake* cm = this->GetCMakeInstance();
+  if (cm->DoWriteGlobVerifyTarget()) {
+    lfiles.emplace_back(cm->GetGlobVerifyStamp());
+  }
+
   this->CurrentReRunCMakeMakefile = root->GetCurrentBinaryDirectory();
   this->CurrentReRunCMakeMakefile += "/CMakeScripts";
   cmSystemTools::MakeDirectory(this->CurrentReRunCMakeMakefile.c_str());
@@ -555,14 +561,28 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
     makefileStream << "TARGETS += $(subst $(space),$(spaceplus),$(wildcard "
                    << this->ConvertToRelativeForMake(lfile) << "))\n";
   }
+  makefileStream << "\n";
 
   std::string checkCache = root->GetBinaryDirectory();
   checkCache += "/";
   checkCache += cmake::GetCMakeFilesDirectoryPostSlash();
   checkCache += "cmake.check_cache";
 
-  makefileStream << "\n"
-                 << this->ConvertToRelativeForMake(checkCache)
+  if (cm->DoWriteGlobVerifyTarget()) {
+    makefileStream << ".NOTPARALLEL:\n\n";
+    makefileStream << ".PHONY: all VERIFY_GLOBS\n\n";
+    makefileStream << "all: VERIFY_GLOBS "
+                   << this->ConvertToRelativeForMake(checkCache) << "\n\n";
+    makefileStream << "VERIFY_GLOBS:\n";
+    makefileStream << "\t"
+                   << this->ConvertToRelativeForMake(
+                        cmSystemTools::GetCMakeCommand())
+                   << " -P "
+                   << this->ConvertToRelativeForMake(cm->GetGlobVerifyScript())
+                   << "\n\n";
+  }
+
+  makefileStream << this->ConvertToRelativeForMake(checkCache)
                  << ": $(TARGETS)\n";
   makefileStream << "\t"
                  << this->ConvertToRelativeForMake(
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index c1af92f..c714299 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -197,6 +197,16 @@ void cmLocalNinjaGenerator::WriteNinjaRequiredVersion(std::ostream& os)
       this->GetGlobalNinjaGenerator()->RequiredNinjaVersionForConsolePool();
   }
 
+  // The Ninja generator writes rules which require support for restat
+  // when rebuilding build.ninja manifest (>= 1.8)
+  if (this->GetGlobalNinjaGenerator()->SupportsManifestRestat() &&
+      this->GetCMakeInstance()->DoWriteGlobVerifyTarget() &&
+      !this->GetGlobalNinjaGenerator()->GlobalSettingIsOn(
+        "CMAKE_SUPPRESS_REGENERATION")) {
+    requiredVersion =
+      this->GetGlobalNinjaGenerator()->RequiredNinjaVersionForManifestRestat();
+  }
+
   cmGlobalNinjaGenerator::WriteComment(
     os, "Minimal version of Ninja required by this file");
   os << "ninja_required_version = " << requiredVersion << std::endl
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index c9237a8..cf2a7b9 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -763,6 +763,14 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom(
   if (!this->GlobalGenerator->GlobalSettingIsOn(
         "CMAKE_SUPPRESS_REGENERATION")) {
     // Build command to run CMake to check if anything needs regenerating.
+    std::vector<std::string> commands;
+    cmake* cm = this->GlobalGenerator->GetCMakeInstance();
+    if (cm->DoWriteGlobVerifyTarget()) {
+      std::string rescanRule = "$(CMAKE_COMMAND) -P ";
+      rescanRule += this->ConvertToOutputFormat(cm->GetGlobVerifyScript(),
+                                                cmOutputConverter::SHELL);
+      commands.push_back(rescanRule);
+    }
     std::string cmakefileName = cmake::GetCMakeFilesDirectoryPostSlash();
     cmakefileName += "Makefile.cmake";
     std::string runRule =
@@ -773,7 +781,6 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom(
     runRule += " 0";
 
     std::vector<std::string> no_depends;
-    std::vector<std::string> commands;
     commands.push_back(std::move(runRule));
     if (!this->IsRootMakefile()) {
       this->CreateCDCommand(commands, this->GetBinaryDirectory(),
@@ -1666,6 +1673,13 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
     // write the depend rule, really a recompute depends rule
     depends.clear();
     commands.clear();
+    cmake* cm = this->GlobalGenerator->GetCMakeInstance();
+    if (cm->DoWriteGlobVerifyTarget()) {
+      std::string rescanRule = "$(CMAKE_COMMAND) -P ";
+      rescanRule += this->ConvertToOutputFormat(cm->GetGlobVerifyScript(),
+                                                cmOutputConverter::SHELL);
+      commands.push_back(rescanRule);
+    }
     std::string cmakefileName = cmake::GetCMakeFilesDirectoryPostSlash();
     cmakefileName += "Makefile.cmake";
     {
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index c7bb38c..99a9c94 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -160,10 +160,21 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
   depName += ".depend";
   cmsys::ofstream depFile(depName.c_str());
   depFile << "# CMake generation dependency list for this directory.\n";
-  std::vector<std::string> const& listFiles = this->Makefile->GetListFiles();
-  for (std::vector<std::string>::const_iterator lf = listFiles.begin();
-       lf != listFiles.end(); ++lf) {
-    depFile << *lf << std::endl;
+
+  std::vector<std::string> listFiles(this->Makefile->GetListFiles());
+  cmake* cm = this->GlobalGenerator->GetCMakeInstance();
+  if (cm->DoWriteGlobVerifyTarget()) {
+    listFiles.push_back(cm->GetGlobVerifyStamp());
+  }
+
+  // Sort the list of input files and remove duplicates.
+  std::sort(listFiles.begin(), listFiles.end(), std::less<std::string>());
+  std::vector<std::string>::iterator new_end =
+    std::unique(listFiles.begin(), listFiles.end());
+  listFiles.erase(new_end, listFiles.end());
+
+  for (const std::string& lf : listFiles) {
+    depFile << lf << "\n";
   }
 }
 
@@ -228,6 +239,18 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
     return nullptr;
   }
 
+  std::vector<std::string> listFiles = this->Makefile->GetListFiles();
+  cmake* cm = this->GlobalGenerator->GetCMakeInstance();
+  if (cm->DoWriteGlobVerifyTarget()) {
+    listFiles.push_back(cm->GetGlobVerifyStamp());
+  }
+
+  // Sort the list of input files and remove duplicates.
+  std::sort(listFiles.begin(), listFiles.end(), std::less<std::string>());
+  std::vector<std::string>::iterator new_end =
+    std::unique(listFiles.begin(), listFiles.end());
+  listFiles.erase(new_end, listFiles.end());
+
   std::string stampName = this->GetCurrentBinaryDirectory();
   stampName += "/";
   stampName += cmake::GetCMakeFilesDirectoryPostSlash();
@@ -245,17 +268,14 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
   commandLine.push_back(args);
   commandLine.push_back("--check-stamp-file");
   commandLine.push_back(stampName);
-
-  std::vector<std::string> const& listFiles = this->Makefile->GetListFiles();
-
   cmCustomCommandLines commandLines;
   commandLines.push_back(commandLine);
   const char* no_working_directory = 0;
   std::string fullpathStampName =
     cmSystemTools::CollapseFullPath(stampName.c_str());
   this->Makefile->AddCustomCommandToOutput(
-    fullpathStampName.c_str(), listFiles, makefileIn.c_str(), commandLines,
-    comment.c_str(), no_working_directory, true, false);
+    fullpathStampName, listFiles, makefileIn, commandLines, comment.c_str(),
+    no_working_directory, true, false);
   if (cmSourceFile* file = this->Makefile->GetSource(makefileIn.c_str())) {
     // Finalize the source file path now since we're adding this after
     // the generator validated all project-named sources.
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 41a3a22..2266081 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2465,37 +2465,49 @@ int cmake::Build(const std::string& dir, const std::string& target,
     cmGlobalVisualStudio8Generator::GetGenerateStampList();
 
   // Note that the stampList file only exists for VS generators.
-  if (cmSystemTools::FileExists(stampList) &&
-      !cmakeCheckStampList(stampList.c_str(), false)) {
-
-    // Correctly initialize the home (=source) and home output (=binary)
-    // directories, which is required for running the generation step.
-    std::string homeOrig = this->GetHomeDirectory();
-    std::string homeOutputOrig = this->GetHomeOutputDirectory();
-    this->SetDirectoriesFromFile(cachePath.c_str());
+  if (cmSystemTools::FileExists(stampList)) {
 
+    // Check if running for Visual Studio 9 - we need to explicitly run
+    // the glob verification script before starting the build
     this->AddScriptingCommands();
-    this->AddProjectCommands();
+    if (this->GlobalGenerator->MatchesGeneratorName("Visual Studio 9 2008")) {
+      std::string const globVerifyScript = cachePath + "/" +
+        GetCMakeFilesDirectoryPostSlash() + "VerifyGlobs.cmake";
+      if (cmSystemTools::FileExists(globVerifyScript)) {
+        std::vector<std::string> args;
+        this->ReadListFile(args, globVerifyScript.c_str());
+      }
+    }
 
-    int ret = this->Configure();
-    if (ret) {
-      cmSystemTools::Message("CMake Configure step failed.  "
-                             "Build files cannot be regenerated correctly.");
-      return ret;
-    }
-    ret = this->Generate();
-    if (ret) {
-      cmSystemTools::Message("CMake Generate step failed.  "
-                             "Build files cannot be regenerated correctly.");
-      return ret;
-    }
-    std::string message = "Build files have been written to: ";
-    message += this->GetHomeOutputDirectory();
-    this->UpdateProgress(message.c_str(), -1);
-
-    // Restore the previously set directories to their original value.
-    this->SetHomeDirectory(homeOrig);
-    this->SetHomeOutputDirectory(homeOutputOrig);
+    if (!cmakeCheckStampList(stampList.c_str(), false)) {
+      // Correctly initialize the home (=source) and home output (=binary)
+      // directories, which is required for running the generation step.
+      std::string homeOrig = this->GetHomeDirectory();
+      std::string homeOutputOrig = this->GetHomeOutputDirectory();
+      this->SetDirectoriesFromFile(cachePath.c_str());
+
+      this->AddProjectCommands();
+
+      int ret = this->Configure();
+      if (ret) {
+        cmSystemTools::Message("CMake Configure step failed.  "
+                               "Build files cannot be regenerated correctly.");
+        return ret;
+      }
+      ret = this->Generate();
+      if (ret) {
+        cmSystemTools::Message("CMake Generate step failed.  "
+                               "Build files cannot be regenerated correctly.");
+        return ret;
+      }
+      std::string message = "Build files have been written to: ";
+      message += this->GetHomeOutputDirectory();
+      this->UpdateProgress(message.c_str(), -1);
+
+      // Restore the previously set directories to their original value.
+      this->SetHomeDirectory(homeOrig);
+      this->SetHomeOutputDirectory(homeOutputOrig);
+    }
   }
 #endif
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca0befc2e10da59d2b82e4143ad913eb8322290f
commit ca0befc2e10da59d2b82e4143ad913eb8322290f
Author:     Shane Parris <shane.lee.parris at gmail.com>
AuthorDate: Wed Feb 14 11:30:42 2018 -0500
Commit:     Shane Parris <shane.lee.parris at gmail.com>
CommitDate: Thu Mar 29 10:58:03 2018 -0400

    Add `CONFIGURE_DEPENDS` flag support to cmFileCommand::HandleGlobCommand

diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 90b943b..0d31070 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -758,7 +758,11 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
   }
 
   std::vector<std::string> files;
+  bool configureDepends = false;
+  bool warnConfigureLate = false;
   bool warnFollowedSymlinks = false;
+  const cmake::WorkingMode workingMode =
+    this->Makefile->GetCMakeInstance()->GetWorkingMode();
   while (i != args.end()) {
     if (*i == "LIST_DIRECTORIES") {
       ++i;
@@ -807,6 +811,27 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
         this->SetError("GLOB requires a glob expression after the directory.");
         return false;
       }
+    } else if (*i == "CONFIGURE_DEPENDS") {
+      // Generated build system depends on glob results
+      if (!configureDepends && warnConfigureLate) {
+        this->Makefile->IssueMessage(
+          cmake::AUTHOR_WARNING,
+          "CONFIGURE_DEPENDS flag was given after a glob expression was "
+          "already evaluated.");
+      }
+      if (workingMode != cmake::NORMAL_MODE) {
+        this->Makefile->IssueMessage(
+          cmake::FATAL_ERROR,
+          "CONFIGURE_DEPENDS is invalid for script and find package modes.");
+        return false;
+      }
+      configureDepends = true;
+      ++i;
+      if (i == args.end()) {
+        this->SetError(
+          "GLOB requires a glob expression after CONFIGURE_DEPENDS.");
+        return false;
+      }
     } else {
       std::string expr = *i;
       if (!cmsys::SystemTools::FileIsFullPath(*i)) {
@@ -849,6 +874,19 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
 
       std::vector<std::string>& foundFiles = g.GetFiles();
       files.insert(files.end(), foundFiles.begin(), foundFiles.end());
+
+      if (configureDepends) {
+        std::sort(foundFiles.begin(), foundFiles.end());
+        foundFiles.erase(std::unique(foundFiles.begin(), foundFiles.end()),
+                         foundFiles.end());
+        this->Makefile->GetCMakeInstance()->AddGlobCacheEntry(
+          recurse, (recurse ? g.GetRecurseListDirs() : g.GetListDirs()),
+          (recurse ? g.GetRecurseThroughSymlinks() : false),
+          (g.GetRelative() ? g.GetRelative() : ""), expr, foundFiles, variable,
+          this->Makefile->GetBacktrace());
+      } else {
+        warnConfigureLate = true;
+      }
       ++i;
     }
   }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=599c93e22d02d34d763d0156fcd29bb2930dec07
commit 599c93e22d02d34d763d0156fcd29bb2930dec07
Author:     Shane Parris <shane.lee.parris at gmail.com>
AuthorDate: Wed Feb 14 11:26:35 2018 -0500
Commit:     Shane Parris <shane.lee.parris at gmail.com>
CommitDate: Thu Mar 29 10:58:03 2018 -0400

    Add cmGlobVerificationManager class, integrate with cmake and cmState

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index e547356..e23b070 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -246,6 +246,8 @@ set(SRCS
   cmGlobalGeneratorFactory.h
   cmGlobalUnixMakefileGenerator3.cxx
   cmGlobalUnixMakefileGenerator3.h
+  cmGlobVerificationManager.cxx
+  cmGlobVerificationManager.h
   cmGraphAdjacencyList.h
   cmGraphVizWriter.cxx
   cmGraphVizWriter.h
diff --git a/Source/cmGlobVerificationManager.cxx b/Source/cmGlobVerificationManager.cxx
new file mode 100644
index 0000000..e23b6ea
--- /dev/null
+++ b/Source/cmGlobVerificationManager.cxx
@@ -0,0 +1,172 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#include "cmGlobVerificationManager.h"
+
+#include "cmsys/FStream.hxx"
+#include <sstream>
+
+#include "cmGeneratedFileStream.h"
+#include "cmListFileCache.h"
+#include "cmSystemTools.h"
+#include "cmVersion.h"
+#include "cmake.h"
+
+bool cmGlobVerificationManager::SaveVerificationScript(const std::string& path)
+{
+  if (this->Cache.empty()) {
+    return true;
+  }
+
+  std::string scriptFile = path;
+  scriptFile += cmake::GetCMakeFilesDirectory();
+  std::string stampFile = scriptFile;
+  cmSystemTools::MakeDirectory(scriptFile);
+  scriptFile += "/VerifyGlobs.cmake";
+  stampFile += "/cmake.verify_globs";
+  cmGeneratedFileStream verifyScriptFile(scriptFile.c_str());
+  verifyScriptFile.SetCopyIfDifferent(true);
+  if (!verifyScriptFile) {
+    cmSystemTools::Error("Unable to open verification script file for save. ",
+                         scriptFile.c_str());
+    cmSystemTools::ReportLastSystemError("");
+    return false;
+  }
+
+  verifyScriptFile << std::boolalpha;
+  verifyScriptFile << "# CMAKE generated file: DO NOT EDIT!\n"
+                   << "# Generated by CMake Version "
+                   << cmVersion::GetMajorVersion() << "."
+                   << cmVersion::GetMinorVersion() << "\n";
+
+  for (auto const& i : this->Cache) {
+    CacheEntryKey k = std::get<0>(i);
+    CacheEntryValue v = std::get<1>(i);
+
+    if (!v.Initialized) {
+      continue;
+    }
+
+    verifyScriptFile << "\n";
+
+    for (auto const& bt : v.Backtraces) {
+      verifyScriptFile << "# " << std::get<0>(bt);
+      std::get<1>(bt).PrintTitle(verifyScriptFile);
+      verifyScriptFile << "\n";
+    }
+
+    k.PrintGlobCommand(verifyScriptFile, "NEW_GLOB");
+    verifyScriptFile << "\n";
+
+    verifyScriptFile << "set(OLD_GLOB\n";
+    for (const std::string& file : v.Files) {
+      verifyScriptFile << "  \"" << file << "\"\n";
+    }
+    verifyScriptFile << "  )\n";
+
+    verifyScriptFile << "if(NOT \"${NEW_GLOB}\" STREQUAL \"${OLD_GLOB}\")\n"
+                     << "  message(\"-- GLOB mismatch!\")\n"
+                     << "  file(TOUCH_NOCREATE \"" << stampFile << "\")\n"
+                     << "endif()\n";
+  }
+  verifyScriptFile.Close();
+
+  cmsys::ofstream verifyStampFile(stampFile.c_str());
+  if (!verifyStampFile) {
+    cmSystemTools::Error("Unable to open verification stamp file for write. ",
+                         stampFile.c_str());
+    return false;
+  }
+  verifyStampFile << "# This file is generated by CMake for checking of the "
+                     "VerifyGlobs.cmake file\n";
+  this->VerifyScript = scriptFile;
+  this->VerifyStamp = stampFile;
+  return true;
+}
+
+bool cmGlobVerificationManager::DoWriteVerifyTarget() const
+{
+  return !this->VerifyScript.empty() && !this->VerifyStamp.empty();
+}
+
+bool cmGlobVerificationManager::CacheEntryKey::operator<(
+  const CacheEntryKey& r) const
+{
+  if (this->Recurse < r.Recurse) {
+    return true;
+  }
+  if (this->Recurse > r.Recurse) {
+    return false;
+  }
+  if (this->ListDirectories < r.ListDirectories) {
+    return true;
+  }
+  if (this->ListDirectories > r.ListDirectories) {
+    return false;
+  }
+  if (this->FollowSymlinks < r.FollowSymlinks) {
+    return true;
+  }
+  if (this->FollowSymlinks > r.FollowSymlinks) {
+    return false;
+  }
+  if (this->Relative < r.Relative) {
+    return true;
+  }
+  if (this->Relative > r.Relative) {
+    return false;
+  }
+  if (this->Expression < r.Expression) {
+    return true;
+  }
+  if (this->Expression > r.Expression) {
+    return false;
+  }
+  return false;
+}
+
+void cmGlobVerificationManager::CacheEntryKey::PrintGlobCommand(
+  std::ostream& out, const std::string& cmdVar)
+{
+  out << "file(GLOB" << (this->Recurse ? "_RECURSE " : " ");
+  out << cmdVar << " ";
+  if (this->Recurse && this->FollowSymlinks) {
+    out << "FOLLOW_SYMLINKS ";
+  }
+  out << "LIST_DIRECTORIES " << this->ListDirectories << " ";
+  if (!this->Relative.empty()) {
+    out << "RELATIVE \"" << this->Relative << "\" ";
+  }
+  out << "\"" << this->Expression << "\")";
+}
+
+void cmGlobVerificationManager::AddCacheEntry(
+  const bool recurse, const bool listDirectories, const bool followSymlinks,
+  const std::string& relative, const std::string& expression,
+  const std::vector<std::string>& files, const std::string& variable,
+  const cmListFileBacktrace& backtrace)
+{
+  CacheEntryKey key = CacheEntryKey(recurse, listDirectories, followSymlinks,
+                                    relative, expression);
+  CacheEntryValue& value = this->Cache[key];
+  if (!value.Initialized) {
+    value.Files = files;
+    value.Initialized = true;
+    value.Backtraces.emplace_back(variable, backtrace);
+  } else if (value.Initialized && value.Files != files) {
+    std::ostringstream message;
+    message << std::boolalpha;
+    message << "The glob expression\n";
+    key.PrintGlobCommand(message, variable);
+    backtrace.PrintTitle(message);
+    message << "\nwas already present in the glob cache but the directory\n"
+               "contents have changed during the configuration run.\n";
+    message << "Matching glob expressions:";
+    for (auto const& bt : value.Backtraces) {
+      message << "\n  " << std::get<0>(bt);
+      std::get<1>(bt).PrintTitle(message);
+    }
+    cmSystemTools::Error(message.str().c_str());
+  } else {
+    value.Backtraces.emplace_back(variable, backtrace);
+  }
+}
diff --git a/Source/cmGlobVerificationManager.h b/Source/cmGlobVerificationManager.h
new file mode 100644
index 0000000..4508602
--- /dev/null
+++ b/Source/cmGlobVerificationManager.h
@@ -0,0 +1,89 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#ifndef cmGlobVerificationManager_h
+#define cmGlobVerificationManager_h
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include "cmListFileCache.h"
+
+#include <iosfwd>
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>
+
+/** \class cmGlobVerificationManager
+ * \brief Class for expressing build-time dependencies on glob expressions.
+ *
+ * Generates a CMake script which verifies glob outputs during prebuild.
+ *
+ */
+class cmGlobVerificationManager
+{
+public:
+  cmGlobVerificationManager() {}
+
+protected:
+  ///! Save verification script for given makefile.
+  ///! Saves to output <path>/<CMakeFilesDirectory>/VerifyGlobs.cmake
+  bool SaveVerificationScript(const std::string& path);
+
+  ///! Add an entry into the glob cache
+  void AddCacheEntry(bool recurse, bool listDirectories, bool followSymlinks,
+                     const std::string& relative,
+                     const std::string& expression,
+                     const std::vector<std::string>& files,
+                     const std::string& variable,
+                     const cmListFileBacktrace& bt);
+
+  ///! Check targets should be written in generated build system.
+  bool DoWriteVerifyTarget() const;
+
+  ///! Get the paths to the generated script and stamp files
+  std::string const& GetVerifyScript() const { return this->VerifyScript; }
+  std::string const& GetVerifyStamp() const { return this->VerifyStamp; }
+
+private:
+  struct CacheEntryKey
+  {
+    const bool Recurse;
+    const bool ListDirectories;
+    const bool FollowSymlinks;
+    const std::string Relative;
+    const std::string Expression;
+    CacheEntryKey(const bool rec, const bool l, const bool s,
+                  const std::string& rel, const std::string& e)
+      : Recurse(rec)
+      , ListDirectories(l)
+      , FollowSymlinks(s)
+      , Relative(rel)
+      , Expression(e)
+    {
+    }
+    bool operator<(const CacheEntryKey& r) const;
+    void PrintGlobCommand(std::ostream& out, const std::string& cmdVar);
+  };
+
+  struct CacheEntryValue
+  {
+    bool Initialized;
+    std::vector<std::string> Files;
+    std::vector<std::pair<std::string, cmListFileBacktrace>> Backtraces;
+    CacheEntryValue()
+      : Initialized(false)
+    {
+    }
+  };
+
+  typedef std::map<CacheEntryKey, CacheEntryValue> CacheEntryMap;
+  CacheEntryMap Cache;
+  std::string VerifyScript;
+  std::string VerifyStamp;
+
+  // Only cmState should be able to add cache values.
+  // cmGlobVerificationManager should never be used directly.
+  friend class cmState; // allow access to add cache values
+};
+
+#endif
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index bb891b5..a93fb11 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -13,6 +13,7 @@
 #include "cmCommand.h"
 #include "cmDefinitions.h"
 #include "cmDisallowedCommand.h"
+#include "cmGlobVerificationManager.h"
 #include "cmListFileCache.h"
 #include "cmStatePrivate.h"
 #include "cmStateSnapshot.h"
@@ -31,11 +32,13 @@ cmState::cmState()
   , MSYSShell(false)
 {
   this->CacheManager = new cmCacheManager;
+  this->GlobVerificationManager = new cmGlobVerificationManager;
 }
 
 cmState::~cmState()
 {
   delete this->CacheManager;
+  delete this->GlobVerificationManager;
   cmDeleteAll(this->BuiltinCommands);
   cmDeleteAll(this->ScriptedCommands);
 }
@@ -207,6 +210,39 @@ void cmState::AddCacheEntry(const std::string& key, const char* value,
   this->CacheManager->AddCacheEntry(key, value, helpString, type);
 }
 
+bool cmState::DoWriteGlobVerifyTarget() const
+{
+  return this->GlobVerificationManager->DoWriteVerifyTarget();
+}
+
+std::string const& cmState::GetGlobVerifyScript() const
+{
+  return this->GlobVerificationManager->GetVerifyScript();
+}
+
+std::string const& cmState::GetGlobVerifyStamp() const
+{
+  return this->GlobVerificationManager->GetVerifyStamp();
+}
+
+bool cmState::SaveVerificationScript(const std::string& path)
+{
+  return this->GlobVerificationManager->SaveVerificationScript(path);
+}
+
+void cmState::AddGlobCacheEntry(bool recurse, bool listDirectories,
+                                bool followSymlinks,
+                                const std::string& relative,
+                                const std::string& expression,
+                                const std::vector<std::string>& files,
+                                const std::string& variable,
+                                cmListFileBacktrace const& backtrace)
+{
+  this->GlobVerificationManager->AddCacheEntry(
+    recurse, listDirectories, followSymlinks, relative, expression, files,
+    variable, backtrace);
+}
+
 void cmState::RemoveCacheEntry(std::string const& key)
 {
   this->CacheManager->RemoveCacheEntry(key);
diff --git a/Source/cmState.h b/Source/cmState.h
index 6cbf82d..4c6fc69 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -12,6 +12,7 @@
 
 #include "cmDefinitions.h"
 #include "cmLinkedTree.h"
+#include "cmListFileCache.h"
 #include "cmPolicies.h"
 #include "cmProperty.h"
 #include "cmPropertyDefinitionMap.h"
@@ -21,6 +22,7 @@
 
 class cmCacheManager;
 class cmCommand;
+class cmGlobVerificationManager;
 class cmPropertyDefinition;
 class cmStateSnapshot;
 class cmMessenger;
@@ -165,12 +167,24 @@ private:
                      const char* helpString,
                      cmStateEnums::CacheEntryType type);
 
+  bool DoWriteGlobVerifyTarget() const;
+  std::string const& GetGlobVerifyScript() const;
+  std::string const& GetGlobVerifyStamp() const;
+  bool SaveVerificationScript(const std::string& path);
+  void AddGlobCacheEntry(bool recurse, bool listDirectories,
+                         bool followSymlinks, const std::string& relative,
+                         const std::string& expression,
+                         const std::vector<std::string>& files,
+                         const std::string& variable,
+                         cmListFileBacktrace const& bt);
+
   std::map<cmProperty::ScopeType, cmPropertyDefinitionMap> PropertyDefinitions;
   std::vector<std::string> EnabledLanguages;
   std::map<std::string, cmCommand*> BuiltinCommands;
   std::map<std::string, cmCommand*> ScriptedCommands;
   cmPropertyMap GlobalProperties;
   cmCacheManager* CacheManager;
+  cmGlobVerificationManager* GlobVerificationManager;
 
   cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>
     BuildsystemDirectory;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 323bcf6..41a3a22 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1434,6 +1434,7 @@ int cmake::ActualConfigure()
 
   // only save the cache if there were no fatal errors
   if (this->GetWorkingMode() == NORMAL_MODE) {
+    this->State->SaveVerificationScript(this->GetHomeOutputDirectory());
     this->SaveCache(this->GetHomeOutputDirectory());
   }
   if (cmSystemTools::GetErrorOccuredFlag()) {
@@ -1649,6 +1650,33 @@ void cmake::AddCacheEntry(const std::string& key, const char* value,
   this->UnwatchUnusedCli(key);
 }
 
+bool cmake::DoWriteGlobVerifyTarget() const
+{
+  return this->State->DoWriteGlobVerifyTarget();
+}
+
+std::string const& cmake::GetGlobVerifyScript() const
+{
+  return this->State->GetGlobVerifyScript();
+}
+
+std::string const& cmake::GetGlobVerifyStamp() const
+{
+  return this->State->GetGlobVerifyStamp();
+}
+
+void cmake::AddGlobCacheEntry(bool recurse, bool listDirectories,
+                              bool followSymlinks, const std::string& relative,
+                              const std::string& expression,
+                              const std::vector<std::string>& files,
+                              const std::string& variable,
+                              cmListFileBacktrace const& backtrace)
+{
+  this->State->AddGlobCacheEntry(recurse, listDirectories, followSymlinks,
+                                 relative, expression, files, variable,
+                                 backtrace);
+}
+
 std::string cmake::StripExtension(const std::string& file) const
 {
   auto dotpos = file.rfind('.');
diff --git a/Source/cmake.h b/Source/cmake.h
index 1ac549b..5e4930d 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -255,6 +255,16 @@ public:
   void AddCacheEntry(const std::string& key, const char* value,
                      const char* helpString, int type);
 
+  bool DoWriteGlobVerifyTarget() const;
+  std::string const& GetGlobVerifyScript() const;
+  std::string const& GetGlobVerifyStamp() const;
+  void AddGlobCacheEntry(bool recurse, bool listDirectories,
+                         bool followSymlinks, const std::string& relative,
+                         const std::string& expression,
+                         const std::vector<std::string>& files,
+                         const std::string& variable,
+                         cmListFileBacktrace const& bt);
+
   /**
    * Get the system information and write it to the file specified
    */
diff --git a/bootstrap b/bootstrap
index 3d5b0d0..3bcab60 100755
--- a/bootstrap
+++ b/bootstrap
@@ -332,6 +332,7 @@ CMAKE_CXX_SOURCES="\
   cmGlobalCommonGenerator \
   cmGlobalGenerator \
   cmGlobalUnixMakefileGenerator3 \
+  cmGlobVerificationManager \
   cmHexFileConverter \
   cmIfCommand \
   cmIncludeCommand \

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

Summary of changes:
 .gitignore                                         |    3 +
 Help/command/file.rst                              |   13 +-
 Help/release/dev/glob_configure_depends.rst        |    6 +
 Source/CMakeLists.txt                              |    2 +
 Source/CTest/cmCTestCurl.h                         |    2 +-
 Source/cmAlgorithms.h                              |    2 +-
 Source/cmCacheManager.cxx                          |   18 +-
 Source/cmConfigureFileCommand.h                    |    6 +-
 Source/cmCoreTryCompile.h                          |    2 +-
 Source/cmExportLibraryDependenciesCommand.h        |    2 +-
 Source/cmExternalMakefileProjectGenerator.h        |    2 +-
 Source/cmFileCommand.cxx                           |   38 +++++
 Source/cmGlobVerificationManager.cxx               |  172 ++++++++++++++++++++
 Source/cmGlobVerificationManager.h                 |   89 ++++++++++
 Source/cmGlobalNinjaGenerator.cxx                  |   77 ++++++++-
 Source/cmGlobalNinjaGenerator.h                    |    3 +
 Source/cmGlobalUnixMakefileGenerator3.cxx          |    7 +
 Source/cmGlobalVisualStudio8Generator.cxx          |   38 ++++-
 Source/cmGlobalXCodeGenerator.cxx                  |   24 ++-
 Source/cmInstallFilesCommand.h                     |    2 +-
 Source/cmLocalNinjaGenerator.cxx                   |   10 ++
 Source/cmLocalUnixMakefileGenerator3.cxx           |   16 +-
 Source/cmLocalVisualStudio7Generator.cxx           |   38 ++++-
 Source/cmMacroCommand.cxx                          |    2 +-
 Source/cmMakefile.cxx                              |   10 +-
 Source/cmNinjaTargetGenerator.cxx                  |  158 ++++++++++--------
 Source/cmState.cxx                                 |   36 ++++
 Source/cmState.h                                   |   14 ++
 Source/cmStateSnapshot.cxx                         |   19 +--
 Source/cmTargetLinkLibrariesCommand.h              |    4 +-
 Source/cmTargetPropCommandBase.h                   |    2 +-
 Source/cmVisualStudio10TargetGenerator.cxx         |    4 +-
 Source/cmVisualStudio10TargetGenerator.h           |    2 +-
 Source/cmXMLWriter.cxx                             |   29 ++--
 Source/cmXMLWriter.h                               |    3 +-
 Source/cmake.cxx                                   |   96 +++++++----
 Source/cmake.h                                     |   10 ++
 Tests/RunCMake/CMakeLists.txt                      |    3 +
 Tests/RunCMake/Ninja/RspFileC.cmake                |    2 +
 Tests/RunCMake/Ninja/RspFileCXX.cmake              |    2 +
 Tests/RunCMake/Ninja/RspFileFortran.cmake          |    2 +
 Tests/RunCMake/Ninja/RunCMakeTest.cmake            |    6 +
 ...B-CONFIGURE_DEPENDS-RerunCMake-build-stdout.txt |    1 +
 ...URE_DEPENDS-RerunCMake-rebuild_first-stdout.txt |    2 +
 ...RE_DEPENDS-RerunCMake-rebuild_second-stdout.txt |    2 +
 .../GLOB-CONFIGURE_DEPENDS-RerunCMake-stdout.txt   |    1 +
 .../file/GLOB-CONFIGURE_DEPENDS-RerunCMake.cmake   |   10 ++
 ...error-CONFIGURE_DEPENDS-SCRIPT_MODE-result.txt} |    0
 ...-error-CONFIGURE_DEPENDS-SCRIPT_MODE-stderr.txt |    1 +
 .../GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE.cmake |    1 +
 ...OB-error-CONFIGURE_DEPENDS-modified-result.txt} |    0
 ...LOB-error-CONFIGURE_DEPENDS-modified-stderr.txt |    7 +
 .../GLOB-error-CONFIGURE_DEPENDS-modified.cmake    |   21 +++
 .../GLOB-noexp-CONFIGURE_DEPENDS-result.txt}       |    0
 .../file/GLOB-noexp-CONFIGURE_DEPENDS-stderr.txt   |    4 +
 .../file/GLOB-noexp-CONFIGURE_DEPENDS.cmake        |    1 +
 .../GLOB-warn-CONFIGURE_DEPENDS-late-stderr.txt    |    6 +
 .../file/GLOB-warn-CONFIGURE_DEPENDS-late.cmake    |   11 ++
 ...warn-CONFIGURE_DEPENDS-ninja-version-stderr.txt |   13 ++
 ...URSE-warn-CONFIGURE_DEPENDS-ninja-version.cmake |    6 +
 Tests/RunCMake/file/RunCMakeTest.cmake             |   69 ++++++++
 bootstrap                                          |    1 +
 62 files changed, 953 insertions(+), 180 deletions(-)
 create mode 100644 Help/release/dev/glob_configure_depends.rst
 create mode 100644 Source/cmGlobVerificationManager.cxx
 create mode 100644 Source/cmGlobVerificationManager.h
 create mode 100644 Tests/RunCMake/Ninja/RspFileC.cmake
 create mode 100644 Tests/RunCMake/Ninja/RspFileCXX.cmake
 create mode 100644 Tests/RunCMake/Ninja/RspFileFortran.cmake
 create mode 100644 Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-build-stdout.txt
 create mode 100644 Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_first-stdout.txt
 create mode 100644 Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_second-stdout.txt
 create mode 100644 Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake-stdout.txt
 create mode 100644 Tests/RunCMake/file/GLOB-CONFIGURE_DEPENDS-RerunCMake.cmake
 copy Tests/RunCMake/{Android/BadSYSROOT-result.txt => file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE-result.txt} (100%)
 create mode 100644 Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE-stderr.txt
 create mode 100644 Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE.cmake
 copy Tests/RunCMake/{Android/BadSYSROOT-result.txt => file/GLOB-error-CONFIGURE_DEPENDS-modified-result.txt} (100%)
 create mode 100644 Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-modified-stderr.txt
 create mode 100644 Tests/RunCMake/file/GLOB-error-CONFIGURE_DEPENDS-modified.cmake
 copy Tests/RunCMake/{Android/BadSYSROOT-result.txt => file/GLOB-noexp-CONFIGURE_DEPENDS-result.txt} (100%)
 create mode 100644 Tests/RunCMake/file/GLOB-noexp-CONFIGURE_DEPENDS-stderr.txt
 create mode 100644 Tests/RunCMake/file/GLOB-noexp-CONFIGURE_DEPENDS.cmake
 create mode 100644 Tests/RunCMake/file/GLOB-warn-CONFIGURE_DEPENDS-late-stderr.txt
 create mode 100644 Tests/RunCMake/file/GLOB-warn-CONFIGURE_DEPENDS-late.cmake
 create mode 100644 Tests/RunCMake/file/GLOB_RECURSE-warn-CONFIGURE_DEPENDS-ninja-version-stderr.txt
 create mode 100644 Tests/RunCMake/file/GLOB_RECURSE-warn-CONFIGURE_DEPENDS-ninja-version.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list