1. 04 Nov, 2016 3 commits
    • Kitware Robot's avatar
      Revise C++ coding style using clang-format · 6c973b46
      Kitware Robot authored
      Run the `clang-format.bash` script to update all our C and C++ code to a new
      style defined by `.clang-format`.  Use `clang-format` version 3.8.
      
      * If you reached this commit for a line in `git blame`, re-run the blame
        operation starting at the parent of this commit to see older history
        for the content.
      
      * See the parent commit for instructions to rebase a change across this
        style transition commit.
      
      Change-Id: Ie3aedc03bfe5c3999d4a077fafb8c6f3bbffc5c5
      6c973b46
    • Brad King's avatar
      Simplify KWSys per-source license notices · c41c1bc4
      Brad King authored
      Per-source copyright/license notice headers that spell out copyright holder
      names and years are hard to maintain and often out-of-date or plain wrong.
      Precise contributor information is already maintained automatically by the
      version control tool.  Ultimately it is the receiver of a file who is
      responsible for determining its licensing status, and per-source notices are
      merely a convenience.  Therefore it is simpler and more accurate for
      each source to have a generic notice of the license name and references to
      more detailed information on copyright holders and full license terms.
      
      Our `Copyright.txt` file now contains a list of Contributors whose names
      appeared source-level copyright notices.  It also references version control
      history for more precise information.  Therefore we no longer need to spell
      out the list of Contributors in each source file notice.
      
      Replace KWSys per-source copyright/license notice headers with a short
      description of the license and links to `Copyright.txt` and online
      information available from "https://cmake.org/licensing#kwsys".
      
      Run the `filter-notices.bash` script to perform the replacements mechanically.
      Manually fix up the shebang line in one file.
      
      Change-Id: I8497f7c868664dcf54a8608ab302ad93c860b334
      c41c1bc4
    • Brad King's avatar
      Sort includes to stabilize include order w.r.t. clang-format · 15e90a3c
      Brad King authored
      The clang-format tool sorts `#include` lines within contiguous blocks.
      Separate blocks with blank lines and sort the include lines within them
      so that clang-format does not re-order anything.
      
      Change-Id: I96d6828f470b9a234464972172d46afab322487c
      15e90a3c
  2. 14 Sep, 2016 1 commit
    • Brad King's avatar
      SystemTools: Teach GetActualCaseForPath to convert as much as possible · c4049689
      Brad King authored
      If only some leading components of the input path exist then convert
      those and leave the rest unchanged.  This way if a file path is
      constructed using GetActualCaseForPath and created on disk, then a
      following GetActualCaseForPath on the same now-existing path will return
      the same value.
      
      Change-Id: I6e09a4d411f8bf107312f39d7409ba2d22bf176b
      CMake-Issue: 16295
      c4049689
  3. 03 Aug, 2016 1 commit
    • Ben Boeckel's avatar
      SystemTools: add a PathExists method · 6d23dd7e
      Ben Boeckel authored
      This method checks if a path by the given name exists. The problem with
      FileExists is that it returns `false` even for broken (or
      self-referential) symlinks which may not be what the user wants.
      
      Change-Id: I71b8af6e12a5ae4b1319a3bec83db6c3cef36f90
      6d23dd7e
  4. 01 Aug, 2016 1 commit
  5. 15 Jul, 2016 2 commits
  6. 06 Oct, 2015 1 commit
  7. 28 Aug, 2015 2 commits
  8. 24 Aug, 2015 4 commits
  9. 10 Jul, 2015 1 commit
    • Brad King's avatar
      SystemTools: Optimize GetActualCaseForPath memoization · c9336bcf
      Brad King authored
      Use a case-insensitive map key since paths of all case combinations
      should map to the same actual case.  This may reduce the number
      of copies of each path differing only by case in the map.
      
      Change-Id: Ic5460fcf14fa263d45ef1909bf80a81c6f4791a4
      c9336bcf
  10. 24 Feb, 2015 1 commit
  11. 16 Oct, 2014 5 commits
  12. 07 Aug, 2014 1 commit
  13. 30 Jul, 2014 1 commit
  14. 01 Jul, 2014 1 commit
    • Chuck Atkins's avatar
      SystemTools: Use extended paths on Windows for > 256 length · 8f991ab0
      Chuck Atkins authored
      Many Windows filesystem calls (but not all) have a MAX_PATH limitation
      of 260 characters (drive letter, colon, backslash, 256 char path, null).
      This is especially problematic for interacting with large highly nested
      build trees (the boost C++ libraries, for example). This limitation can
      be overcome by using extended length paths instead.  By converting
      local filesystem and network paths to extended length paths before
      passing them to the underlying APIs the maximum path length can be as
      large as 32767 characters. The new ConvertToWindowsExtendedPath
      function will convert "E:/a.txt" to "\\?\E:\a.txt" and "\\Foo\a.txt" to
      "\\?\UNC\Foo\a.txt".
      
      See also the MSDN article on "Naming Files, Paths, and Namespaces":
      
       http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx
      
      This also adds a hidden CMake option, KWSYS_TEST_SYSTEMTOOLS_LONG_PATHS,
      which, when set to TRUE, will enable the extended length path tests.
      This is off by default since if something does go awry, the resulting
      leftovers could be difficult to delete manually.
      
      Change-Id: Ib7ac1f657241ed389169678d1c078c0d836f1c7b
      8f991ab0
  15. 07 May, 2014 7 commits
  16. 31 Oct, 2013 1 commit
  17. 15 Oct, 2013 1 commit
    • David Cole's avatar
      SystemTools: Move typedef mode_t inside the SystemTools class · f67bb2ba
      David Cole authored
      Cleans up a smidge of global namespace pollution. Allows using this
      header file in the same compilation unit with other header files
      that may also contain a mode_t typedef, possibly with a different
      underlying type.
      
      Actually encountered in the wild when trying to compile a class that
      uses both log4cpp and VTK.
      
      Change-Id: Iba5592778fc21d66946026847537d914e56f332b
      f67bb2ba
  18. 06 Aug, 2013 1 commit
  19. 06 May, 2013 1 commit
  20. 02 Jan, 2013 1 commit
  21. 26 Apr, 2012 1 commit
    • Brad King's avatar
      KWSys: Fix SystemTools environment memory handling (#13156) · 48aeb751
      Brad King authored
      The SystemTools::PutEnv function tries to provide the "putenv" API
      without leaking memory.  However, the kwsysDeletingCharVector singleton
      frees memory that may still be referenced by the environment table,
      having been placed there by putenv.  If any static destruction or
      processing by an external tool happens after the singleton is destroyed
      and accesses the environment it will read invalid memory.
      
      Replace use of putenv with setenv/unsetenv when available.  The latter
      manage internal copies of the values passed instead of referencing the
      original memory.  When setenv/unsetenv are not available use putenv with
      a singleton that removes its values from the environment before freeing
      their memory.  This requires an "unputenv" implementation.  On at least
      some platforms it must be written in terms of "putenv" because other
      APIs are not available and direct modification of the "environ" global
      is not safe (e.g. on Windows there is interaction with "wenviron").
      Fortunately either putenv("A=") or putenv("A") will remove "A" from the
      environment on these platforms.  On other platforms fall back to direct
      manipulation of "environ".
      
      Also add UnPutEnv to the API and add a test for the behavior of both.
      48aeb751
  22. 24 Oct, 2011 1 commit
  23. 03 Aug, 2011 1 commit