summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'backport-no-global-setlocale' into no-global-setlocaleBrad King2015-02-061-0/+3
|\ | | | | | | Resolve conflict in Source/CMakeLists.txt by taking both changes.
| * Add setlocale() calls around use of libarchive APIs (#14934, #15377)Brad King2015-02-061-0/+3
| | | | | | | | | | | | | | | | | | | | The libarchive APIs use nl_langinfo(CODESET) for iconv so they need the locale to be set for LC_CTYPE. However, the rest of CMake does not define any behavior for non-ASCII character classification/conversion so we do not want to setlocale() globally. Add a RAII class to save, set, and restore the locale around calls to libarchive APIs. Inspired-by: Clinton Stimpson <clinton@elemtech.com>
* | cmake: Teach "-E tar" command a "--mtime=" optionBrad King2015-01-191-1/+2
| | | | | | | | | | | | | | | | | | | | Add an option to set the mtime of entries in a tarball so that one can create a tarball with a consistent content hash (e.g. MD5) for a given set of files regardless of their current timestamps on disk. This will be useful for submission of tarballs to CDash, which tracks content hashes to avoid duplication. Inspired-by: Bill Hoffman <bill.hoffman@kitware.com>
* | Replace 'foo.size() == 0' pattern with foo.empty().Stephen Kelly2015-01-181-1/+1
| |
* | Merge topic 'join-algorithm'Brad King2015-01-121-12/+6
|\ \ | | | | | | | | | | | | | | | | | | 55a73e6b Use the cmJoin algorithm where possible. 8dc8d756 cmStandardIncludes: Add a join algorithm for string containers. b5813cee cmInstallCommand: Remove unused variable.
| * | Use the cmJoin algorithm where possible.Stephen Kelly2015-01-081-12/+6
| | |
* | | Merge topic 'add-xz-support'Brad King2015-01-121-8/+21
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4035ef78 cmake -E tar: error out on multiple compression formats d811d238 cmSystemTools: use an enumeration for compression formats df16dcfb cmake -E tar: add support for .xz files with 'J' b0a5d393 cmake -E tar: clean up flag documentation
| * | | cmSystemTools: use an enumeration for compression formatsBen Boeckel2015-01-121-9/+20
| | | | | | | | | | | | | | | | Juggling 3 booleans was unwieldy.
| * | | cmake -E tar: add support for .xz files with 'J'Ben Boeckel2015-01-091-2/+4
| |/ /
* | | Merge topic 'drop-ancient-workarounds'Brad King2015-01-121-5/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0f7bdd61 Remove VS 6 special case. 5e92c826 Remove some obsolete stuff. 15e42bb2 cmStandardIncludes: Remove obsolete cmOStringStream. 931e055d Port all cmOStringStream to std::ostringstream. f194a009 Remove unused cmIStringStream class. 3ec1bb15 cmStandardIncludes: Remove std namespace hack. bb3bce70 cmStandardIncludes: Remove ANSI_FOR_SCOPE hack. 28fa4923 cmStandardIncludes: Remove iostreams workaround for obsolete Compaq compiler. 837a8a63 cmStandardIncludes: Drop Comeau-related workaround. 4030ddfd Remove Borland-related undef. 17d6a6fd cmStandardIncludes: Remove comment about Borland. 26fb5011 Drop SGI as a CMake host compiler.
| * | | Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-1/+1
| | | | | | | | | | | | | | | | All compilers hosting CMake support the std class.
| * | | Drop SGI as a CMake host compiler.Stephen Kelly2015-01-081-4/+0
| |/ / | | | | | | | | | | | | It has not been tested since commit v3.1.0-rc1~584^2 (Utilities/Release: Drop IRIX binary generation on ferrari, 2014-04-30).
* | | Use insert instead of a loop in some cases.Stephen Kelly2015-01-111-5/+1
|/ / | | | | | | | | | | Limit this change to inserting into a vector from a vector. A follow up change can use insert for inserting into a set.
* | Mach-O: Use Mach-O parser to extract install names instead of otool.Clinton Stimpson2014-12-221-22/+12
| | | | | | | | | | | | | | This has much better performance than calling "otool" or "xcrun -r otool" to extract install names for rpath support. Fixes bug #15178.
* | file: Use 'long' to represent the parsed LOCK TIMEOUT valueRuslan Baratov2014-12-051-3/+4
| | | | | | | | | | | | | | | | | | Convert the StringToInt helper into a StringToLong helper with a 'long' result type. This will make the helper more useful to other callers that want to use strtol. While at it, also check errno after calling strtol in case the conversion fails with a range error.
* | cmSystemTools: Add StringToInt helperRuslan Baratov2014-12-031-0/+8
| | | | | | | | | | | | Convert a string to a signed integer and reject any extra input. Co-Author: Rolf Eike Beer <eike@sf-mail.de>
* | Merge topic 'remove-ancient-msvc-workarounds'Brad King2014-11-251-3/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12cb0b86 Help: Update developer manual with some C++ features now permitted. ba74465f cmGeneratorTarget: Remove MSVC7 workaround 41363c0c VisualStudio: Remove MSVC6 compatibility macro. 4efcfe52 cmSystemTools: Remove MSVC6 compatibility define. 5f4695cd cmStandardIncludes: Remove MSVC6 condition for cmArrayBegin macro. 7a064337 cmFindCommon: Remove MSVC6 workaround for nested struct private access. fdb73547 cmTarget: Remove std::min and std::max MSVC6 compatibility code.
| * | cmSystemTools: Remove MSVC6 compatibility define.Stephen Kelly2014-11-201-3/+1
| | |
* | | Remove some unneeded c_str calls.Stephen Kelly2014-11-231-2/+2
|/ /
* | cmSystemTools: reimplement verson comparison without sscanf()Rolf Eike Beer2014-10-311-13/+21
| | | | | | | | | | This now has the advantage that it works with version strings with any number of components.
* | Merge topic 'remove-borland-build'Brad King2014-10-211-5/+1
|\ \ | | | | | | | | | | | | 2db55ffa Remove borland workarounds.
| * | Remove borland workarounds.Stephen Kelly2014-10-151-5/+1
| |/ | | | | | | | | CMake 3.0 is the last release to require to be able to build with Borland.
* | strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-14/+14
|/ | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
* Fix memory leaks in extract tar.Bill Hoffman2014-07-231-0/+3
|
* SystemTools: Use a set in Is{On,Off}Ben Boeckel2014-07-081-6/+35
| | | | Also check before calling toupper() umpteen million times.
* IsOff: Use the length for the string constructionBen Boeckel2014-07-081-2/+3
| | | | | No need to waste the calculation and force the string to call strlen again.
* Merge topic 'libarchive-encoding'Brad King2014-07-021-6/+32
|\ | | | | | | | | 71c981a2 Encoding: Fix potential encoding issues with libarchive on Windows.
| * Encoding: Fix potential encoding issues with libarchive on Windows.Clinton Stimpson2014-07-021-6/+32
| | | | | | | | | | | | | | | | | | | | Because the 8bit string encoding in libarchive can be different than the 8bit string encoding in CMake, change to call the wide version of libarchive functions. They are different if CMake is configured to use UTF-8 as the internal encoding. Create helper functions for some libarchive calls to use wstring internally on platforms supporting it.
* | Merge topic 'bootstrap-cmake-locations'Brad King2014-06-271-1/+6
|\ \ | | | | | | | | | | | | | | | 6650b0fa bootstrap: Fix "make test" and "make package" targets (#14989) bc151757 bootstrap: Clarify name of configured source directory
| * | bootstrap: Fix "make test" and "make package" targets (#14989)Brad King2014-06-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit v3.0.0-rc1~374^2 (Refactor internal resource location APIs and initialization, 2013-11-07) a bootstrap-built "cmake" tries to reference "ctest" and "cpack" executables next to itself, which never exist. Teach cmSystemTools::FindCMakeResources, when bootstrap-built, to refer to the "ctest" and "cpack" executables in the location where they will be built after "make".
| * | bootstrap: Clarify name of configured source directoryBrad King2014-06-251-1/+1
| | | | | | | | | | | | | | | Rename CMAKE_ROOT_DIR to CMAKE_BOOTSTRAP_SOURCE_DIR to clarify both that it is only for bootstrap and that it refers to the source directory.
* | | Encoding: Fix debug asserts parsing command line options with non-ascii chars.Clinton Stimpson2014-06-171-1/+1
| |/ |/| | | | | With MSVC, isspace() will assert with non-ascii characters.
* | cmSystemTools: Add callback for StderrBrad King2014-05-151-14/+25
| | | | | | | | | | | | | | | | | | Factor a common callback type out of StdoutCallback. Add an equivalent StderrCallback. While at it, use "size_t" for the data length instead of "int". Teach "ctest --build-and-test" to capture the Stderr callback because output sent through it is part of the logical CMake process output.
* | cmSystemTools: Simplify InterruptCallback definitionBrad King2014-05-151-2/+2
| | | | | | | | | | Use the typedef to declare the member instead of duplicating the type. Use default initialization instead of an explicit zero initializer.
* | cmSystemTools: Rename ErrorCallback to MessageCallbackBrad King2014-05-151-9/+8
| | | | | | | | | | Clarify that it is the callback for the cmSystemTools::Message API. Rename callback clients too.
* | Merge topic 'fix-atomic-rename-Windows-sharing-violation'Brad King2014-05-141-2/+4
|\ \ | |/ | | | | | | 24bd7ae1 cmSystemTools::RenameFile: Retry on Windows ERROR_SHARING_VIOLATION
| * cmSystemTools::RenameFile: Retry on Windows ERROR_SHARING_VIOLATIONEric Berge2014-05-131-2/+4
| | | | | | | | | | | | | | Add ERROR_SHARING_VIOLATION to the set of errors (previously including only ERROR_ACCESS_DENIED) that cause a rename (MoveFile) on Windows to retry. The condition was observed when two renames to the same target file name were happening simultaneously.
* | cmSystemTools: Remove unreachable return on HP compilerBrad King2014-04-081-1/+1
| | | | | | | | | | | | | | Follow up commit 1de08685 (cmSystemTools: Restore unreachable return to silence warnings, 2014-04-02) by excluding the unreachable return on the HP compiler as well as Clang. Both recognize that it is unreachable and warn.
* | Re-word comment on unreachable return statementsBrad King2014-04-071-1/+1
| | | | | | | | | | Do not use the word "warning" in the comment because CTest launchers match it and CTestCustom.cmake.in does not suppress it.
* | Merge topic 'clang-warnings'Brad King2014-04-031-0/+3
|\ \ | | | | | | | | | | | | 1de08685 cmSystemTools: Restore unreachable return to silence warnings
| * | cmSystemTools: Restore unreachable return to silence warningsBrad King2014-04-021-0/+3
| | | | | | | | | | | | | | | | | | | | | Some compilers do not recognize that the end of copy_data cannot be reached and complain that there is no return statement. Clang warns that there is an unreachable return statement if it appears. Conditionally add the return statement when not building with Clang.
* | | Merge topic 'clang-warnings'Brad King2014-04-011-1/+0
|\ \ \ | |/ / | | | | | | | | | | | | 8c9c4fe1 Remove 'return' statements that can never be reached 50ca77f4 create_test_sourcelist: Initialize variable at declaration
| * | Remove 'return' statements that can never be reachedSean McBride2014-03-311-1/+0
| |/ | | | | | | Clang -Wunreachable-code-return warns otherwise.
* | Remove some c_str() calls.Stephen Kelly2014-03-111-3/+3
| | | | | | | | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* | strings: Remove cmStdString referencesBen Boeckel2014-03-081-41/+9
| | | | | | | | | | | | | | | | | | | | | | Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
* | stringapi: Take strings in escaping functionsBen Boeckel2014-03-081-3/+4
| |
* | stringapi: Use strings for globbing parametersBen Boeckel2014-03-081-6/+6
| |
* | stringapi: Accept strings when MD5 hashing dataBen Boeckel2014-03-081-2/+2
| |
* | ExpandListArguments: Optimize the parserBen Boeckel2014-02-211-33/+18
|/ | | | | | Optimize cmSystemTools::ExpandListArguments so as not to build a string character-by-character. This avoids excess reallocations of the result string.
* Windows: Make file delete/rename retry configurableBrad King2014-02-121-4/+42
| | | | | | | | | | | | | | | | | | Several CMake operations need to replace files in rapid succession. This commonly fails on Windows due to filesystem lock behavior so we have retry loops. No matter how many times we retry or how long we delay there will inevitably be someone with an environment that needs more. Make the retry count and delay configurable in the Windows Registry keys: {HKCU,HKLM}/Software/Kitware/CMake/Config in DWORD values FilesystemRetryCount = Number of tries FilesystemRetryDelay = Delay in milliseconds between tries Leave the feature undocumented for now to see how it goes.