summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'get_filename_component-fix-program-split'Brad King2017-09-141-0/+50
|\ | | | | | | | | | | | | 31f73eb1 get_filename_component: Revise PROGRAM/PROGRAM_ARGS split semantics Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1251
| * get_filename_component: Revise PROGRAM/PROGRAM_ARGS split semanticsBrad King2017-09-131-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The KWSys `SystemTools::SplitProgramFromArgs` implementation goes into an infinite loop when the value is just " " (a space). Since the "program path with unquoted spaces plus command-line arguments" operation it is trying to provide is poorly defined (string parsing should not depend on filesystem content), just stop using it. Instead consider the main two use cases the old approach tried to handle: * The value is the name or absolute path of a program with no quoting or escaping, but also no command-line arguments. In this case we can use the value as given with no parsing, and assume no arguments. * The value is a command-line string containing the program name/path plus arguments. In this case we now assume that the command line is properly quoted or escaped. Fixes: #17262
* | Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-22/+14
|/ | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Replace C-style castsDaniel Pfeifer2017-08-271-7/+8
|
* Use C++11 nullptrDaniel Pfeifer2017-08-241-13/+13
|
* Change ComputeFileMD5 to ComputeFileHashAndré Klitzing2017-07-141-8/+6
| | | | | | | * Use a parameter to select hash algorithm * Return a std::string as result or an empty string if it fails * Avoids unnecessary copy of hash value
* Remove second arg: npos in substr usagesPavel Solodovnikov2017-06-011-2/+1
|
* Access string npos without instancePavel Solodovnikov2017-06-011-1/+2
|
* Remove unused variablesPavel Solodovnikov2017-05-261-1/+0
|
* Change std::basic_string<char> to std::stringPavel Solodovnikov2017-05-241-6/+6
|
* Merge topic 'ninja-dyndep-response-file'Brad King2017-04-251-0/+33
|\ | | | | | | | | | | | | 594d3d6f Ninja: support response file for cmake_ninja_depends on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !722
| * Ninja: support response file for cmake_ninja_depends on WindowsBernhard Burgermeister2017-04-251-0/+33
| | | | | | | | | | | | | | The internal tool "cmake_ninja_depends" now supports reading the list of ddi files from a reponse file to circumvent Windows command line length limits. Use this response file for dyndep rule on Windows.
* | Merge topic 'clang-tidy'Brad King2017-04-241-24/+25
|\ \ | |/ |/| | | | | | | | | | | | | | | 73020305 clang-tidy: avoid copy b432e933 clang-tidy: use .empty() to check emptyness 012972a9 clang-tidy: remove reduntant .data() calls b26577c9 clang-tidy: remove else after break and continue Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !734
| * clang-tidy: remove else after break and continueDaniel Pfeifer2017-04-211-24/+25
| |
* | Merge topic 'unified-commandline-length'Brad King2017-04-211-0/+40
|\ \ | |/ |/| | | | | | | | | bbb5c3ef Ninja,Makefile: Unify command line limit logic Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !705
| * Ninja,Makefile: Unify command line limit logicChristian Pfeiffer2017-04-191-0/+40
| | | | | | | | | | | | Move the logic to cmSystemTools to be shared among the generators. Revise the implementation and add comments justifying each possible source for a limit.
* | Drop Visual Studio 7 .NET 2003 generatorBrad King2017-04-191-2/+0
|/ | | | This generator has been deprecated since CMake 3.6. Remove it.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-7/+7
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Add self-sufficient wrapper for <sys/stat.h>Daniel Pfeifer2017-03-241-1/+1
|
* IWYU: use pragma exportDaniel Pfeifer2017-03-231-1/+0
|
* Merge topic 'iwyu'Brad King2017-02-201-0/+1
|\ | | | | | | | | | | | | | | | | | | | | d58d28a9 ParserHelper: Move macros to bottom of files 07953c18 remove file cmStandardIncludes.h f918b053 cmFortranParser: include what you use b74314c6 cmDependsJavaParser: include what you use 74404df4 cmCommandArgumentParser: include what you use e7168c08 cmExprParser: include what you use ee72803e fix some include-what-you-use diagnostics
| * fix some include-what-you-use diagnosticsDaniel Pfeifer2017-02-171-0/+1
| |
* | Make CMAKE_ROOT independent of case of path used to invoke cmakeBrad King2017-02-171-2/+2
|/ | | | | | | | | | | | | | We compute the location of `CMAKE_ROOT` and other resources relative to the location of our own executable. On some platforms this path is computed in a way that depends on the case of the path used to invoke the executable. Convert the result to the actual case preserved by the filesystem on disk in order to make it consistent regardless of how the executable is launched. This approach generalizes the fix made by commit v3.8.0-rc1~71^2 (cmSystemTools: use the actual case for root detection, 2017-01-18). Issue: #16648
* Merge topic 'case-insensitive-bindir-detection'Brad King2017-01-201-1/+2
|\ | | | | | | | | 7f0a21a5 cmSystemTools: use the actual case for root detection
| * cmSystemTools: use the actual case for root detectionBen Boeckel2017-01-181-1/+2
| | | | | | | | | | | | | | | | | | On Windows, calling a binary installed with the default `bin` binary directory will fail to be detected when called as `BIN\cmake.exe` due to the string compare. Get the actual case of the path before checking that the path ends with `CMAKE_BIN_DIR`. Fixes #16574.
* | clang-tidy: apply modernize-use-bool-literals fixesDaniel Pfeifer2016-12-121-1/+1
| |
* | Add Encoding option for RunChild, RunMakeCommand and RunProcessDāvis Mosāns2016-11-141-2/+2
| |
* | Windows: Encode child process output to internally-used encodingDāvis Mosāns2016-11-141-4/+39
| | | | | | | | | | | | Typically Windows applications (eg. MSVC compiler) use current console's codepage for output to pipes so we need to encode that to our internally-used encoding (`KWSYS_ENCODING_DEFAULT_CODEPAGE`).
* | Port hash computation to cmCryptoHashBrad King2016-11-101-4/+4
| | | | | | | | | | Avoid using KWSys MD5 or `cm_sha2` and use the `cmCryptoHash` abstraction instead.
* | cmCryptoHash: Avoid using subclasses at client sitesBrad King2016-11-101-4/+4
| | | | | | | | Use only the main `cmCryptoHash` interface.
* | cmSystemTools: Flush output buffer for list_item_verboseDāvis Mosāns2016-10-131-0/+1
| | | | | | | | | | When `std::cout` and `FILE *stdout` are used at same time need to explicitly flush otherwise they can be out of sync.
* | cmSystemTools, elf: handle DT_MIPS_RLD_REL_MAP in RemoveRPathJames Cowgill2016-10-071-0/+24
| |
* | cmSystemTools: rewrite RemoveRPath using DyanmicEntryList methodsJames Cowgill2016-10-071-35/+17
|/
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 CMake 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". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Merge topic 'add-strverscmp'Brad King2016-09-151-0/+77
|\ | | | | | | | | | | 88494325 Tests: Add test for our strverscmp implementation 07f69bd5 cmSystemTools: Add strverscmp
| * cmSystemTools: Add strverscmpBrad King2016-09-131-0/+77
| | | | | | | | | | | | | | | | | | | | Add support for natural string order by comparing non-numerical character directly and numerical number by firstly collecting contiguous digits. The order is defined by the `strverscmp(3)` manual [1]. [1] http://man7.org/linux/man-pages/man3/strverscmp.3.html Inspired-by: Pierluigi Taddei <pierluigi.taddei@gmail.com>
* | cmSystemTools: simplify boolean expressionsDaniel Pfeifer2016-09-121-15/+5
|/
* surround macro arguments with parenthesesDaniel Pfeifer2016-09-051-1/+1
|
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-30/+36
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-13/+13
|
* Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-1/+2
|
* Add additional <= and >= comparison operatorsChuck Atkins2016-08-091-3/+10
| | | | | This adds the LESS_EQUAL, GREATER_EQUAL, and associated STR and VERSION equivalents to use the combined <= and >= functionality.
* Use better KWSys SystemTools::GetEnv and HasEnv signaturesDāvis Mosāns2016-07-181-3/+3
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-13/+14
|
* Add missing braces around statements.Daniel Pfeifer2016-06-101-4/+6
| | | | | Apply fixits of clang-tidy's readability-braces-around-statements checker.
* Merge topic 'size-empty'Brad King2016-06-031-1/+1
|\ | | | | | | | | c6220de2 Use the empty() method to check for emptyness.
| * Use the empty() method to check for emptyness.Daniel Pfeifer2016-06-021-1/+1
| | | | | | | | | | Apply fix-its from clang-tidy's readability-container-size-empty checker.
* | Merge topic 'simplify-boolean-expressions'Brad King2016-06-031-5/+2
|\ \ | |/ |/| | | | | 7f6b8d33 Simplify boolean expressions
| * Simplify boolean expressionsDaniel Pfeifer2016-06-021-5/+2
| | | | | | | | | | | | Use clang-tidy's readability-simplify-boolean-expr checker. After applying the fix-its, revise all changes *very* carefully. Be aware of false positives and invalid changes.
* | Add option to control 'bin' directory of CMake's own installation (#16076)Nicolas BUNEL2016-06-011-7/+14
|/ | | | | Add a `CMAKE_BIN_DIR` cache entry to CMake's own build configuration. Add a `--bindir` option to the `bootstrap` script to set it.