summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.h
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-75/+60
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our 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.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Fix spelling typos in comments and documentation (#16037)Felix Geyer2016-03-291-1/+1
| | | | | The Debian package checker tool (lintian) detected several typos in CMake.
* cmSystemTools: Rename OUTPUT_NORMAL to OUTPUT_FORWARD to clarify its purposeBrad King2016-01-191-2/+2
| | | | | | The OUTPUT_NORMAL value is not really "normal" and has only one caller. Rename it to OUTPUT_FORWARD to clarify that we are explicitly forwarding the output.
* cmSystemTools: Add VersionCompareEqual helperBrad King2016-01-111-0/+2
| | | | Wrap a call to VersionCompare with OP_EQUAL.
* cmSystemTools: Add VersionCompareGreater helperGilles Khouzam2015-10-021-0/+2
| | | | | Wrap a call to VersionCompare with OP_GREATER in a signature suitable for use with std::sort.
* Ninja: Refactor lookup of cmcldeps locationBrad King2015-09-181-0/+1
| | | | | This executable comes with CMake so just compute its location in cmSystemTools instead of storing it in compiler information modules.
* cmSystemTools: Drop unused StringEndsWith methodBrad King2015-09-021-2/+0
| | | | It has no callers and we can inherit one from KWSys SystemTools anyway.
* VS: Windows Store/Phone package cert thumbprintGilles Khouzam2015-08-271-0/+3
| | | | | Add the PackageCertificateThumbprint property when there is a certificate on a WindowsStore or Phone app.
* cmOutputConverter: Adopt EscapeWindowsShellArgument methodBrad King2015-07-081-5/+0
| | | | Move it out of cmSystemTools and into cmOutputConverter.
* cmSystemTools: Add StringToULong helperBrad King2015-06-301-0/+1
| | | | Convert a string to an unsigned integer and reject any extra input.
* cmSystemTools: Teach RunSingleCommand to separate stdout and stderrBrad King2015-04-201-2/+5
| | | | | | | Extend the RunSingleCommand signature to capture stdout and stderr separately. Allow both to be captured to the same std::string to preserve existing behavior. Update all call sites to do this so that this refactoring does not introduce functional changes.
* cmake: Teach "-E tar" command a "--format=" optionNils Gladitz2015-04-101-1/+2
| | | | | | | Allows specifying a libarchive defined archive format currently restricted to 7zip, gnutar, pax, paxr and zip. The default is "paxr" (pax restricted).
* bootstrap: Enable color Makefile outputBrad King2015-02-051-2/+0
| | | | | | Build the needed infrastructure during bootstrap in order to allow "cmake -E cmake_echo_color" to be used unconditionally during generation.
* cmake: Teach "-E tar" command a "--mtime=" optionBrad King2015-01-191-3/+3
| | | | | | | | | | 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>
* cmSystemTools: use an enumeration for compression formatsBen Boeckel2015-01-121-4/+11
| | | | Juggling 3 booleans was unwieldy.
* cmake -E tar: add support for .xz files with 'J'Ben Boeckel2015-01-091-1/+1
|
* file: Use 'long' to represent the parsed LOCK TIMEOUT valueRuslan Baratov2014-12-051-2/+2
| | | | | | | | | 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/+3
| | | | | | Convert a string to a signed integer and reject any extra input. Co-Author: Rolf Eike Beer <eike@sf-mail.de>
* cmSystemTools: Add callback for StderrBrad King2014-05-151-6/+11
| | | | | | | | | 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: Rename ErrorCallback to MessageCallbackBrad King2014-05-151-4/+4
| | | | | Clarify that it is the callback for the cmSystemTools::Message API. Rename callback clients too.
* strings: Remove cmStdString referencesBen Boeckel2014-03-081-12/+5
| | | | | | | | | | | 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-1/+1
|
* stringapi: Use strings for globbing parametersBen Boeckel2014-03-081-2/+3
|
* stringapi: Accept strings when MD5 hashing dataBen Boeckel2014-03-081-2/+2
|
* Windows: Make file delete/rename retry configurableBrad King2014-02-121-0/+9
| | | | | | | | | | | | | | | | | | 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.
* cmSystemTools: Add PrintSingleCommand methodBrad King2013-11-151-0/+2
| | | | | Add a method to print a command line for human reference by simply double-quoting every argument.
* cmSystemTools: Add RunSingleCommand overload for std::vector<std::string>Brad King2013-11-151-0/+5
|
* Refactor internal resource location APIs and initializationBrad King2013-11-121-7/+10
| | | | | | | | | | | | | | | | | | | | Rename cmSystemTools::FindExecutableDirectory to FindCMakeResources. Teach it to compute the locations of cmake, ctest, cpack, ccmake, and cmake-gui executables, and the location of CMAKE_ROOT. Provide this information from static cmSystemTools::Get<resource>() methods. Refactor code that needs these locations to use the new APIs. Teach FindCMakeResources to use the OS X system API to lookup the executable location. When running from the CMake build tree itself, leave a file in the tree that FindCMakeResources can use to read the location of the source tree. This avoids the need to compile the source tree location into a binary that may be installed and used without the source tree. Teach the QtDialog on OS X to create a "cmake-gui" symlink in the build tree next to "cmake" and the other tools, as is already done in the install tree for the application bundle. This ensures a consistent set of executables are available in one directory.
* cmSystemTools: Drop old RunCommand methodBrad King2013-10-191-27/+0
| | | | | All calls to this method have been replaced by newer infrastructure. Remove it and the supporting cmWin32ProcessExecution class.
* Teach --help-* options to load documentation from .rst filesBrad King2013-10-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Install the Help directory next to Modules to make it available in CMake distributions. Use cmRST to read Help .rst documents and print them as help output. Add options --help-manual-list --help-manual to list available manuals or print one of them. Implement the options --help-commands --help-modules --help-policies --help-properties --help-variables by mapping to the corresponding manual page. Implement the options --help-command-list --help-module-list --help-policy-list --help-property-list --help-variable-list by globbing the available Help .rst documents of the corresponding type and reading their titles. Implement the options --help-command --help-module --help-policy --help-property --help-variable by globbing the matching Help .rst document(s) and printing them.
* Add option to use stdout/stderr of original terminal in cmake --buildPatrick Gansterer2013-07-291-2/+3
| | | | | | Pass the original file handles to the native tool when using the --use-stderr option in the build command. This enables the usage of advanced terminal features like colored output.
* cmDependsC: Collapse relative include pathsPavel Shramov2013-06-261-0/+6
| | | | | | | | | While calculating dependencies collapse sequences such as ../../../a/b/c/../../d/e/../../e/f to avoid total path lengths over the Windows path length limit as much as possible.
* cmSystemTools: Fix typo in comment.Stephen Kelly2013-06-111-1/+1
|
* Merge topic 'rpath-on-mac'Brad King2013-06-031-0/+4
|\ | | | | | | | | | | | | | | dc1d025 OS X: Add test for rpaths on Mac. 8576b3f OS X: Add support for @rpath in export files. 00d71bd Xcode: Add rpath support in Xcode generator. 94e7fef OS X: Add RPATH support for Mac.
| * OS X: Add RPATH support for Mac.Clinton Stimpson2013-06-031-0/+4
| | | | | | | | | | | | | | | | | | RPATH support is activated on targets that have the MACOSX_RPATH property turned on. For install time, it is also useful to set INSTALL_RPATH to help find dependent libraries with an @rpath in their install name. Also adding detection of rpath conflicts when using frameworks.
* | Fix spelling and typos (non-binary)Andreas Mohr2013-05-071-1/+1
|/
* cmake-gui: Fix error status when interrupted.Clinton Stimpson2012-09-041-1/+2
| | | | | | Sometimes it wasn't returning an error and one could continue with the generate generate as if no errors occurred, and even with an incomplete configure step.
* CTest: Simplify environment save/restoreBrad King2012-04-241-10/+2
| | | | | | | | Replace use of AppendEnv/RestoreEnv pairs with instances of SaveRestoreEnvironment. Simplify the signature of AppendEnv and use it in place of similar loops elsewhere. Move the RestoreEnv implementation inside the SaveRestoreEnvironment destructor which is the only place left that calls it.
* Merge branch 'target-include-directories' into ninja-generatorDavid Cole2012-02-221-1/+8
|\
| * Merge topic 'interrupt-bug-12649'David Cole2012-02-141-1/+8
| |\ | | | | | | | | | | | | 131eed6 cmake-gui: Improve interrupt granularity to fix bug 12649.
| | * cmake-gui: Improve interrupt granularity to fix bug 12649.Clinton Stimpson2012-01-021-1/+8
| | | | | | | | | | | | | | | | | | | | | Instead of enabling interrupt only when a progress or message callback is called, add a new callback specifically for interrupt. This new callback is called from GetFatalErrorOccured() so cmake-gui can immediately report interrupt status instead of calling queuing a call to cmSystemTools::SetFatalErrorOccured() and waiting for the progress or message callback to be called to process that queued call.
* | | Add cmSystemTools::TrimWhitespace functionPeter Collingbourne2012-02-021-0/+5
|/ /
* | Fix typos arguement -> argument.Stephen Kelly2012-01-081-2/+2
|/
* RunSingleCommand: Add a OUTPUT_NORMAL flag.Johan Björk2011-07-281-2/+7
| | | | | OUTPUT_NORMAL does no processing of the output streams, it just passes them through the same streams as they were received on.
* RunSingleCommand: Replace verbose boolean with enumJohan Björk2011-07-281-6/+12
| | | | | No behaviour change, this prepares for adding a flag to skip the merging of output streams.
* cmSystemTools: Remove trailing whitespaceBrad King2011-07-281-37/+37
|
* Merge topic 'xcode-source_groups-folders-issue-10039'Brad King2011-06-081-0/+3
|\ | | | | | | | | | | | | | | f09ba0f Fix style errors added by parent and grandparent eeeeca1 XCode: Support target folders on XCode. 59ed84e Xcode: Support multiple level nesting of XCode folders (#10039) d0a403f CMake: Move tokenize to cmSystemTools
| * CMake: Move tokenize to cmSystemToolsJohan Björk2011-06-071-0/+3
| |
* | Merge topic 'output-compile-lines'Brad King2011-05-241-0/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cdc2b41 Fix CompileCommandOutput test build on Windows 7039d1f Fix CompileCommandOutput test for Make tools not supporting spaces 4268e3d run_compile_commands: Cast istream::get() result to char c45c60b run_compile_commands: Avoid extra stl vector conversion 7c5be51 run_compile_commands: Avoid shadow in std::map<>::at workaround 169bb05 Provide std::map<>::at for use in run_compile_commands 4e2185c Make std::map usage more portable in language=>flags/defines maps a7e7a04 Fix run_compile_commands build on Apple GCC 3.3 c9174c0 Fix signed/unsigned comparison in EscapeJSON 8346a28 Only offer the compile command output feature on unix systems 0e6b05f Adds a test for the compile command line output. 5674844 make compile command output optional fe07b05 implement cxx command output 65c0c24 cache flags and defines 3f064ef refactor flags and defines