[Cmake-commits] CMake branch, master, updated. v3.9.1-720-g20e5f7a

Kitware Robot kwrobot at kitware.com
Tue Sep 5 09:35:10 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  20e5f7a9c97b5311bda969062c659858c9c896c8 (commit)
       via  4defa6c21c0a483db229eb1ddbcbe17002722b21 (commit)
       via  e7de2a7def5d70b00df16039f9ce180b53fc86f1 (commit)
       via  1561748496b10bc74adc731fd1d5e7c733034cba (commit)
       via  2645cb6208ff62cd64deb9862e3eb4d1a81264b3 (commit)
       via  cbf201782205d3e3c7fda33bb1f5828ac13efa1e (commit)
       via  37760743fc50d9ad864e8a83f0da75ab000c22ec (commit)
      from  ad1b9eba85ddb5bc51f862b4001bab6600006ddb (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=20e5f7a9c97b5311bda969062c659858c9c896c8
commit 20e5f7a9c97b5311bda969062c659858c9c896c8
Merge: 4defa6c 1561748
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 5 13:30:58 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Sep 5 09:31:06 2017 -0400

    Merge topic 'ExternalProject-command'
    
    15617484 ExternalProject: Prevent COMMAND from being treated as a true keyword
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1178


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4defa6c21c0a483db229eb1ddbcbe17002722b21
commit 4defa6c21c0a483db229eb1ddbcbe17002722b21
Merge: e7de2a7 2645cb6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 5 13:28:35 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Sep 5 09:28:40 2017 -0400

    Merge topic 'add-FindPatch-module'
    
    2645cb62 FindPatch: Add module to find 'patch' command-line tool
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1184


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e7de2a7def5d70b00df16039f9ce180b53fc86f1
commit e7de2a7def5d70b00df16039f9ce180b53fc86f1
Merge: ad1b9eb cbf2017
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 5 13:27:19 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Sep 5 09:27:22 2017 -0400

    Merge topic 'update-kwsys'
    
    cbf20178 Merge branch 'upstream-KWSys' into update-kwsys
    37760743 KWSys 2017-09-01 (aee0cf59)
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1223


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1561748496b10bc74adc731fd1d5e7c733034cba
commit 1561748496b10bc74adc731fd1d5e7c733034cba
Author:     Craig Scott <craig.scott at crascit.com>
AuthorDate: Wed Aug 23 22:40:49 2017 +0800
Commit:     Craig Scott <craig.scott at crascit.com>
CommitDate: Sat Sep 2 17:53:16 2017 +1000

    ExternalProject: Prevent COMMAND from being treated as a true keyword
    
    The known keywords for each function are obtained by scraping the
    documentation for lines matching a particular regular expression. In
    commit 8842a027 (ExternalProject: Improve documentation, 2017-07-09),
    the docs were overhauled and the COMMAND docs subsequently matched the
    regular expression when they shouldn't have. This made COMMAND appear as
    a true keyword, which thwarted the special handling logic elsewhere for
    the intended use of COMMAND arguments.
    
    This commit contains a workaround for issue #17229 to force a dependency
    of the patch step on the update step to ensure a predictable step order.
    
    Fixes: #17198

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index d92eb5f..912c5ac 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -870,6 +870,14 @@ foreach(line IN LISTS lines)
     set(_ep_keyword_sep)
   elseif("${line}" MATCHES "^ +``([A-Z0-9_]+) [^`]*``$")
     set(_ep_key "${CMAKE_MATCH_1}")
+    # COMMAND should never be included as a keyword,
+    # for ExternalProject_Add(), as it is treated as a
+    # special case by argument parsing as an extension
+    # of a previous ..._COMMAND
+    if("x${_ep_key}x" STREQUAL "xCOMMANDx" AND
+       "x${_ep_func}x" STREQUAL "xExternalProject_Addx")
+      continue()
+    endif()
     #message("  keyword [${_ep_key}]")
     string(APPEND _ep_keywords_${_ep_func}
       "${_ep_keyword_sep}${_ep_key}")
diff --git a/Tests/RunCMake/ExternalProject/MultiCommand-build-stdout.txt b/Tests/RunCMake/ExternalProject/MultiCommand-build-stdout.txt
new file mode 100644
index 0000000..30ebc7d
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/MultiCommand-build-stdout.txt
@@ -0,0 +1,15 @@
+.* *download 1
+.* *download 2
+.* *update 1
+.* *update 2
+.* *patch 1
+.* *patch 2
+.* *configure 1
+.* *configure 2
+.* *build 1
+.* *build 2
+.* *install 1
+.* *install 2
+.* *test 1
+.* *test 2
+.*
diff --git a/Tests/RunCMake/ExternalProject/MultiCommand.cmake b/Tests/RunCMake/ExternalProject/MultiCommand.cmake
new file mode 100644
index 0000000..a8dbfea
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/MultiCommand.cmake
@@ -0,0 +1,30 @@
+cmake_minimum_required(VERSION 3.9)
+
+include(ExternalProject)
+
+# Verify COMMAND keyword is recognised after various *_COMMAND options
+ExternalProject_Add(multiCommand
+  DOWNLOAD_COMMAND  "${CMAKE_COMMAND}" -E echo "download 1"
+           COMMAND  "${CMAKE_COMMAND}" -E echo "download 2"
+  UPDATE_COMMAND    "${CMAKE_COMMAND}" -E echo "update 1"
+         COMMAND    "${CMAKE_COMMAND}" -E echo "update 2"
+  PATCH_COMMAND     "${CMAKE_COMMAND}" -E echo "patch 1"
+        COMMAND     "${CMAKE_COMMAND}" -E echo "patch 2"
+  CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "configure 1"
+            COMMAND "${CMAKE_COMMAND}" -E echo "configure 2"
+  BUILD_COMMAND     "${CMAKE_COMMAND}" -E echo "build 1"
+        COMMAND     "${CMAKE_COMMAND}" -E echo "build 2"
+  TEST_COMMAND      "${CMAKE_COMMAND}" -E echo "test 1"
+       COMMAND      "${CMAKE_COMMAND}" -E echo "test 2"
+  INSTALL_COMMAND   "${CMAKE_COMMAND}" -E echo "install 1"
+          COMMAND   "${CMAKE_COMMAND}" -E echo "install 2"
+)
+
+# Workaround for issue 17229 (missing dependency between update and patch steps)
+ExternalProject_Add_StepTargets(multiCommand NO_DEPENDS update)
+ExternalProject_Add_StepDependencies(multiCommand patch multiCommand-update)
+
+# Force all steps to be re-run by removing timestamps from any previous run
+ExternalProject_Get_Property(multiCommand STAMP_DIR)
+file(REMOVE_RECURSE "${STAMP_DIR}")
+file(MAKE_DIRECTORY "${STAMP_DIR}")
diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
index 47d6129..994e2aa 100644
--- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
@@ -12,3 +12,13 @@ run_cmake(Add_StepDependencies_iface)
 run_cmake(Add_StepDependencies_iface_step)
 run_cmake(Add_StepDependencies_no_target)
 run_cmake(UsesTerminal)
+
+# Run both cmake and build steps. We always do a clean before the
+# build to ensure that the download step re-runs each time.
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/MultiCommand-build)
+set(RunCMake_TEST_NO_CLEAN 1)
+file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+run_cmake(MultiCommand)
+run_cmake_command(MultiCommand-clean ${CMAKE_COMMAND} --build . --target clean)
+run_cmake_command(MultiCommand-build ${CMAKE_COMMAND} --build .)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2645cb6208ff62cd64deb9862e3eb4d1a81264b3
commit 2645cb6208ff62cd64deb9862e3eb4d1a81264b3
Author:     Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>
AuthorDate: Fri Sep 1 10:49:46 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 1 11:46:28 2017 -0400

    FindPatch: Add module to find 'patch' command-line tool

diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index fa6144c..fdc3597 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -182,6 +182,7 @@ All Modules
    /module/FindosgWidget
    /module/FindPackageHandleStandardArgs
    /module/FindPackageMessage
+   /module/FindPatch
    /module/FindPerlLibs
    /module/FindPerl
    /module/FindPHP4
diff --git a/Help/module/FindPatch.rst b/Help/module/FindPatch.rst
new file mode 100644
index 0000000..ba5e910
--- /dev/null
+++ b/Help/module/FindPatch.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindPatch.cmake
diff --git a/Help/release/dev/find-patch.rst b/Help/release/dev/find-patch.rst
new file mode 100644
index 0000000..d720c81
--- /dev/null
+++ b/Help/release/dev/find-patch.rst
@@ -0,0 +1,5 @@
+find-patch
+----------
+
+* A :module:`FindPatch` module was added to find the ``patch``
+  command-line executable.
diff --git a/Modules/FindPatch.cmake b/Modules/FindPatch.cmake
new file mode 100644
index 0000000..3ebcae9
--- /dev/null
+++ b/Modules/FindPatch.cmake
@@ -0,0 +1,68 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#.rst:
+# FindPatch
+# ---------
+#
+# The module defines the following variables:
+#
+# ``Patch_EXECUTABLE``
+#   Path to patch command-line executable.
+# ``Patch_FOUND``
+#   True if the patch command-line executable was found.
+#
+# The following :prop_tgt:`IMPORTED` targets are also defined:
+#
+# ``Patch::patch``
+#   The command-line executable.
+#
+# Example usage:
+#
+# .. code-block:: cmake
+#
+#    find_package(Patch)
+#    if(Patch_FOUND)
+#      message("Patch found: ${Patch_EXECUTABLE}")
+#    endif()
+
+set(_doc "Patch command line executable")
+set(_patch_path )
+
+if(CMAKE_HOST_WIN32)
+  set(_patch_path
+    "$ENV{LOCALAPPDATA}/Programs/Git/bin"
+    "$ENV{LOCALAPPDATA}/Programs/Git/usr/bin"
+    "$ENV{APPDATA}/Programs/Git/bin"
+    "$ENV{APPDATA}/Programs/Git/usr/bin"
+    )
+endif()
+
+# First search the PATH
+find_program(Patch_EXECUTABLE
+  NAME patch
+  PATHS ${_patch_path}
+  DOC ${_doc}
+  )
+
+if(CMAKE_HOST_WIN32)
+  # Now look for installations in Git/ directories under typical installation
+  # prefixes on Windows.
+  find_program(Patch_EXECUTABLE
+    NAMES patch
+    PATH_SUFFIXES Git/usr/bin Git/bin GnuWin32/bin
+    DOC ${_doc}
+    )
+endif()
+
+if(Patch_EXECUTABLE AND NOT TARGET Patch::patch)
+  add_executable(Patch::patch IMPORTED)
+  set_property(TARGET Patch::patch PROPERTY IMPORTED_LOCATION ${Patch_EXECUTABLE})
+endif()
+
+unset(_patch_path)
+unset(_doc)
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(Patch
+                                  REQUIRED_VARS Patch_EXECUTABLE)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 516bc89..3dfc8eb 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1484,6 +1484,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
     add_subdirectory(FindPNG)
   endif()
 
+  if(CMake_TEST_FindPatch)
+    add_subdirectory(FindPatch)
+  endif()
+
   if(CMake_TEST_FindProtobuf)
     add_subdirectory(FindProtobuf)
   endif()
diff --git a/Tests/FindPatch/CMakeLists.txt b/Tests/FindPatch/CMakeLists.txt
new file mode 100644
index 0000000..541f5bd
--- /dev/null
+++ b/Tests/FindPatch/CMakeLists.txt
@@ -0,0 +1,8 @@
+add_test(NAME FindPatch.Test COMMAND
+  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+  --build-and-test
+  "${CMake_SOURCE_DIR}/Tests/FindPatch/Test"
+  "${CMake_BINARY_DIR}/Tests/FindPatch/Test"
+  ${build_generator_args}
+  --build-options ${build_options}
+)
diff --git a/Tests/FindPatch/Test/CMakeLists.txt b/Tests/FindPatch/Test/CMakeLists.txt
new file mode 100644
index 0000000..f4cd621
--- /dev/null
+++ b/Tests/FindPatch/Test/CMakeLists.txt
@@ -0,0 +1,77 @@
+cmake_minimum_required(VERSION 3.8)
+project(TestFindPatch VERSION 1.0 LANGUAGES NONE)
+
+macro(_check)
+  if(NOT EXISTS "${Patch_EXECUTABLE}")
+    message(FATAL_ERROR "Failed to lookup Patch_EXECUTABLE [${Patch_EXECUTABLE}]")
+  endif()
+
+  if(NOT DEFINED PATCH_FOUND)
+    message(FATAL_ERROR "Variable PATCH_FOUND is not defined")
+  endif()
+
+  # Is import target available ?
+  if(NOT TARGET Patch::patch)
+    message(FATAL_ERROR "Target Patch::patch is not defined")
+  endif()
+
+  # Check Patch::patch imported location
+  get_property(_imported_location TARGET Patch::patch PROPERTY IMPORTED_LOCATION)
+  if(NOT "${Patch_EXECUTABLE}" STREQUAL "${_imported_location}")
+    message(FATAL_ERROR "\
+Patch_EXECUTABLE is expected to be equal to Patch::patch IMPORTED_LOCATION
+  Patch_EXECUTABLE [${Patch_EXECUTABLE}]
+  Patch::patch IMPORTED_LOCATION [${_imported_location}]
+")
+  endif()
+
+endmacro()
+
+find_package(Patch REQUIRED)
+_check()
+
+# Calling twice should not fail
+find_package(Patch REQUIRED)
+_check()
+
+add_custom_target(TestPatchVersion ALL
+  COMMAND ${Patch_EXECUTABLE} -v
+  )
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/QUOTE.txt.baseline"
+[=[Because it's there.
+- George Mallory, 1923
+]=]
+)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/QUOTE.txt" "Because it's there.\n")
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/quote-add-author.patch"
+[=[diff --git a/QUOTE.txt b/QUOTE.txt
+index b36681d..68059b3 100644
+--- a/QUOTE.txt
++++ b/QUOTE.txt
+@@ -1 +1,2 @@
+ Because it's there.
++- George Mallory
+]=]
+)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/quote-add-date.patch"
+[=[diff --git a/QUOTE.txt b/QUOTE.txt
+index 68059b3..c6f30c2 100644
+--- a/QUOTE.txt
++++ b/QUOTE.txt
+@@ -1,2 +1,2 @@
+ Because it's there.
+-- George Mallory
++- George Mallory, 1923
+]=]
+)
+
+add_custom_target(TestPatch ALL
+  COMMAND ${Patch_EXECUTABLE} -p1 -i quote-add-author.patch
+  COMMAND Patch::patch -p1 -i quote-add-date.patch
+  COMMAND ${CMAKE_COMMAND} -E compare_files QUOTE.txt QUOTE.txt.baseline
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  )

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cbf201782205d3e3c7fda33bb1f5828ac13efa1e
commit cbf201782205d3e3c7fda33bb1f5828ac13efa1e
Merge: 900f758 3776074
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 1 10:35:19 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 1 10:35:19 2017 -0400

    Merge branch 'upstream-KWSys' into update-kwsys
    
    * upstream-KWSys:
      KWSys 2017-09-01 (aee0cf59)

diff --cc Source/kwsys/testDirectory.cxx
index 0000000,983f2c6..983f2c6
mode 000000,100644..100644
--- a/Source/kwsys/testDirectory.cxx
+++ b/Source/kwsys/testDirectory.cxx

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37760743fc50d9ad864e8a83f0da75ab000c22ec
commit 37760743fc50d9ad864e8a83f0da75ab000c22ec
Author:     KWSys Upstream <kwrobot at kitware.com>
AuthorDate: Fri Sep 1 09:55:04 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 1 10:35:18 2017 -0400

    KWSys 2017-09-01 (aee0cf59)
    
    Code extracted from:
    
        https://gitlab.kitware.com/utils/kwsys.git
    
    at commit aee0cf59bbed8c8ccc07fa3d77760024cdca520a (master).
    
    Upstream Shortlog
    -----------------
    
    Steven Velez (1):
          80652055 Directory: Use Windows Extended Paths

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d7d0c51..5b8ce00 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1032,6 +1032,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
       testSystemTools
       testCommandLineArguments
       testCommandLineArguments1
+      testDirectory
       )
     IF(KWSYS_STL_HAS_WSTRING)
       SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS}
diff --git a/Directory.cxx b/Directory.cxx
index 5141d45..69068aa 100644
--- a/Directory.cxx
+++ b/Directory.cxx
@@ -118,8 +118,8 @@ bool Directory::Load(const std::string& name)
   struct _wfinddata_t data; // data of current file
 
   // Now put them into the file array
-  srchHandle =
-    _wfindfirst_func((wchar_t*)Encoding::ToWide(buf).c_str(), &data);
+  srchHandle = _wfindfirst_func(
+    (wchar_t*)Encoding::ToWindowsExtendedPath(buf).c_str(), &data);
   delete[] buf;
 
   if (srchHandle == -1) {
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 11f3b81..560c19c 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -2269,11 +2269,7 @@ bool SystemTools::CopyADirectory(const std::string& source,
                                  const std::string& destination, bool always)
 {
   Directory dir;
-#ifdef _WIN32
-  dir.Load(Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)));
-#else
   dir.Load(source);
-#endif
   size_t fileNum;
   if (!SystemTools::MakeDirectory(destination)) {
     return false;
@@ -2626,11 +2622,7 @@ bool SystemTools::RemoveADirectory(const std::string& source)
   }
 
   Directory dir;
-#ifdef _WIN32
-  dir.Load(Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)));
-#else
   dir.Load(source);
-#endif
   size_t fileNum;
   for (fileNum = 0; fileNum < dir.GetNumberOfFiles(); ++fileNum) {
     if (strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)), ".") &&
diff --git a/testDirectory.cxx b/testDirectory.cxx
new file mode 100644
index 0000000..983f2c6
--- /dev/null
+++ b/testDirectory.cxx
@@ -0,0 +1,79 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+file Copyright.txt or https://cmake.org/licensing#kwsys for details.  */
+#include "kwsysPrivate.h"
+#include KWSYS_HEADER(Directory.hxx)
+#include KWSYS_HEADER(Encoding.hxx)
+#include KWSYS_HEADER(SystemTools.hxx)
+
+// Work-around CMake dependency scanning limitation.  This must
+// duplicate the above list of headers.
+#if 0
+#include "Directory.hxx.in"
+#include "Encoding.hxx.in"
+#include "SystemTools.hxx.in"
+#endif
+
+#include <fstream>
+#include <iostream>
+#include <sstream>
+
+#include <testSystemTools.h>
+
+int _doLongPathTest()
+{
+  using namespace kwsys;
+  static const int LONG_PATH_THRESHOLD = 512;
+  int res = 0;
+  std::string topdir(TEST_SYSTEMTOOLS_BINARY_DIR "/directory_testing/");
+  std::stringstream testpathstrm;
+  std::string testdirpath;
+  std::string extendedtestdirpath;
+
+  testpathstrm << topdir;
+  size_t pathlen = testpathstrm.str().length();
+  testpathstrm.seekp(0, std::ios_base::end);
+  while (pathlen < LONG_PATH_THRESHOLD) {
+    testpathstrm << "0123456789/";
+    pathlen = testpathstrm.str().length();
+  }
+
+  testdirpath = testpathstrm.str();
+#ifdef _WIN32
+  extendedtestdirpath =
+    Encoding::ToNarrow(SystemTools::ConvertToWindowsExtendedPath(testdirpath));
+#else
+  extendedtestdirpath = testdirpath;
+#endif
+
+  if (SystemTools::MakeDirectory(extendedtestdirpath)) {
+    std::ofstream testfile1(
+      (extendedtestdirpath + "longfilepathtest1.txt").c_str());
+    std::ofstream testfile2(
+      (extendedtestdirpath + "longfilepathtest2.txt").c_str());
+    testfile1 << "foo";
+    testfile2 << "bar";
+    testfile1.close();
+    testfile2.close();
+
+    Directory testdir;
+    // Set res to failure if the directory doesn't load
+    res += !testdir.Load(testdirpath);
+    // Increment res failure if the directory appears empty
+    res += testdir.GetNumberOfFiles() == 0;
+    // Increment res failures if the path has changed from
+    // what was provided.
+    res += testdirpath != testdir.GetPath();
+
+    SystemTools::RemoveADirectory(topdir);
+  } else {
+    std::cerr << "Failed to create directory with long path: "
+              << extendedtestdirpath << std::endl;
+    res += 1;
+  }
+  return res;
+}
+
+int testDirectory(int, char* [])
+{
+  return _doLongPathTest();
+}

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

Summary of changes:
 Help/manual/cmake-modules.7.rst                    |    1 +
 Help/module/FindPatch.rst                          |    1 +
 Help/release/dev/find-patch.rst                    |    5 ++
 Modules/ExternalProject.cmake                      |    8 ++
 Modules/FindPatch.cmake                            |   68 +++++++++++++++++
 Source/kwsys/CMakeLists.txt                        |    1 +
 Source/kwsys/Directory.cxx                         |    4 +-
 Source/kwsys/SystemTools.cxx                       |    8 --
 Source/kwsys/testDirectory.cxx                     |   79 ++++++++++++++++++++
 Tests/CMakeLists.txt                               |    4 +
 Tests/FindPatch/CMakeLists.txt                     |    8 ++
 Tests/FindPatch/Test/CMakeLists.txt                |   77 +++++++++++++++++++
 .../ExternalProject/MultiCommand-build-stdout.txt  |   15 ++++
 Tests/RunCMake/ExternalProject/MultiCommand.cmake  |   30 ++++++++
 Tests/RunCMake/ExternalProject/RunCMakeTest.cmake  |   10 +++
 15 files changed, 309 insertions(+), 10 deletions(-)
 create mode 100644 Help/module/FindPatch.rst
 create mode 100644 Help/release/dev/find-patch.rst
 create mode 100644 Modules/FindPatch.cmake
 create mode 100644 Source/kwsys/testDirectory.cxx
 create mode 100644 Tests/FindPatch/CMakeLists.txt
 create mode 100644 Tests/FindPatch/Test/CMakeLists.txt
 create mode 100644 Tests/RunCMake/ExternalProject/MultiCommand-build-stdout.txt
 create mode 100644 Tests/RunCMake/ExternalProject/MultiCommand.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list