summaryrefslogtreecommitdiff
path: root/Source/cmWriteFileCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-1/+1
| | | | | | | | Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to 's_ErrorOccurred' and 's_FatalErrorOccurred', respectively. Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and 'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
* Refactor: Avoid `std::endl` where it's not necessary (part 1)Alex Turbov2020-03-261-1/+1
| | | | | | | The `std::endl` manupulator, except inserting `\n` character, also performs `os.flush()`, which may leads to undesired effects (like disk I/O in the middle of forming data strings). For the `std::stringstream` it also has no meaning.
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-2/+2
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+2
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-1/+1
| | | | | | Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* cmCommand refactor: cmWriteFileCommandGabor Bencze2019-08-201-8/+7
|
* Source: Fix various compiler warnings in Visual Studio 2017Bruno Manganelli2019-01-091-1/+1
|
* file(WRITE): Avoid toggling permissions between 644 and 664David Faure2018-08-011-5/+9
| | | | | | | | | | On systems with umask 022, this function would set permissions to 664 and restore them to 644 at the end, every single time it was called (which is many times on e.g. install_manifest.txt). The intent of the code was to make non-writable files temporarily writable and to restore permissions in the end, but really, if it's already user-writable there's no point in toggling this back and forth.
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-1/+1
| | | | | | | | | | | | 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 6.0. * 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.
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-2/+2
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Add const-reference qualificationsPavel Solodovnikov2017-05-261-1/+1
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | 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-4/+1
|
* Remove redundant c_str() callsDaniel Pfeifer2016-10-301-1/+1
|
* Separate compilation for commands included in cmCommandsDaniel Pfeifer2016-10-211-0/+5
|
* 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.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-33/+23
| | | | | | | | | | | | | 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.
* Source: Stabilize include order of sys/types.h before sys/stat.hBrad King2016-05-031-0/+1
| | | | | Include the two headers in an isolated block with a comment separating them so that tools that re-order includes do not re-order these.
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* Remove borland workarounds.Stephen Kelly2014-10-151-2/+0
| | | | | CMake 3.0 is the last release to require to be able to build with Borland.
* Remove some c_str() calls.Stephen Kelly2014-03-111-2/+2
| | | | | | 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.
* Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-1/+2
| | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-1/+1
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* Borland: No S_IWGRP is availableBrad King2010-06-031-0/+2
|
* Really trust umask in file(WRITE) command (#10789, #10126)Brad King2010-06-031-12/+7
| | | | | | | | | Commit 8d0161c8 (Trust umask for file permissions, 2010-01-12) taught these commands to set permissions to 0666 explicitly. The intention was to let the open() call inside ofstream handle permsisions so that umask would be honored. Now we set permissions only when we need to preserve those on an existing file. New files will be created with umask-based permissions.
* Trust umask for file permissionsBrad King2010-01-121-4/+2
| | | | | Open output files with mode 0666 so that permissions are not more strict than umask permits. See issue #10126.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* BUG: Remove check for files written by file(WRITE) being loaded.Brad King2008-04-301-1/+0
| | | | | | | | | | | | - CMake 1.8 and below did not do the check but could get in infinite loops due to the local generate step. - CMake 2.0 added the check but failed to perform it in directories with no targets (see bug #678). - CMake 2.2 removed the local generate which fixed the problem but did not remove the check. - Between CMake 2.4 and 2.6.0rc6 the check was fixed to work even when no targets appear in a directory (see bug #6923). - Bottom line: the check is no longer needed.
* ENH: add return and break support to cmake, also change basic command ↵Ken Martin2008-01-231-1/+2
| | | | invocation signature to be able to return extra informaiton via the cmExecutionStatus class
* STYLE: fix line lengthKen Martin2006-05-121-1/+2
|
* ENH: Allow blocking of writing into the source treeAndy Cedilnik2006-03-221-0/+10
|
* ENH: Cleanup bootstrap even moreAndy Cedilnik2006-03-221-0/+3
|
* STYLE: some m_ to this-> cleanupKen Martin2006-03-151-1/+1
|
* STYLE: Fix typosAndy Cedilnik2005-07-061-1/+1
|
* BUG: Handle restrictive permissionsAndy Cedilnik2005-03-071-0/+27
|
* ENH: Add check for infinite loops. Make sure that files written using ↵Andy Cedilnik2004-04-181-0/+1
| | | | WRITE_FILE and FILE WRITE are not used as input files. Fixes Bug #678 - WRITE_FILE and FILE(WRITE...) lead to infinite loops
* ENH: Moved ExpandListVariables out of individual commands. Argument ↵Brad King2002-12-111-4/+2
| | | | evaluation rules are now very consistent. Double quotes can always be used to create exactly one argument, regardless of contents inside.
* Make directory if it does not exist yetAndy Cedilnik2002-11-041-2/+5
|
* Add flag to WRITE_FILE to appendAndy Cedilnik2002-10-291-2/+10
|
* ENH: Added reference to Copyright.txt. Removed old reference to ITK ↵Brad King2002-10-231-3/+3
| | | | copyright. Changed program name to CMake instead of Insight in source file header. Also removed tabs.
* removed some includesKen Martin2002-09-271-1/+0
|
* compiler warningKen Martin2002-09-221-1/+0
|
* Fix namespace problemAndy Cedilnik2002-09-211-1/+1
|
* Add WRITE_FILE command, which writes string to a fileAndy Cedilnik2002-09-201-0/+54