summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Windows: Use wide-character system APIsClinton Stimpson2013-12-091-11/+21
| | | | | Make CMake compile with -DUNICODE. Make it possible for the 8 bit encoding to eventually be UTF-8 instead ANSI.
* cmSystemTools: Add PrintSingleCommand methodBrad King2013-11-151-0/+17
| | | | | 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-1/+17
|
* Refactor internal resource location APIs and initializationBrad King2013-11-121-9/+143
| | | | | | | | | | | | | | | | | | | | 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.
* cmake: Avoid '-E tar' failure to extract symlinks on Windows (#13251)Brad King2013-11-011-0/+8
| | | | | | | If a symlink fails to extract and the host system is Windows then report a warning and skip the entry instead of failing. This will allow archives containing symbolic links to be extracted on Windows with somewhat gracefully degraded behavior.
* cmSystemTools: Re-order extract_tar logicBrad King2013-11-011-20/+21
| | | | | | | Simplify extraction message logic to be easier to follow and to write a newline before any error messages that may be produced. Also flip handling of the archive_write_header return code to handle success in the "then" case and failure in the "else" case.
* cmSystemTools: Drop old RunCommand methodBrad King2013-10-191-358/+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/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge topic 'passthru'Brad King2013-07-311-1/+7
|\ | | | | | | | | 2b473d2 Add option to use stdout/stderr of original terminal in cmake --build
| * Add option to use stdout/stderr of original terminal in cmake --buildPatrick Gansterer2013-07-291-1/+7
| | | | | | | | | | | | 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.
* | OS X: If necessary, use xcrun to help find otool used to query install names.Clinton Stimpson2013-07-271-1/+9
|/ | | | | This fixes querying for @rpath install names when using Xcode without the command line tools installed.
* VS: Avoid leaking child process output back to IDE (#14266)Brad King2013-07-161-1/+9
| | | | | | | | | | | | | | The VS IDE sets the environment variable VS_UNICODE_OUTPUT when executing build rules in order to tell MS tools to report output through a back door instead of through stdout/stderr. Unset this variable so that CMake can capture or properly redirect all output from processes it runs even when running inside a VS IDE build environment. This generalizes the special cases fixed by commit 80d045b0 (When GetPrerequisites.cmake runs dumpbin while running inside the VS IDE..., 2008-05-01) and commit 44aff73d (ExternalProject: Avoid bleed-through output when logging, 2011-01-06), so drop special handling of VS_UNICODE_OUTPUT in those instances.
* Merge topic 'make-depends-collapse-paths'Brad King2013-07-021-0/+34
|\ | | | | | | | | 551d334 cmDependsC: Collapse relative include paths
| * cmDependsC: Collapse relative include pathsPavel Shramov2013-06-261-0/+34
| | | | | | | | | | | | | | | | | | 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.
* | Merge topic 'version-compare-genex'Brad King2013-06-261-5/+10
|\ \ | | | | | | | | | | | | | | | e605528 Add generator expressions for version comparision. 48bb48e De-duplicate version comparison code.
| * | De-duplicate version comparison code.Stephen Kelly2013-06-121-5/+10
| | | | | | | | | | | | | | | Extend the VersionCompare in cmSystemTools to handle 8 components, and port the if command to use that.
* | | Add whitespace after colons in error messages.Stephen Kelly2013-06-211-1/+1
| |/ |/|
* | OS X: Improvements for getting install name of dylib.Clinton Stimpson2013-06-061-1/+4
|/ | | | | In the case of a multi-arch dylib where none of the architectures is the host architecture, otool -D returned multiple install names.
* OS X: Add RPATH support for Mac.Clinton Stimpson2013-06-031-0/+21
| | | | | | | | | 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.
* cmSystemTools: Generalize TrimWhitespace to all whitespacePetr Kmoch2013-03-271-2/+2
| | | | | Modify cmSystemTools::TrimWhitespace() to remove all leading and trailing whitespace, not just spaces.
* Fix cmSystemTools::RenameFile race on WindowsBrad King2013-02-041-31/+20
| | | | | | | | | | | | | | | Since commit d46d8df0 (Re-implemented cmGeneratedFileStream to look like a real stream and replace the destination file atomically, 2004-11-03) our RenameFile implementation tries to deal with MoveFile not replacing read-only files. In order to avoid the Get/SetFileAttributes pair we used stat to test for existence of the destination file. This has a race in which the destination could be created between the test for existence and the MoveFile call. Remove the stat call and use GetFileAttributes to detect whether the file exists. This shortens the race but does not eliminate it. Use a loop to try multiple times in case we lose the race. While at it, drop Win9x support and always use MoveFileEx.
* Merge topic 'use-cmsys-auto_ptr'Brad King2012-11-271-1/+0
|\ | | | | | | | | ddc0520 Always use the auto_ptr from cmsys.
| * Always use the auto_ptr from cmsys.Stephen Kelly2012-11-201-1/+0
| | | | | | | | | | | | This is for consistency throughout cmake. The cmsys version exists becaues uses of auto_ptr types as return types does not work with some implementations in ancient compilers.
* | CMake: Fix infinite loop untarring corrupt tar fileDavid Cole2012-11-261-2/+5
|/ | | | Suggested-by: Robert Maynard <robert.maynard@kitware.com>
* Merge topic 'kwsys-environ-cleanup'David Cole2012-05-011-35/+14
|\ | | | | | | | | | | e48796b KWSys: Fix SystemTools environment memory handling (#13156) b10c5cb CTest: Simplify environment save/restore
| * CTest: Simplify environment save/restoreBrad King2012-04-241-35/+14
| | | | | | | | | | | | | | | | 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 topic 'mac_environ'David Cole2012-04-251-0/+3
|\ \ | |/ |/| | | | | a90d478 [OSX] Fixed undefined symbol when linking CMakeLib into shared library
| * [OSX] Fixed undefined symbol when linking CMakeLib into shared libraryKonstantin Tokarev2012-03-031-0/+3
| |
* | Merge branch 'target-include-directories' into ninja-generatorDavid Cole2012-02-221-0/+16
|\ \ | |/
| * Merge topic 'interrupt-bug-12649'David Cole2012-02-141-0/+16
| |\ | | | | | | | | | | | | 131eed6 cmake-gui: Improve interrupt granularity to fix bug 12649.
| | * cmake-gui: Improve interrupt granularity to fix bug 12649.Clinton Stimpson2012-01-021-0/+16
| | | | | | | | | | | | | | | | | | | | | 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/+14
|/ /
* | Handle libarchive API change in archive_read_data_blockBrad King2011-12-221-0/+4
|/ | | | The offset argument type depends on the libarchive version.
* Factor Compute(File|String)MD5 into cmCryptoHash helperBrad King2011-11-161-50/+7
| | | | | | Define an abstract API around the backend hash algorithm. Expose ifstream errors to HashFile callers. Always try opening the file. Succeed only if the end of file is reached without error.
* RunSingleCommand: Avoid assignment in conditionBrad King2011-07-281-1/+1
| | | | | Several compilers warn about this case even when an extra layer of parenthesis surrounds the assignment. Make the condition explicit.
* RunSingleCommand: Add a OUTPUT_NORMAL flag.Johan Björk2011-07-281-1/+21
| | | | | 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-11/+13
| | | | | No behaviour change, this prepares for adding a flag to skip the merging of output streams.
* RunSingleCommand: Fix indentationBrad King2011-07-281-18/+18
|
* cmSystemTools: Remove trailing whitespaceBrad King2011-07-281-81/+81
|
* Merge topic 'xcode-source_groups-folders-issue-10039'Brad King2011-06-081-0/+32
|\ | | | | | | | | | | | | | | 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/+32
| |
* | Merge topic 'dont-compress-memcheck-output'Brad King2011-06-021-1/+1
|\ \ | | | | | | | | | | | | | | | | | | 0e591ed Fix type conversion warning 9c3a0b9 We will actually compress memcheck output if the server supports it. 8024c53 Dynamic analysis test output should not be compressed.
| * | We will actually compress memcheck output if the server supports it.Zach Mullen2011-05-261-1/+1
| |/ | | | | | | | | This change won't be functional until the next release of CDash due to the version comparison.
* | Merge topic 'output-compile-lines'Brad King2011-05-241-0/+16
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | run_compile_commands: Avoid extra stl vector conversionBrad King2011-05-181-0/+16
| |/ | | | | | | | | | | | | The Sun compiler does not provide the proper vector constructor to initialize it from an iterator pair of a non-matching type. Extend the ParseUnixCommandLine API to provide a vector of the proper type so no conversion is needed.
* | Explicitly cast time value in cmSystemTools::RandomSeedBrad King2011-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | Use static_cast to avoid warnings like conversion to ‘unsigned int’ from ‘__time_t’ may alter its value conversion to ‘unsigned int’ from ‘__suseconds_t’ may alter its value We do not care if the value is truncated because we are looking for just 32 bits anyway.
* | VS 6: Define _WIN32_WINNT to load wincrypt.h correctlyBrad King2011-05-181-0/+6
| |
* | Improve string(RANDOM) default seedBrad King2011-05-171-0/+64
|/ | | | | | The naive time(0) seed is unique only within one second. Instead try to read a real source of entropy and otherwise fall back to a combination of the process id and high-resolution time.
* Merge topic 'style-line-length'Brad King2010-09-141-1/+2
|\ | | | | | | | | | | 9d21281 Fix line-too-long style errors 86025d3 file(DOWNLOAD): Fix error message formatting
| * Fix line-too-long style errorsBrad King2010-09-101-1/+2
| |