summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmSystemTools: Silence CreateLink and CreateSymlink errorsTushar Maheshwari2019-01-161-15/+13
| | | | | If provided, report errors to a std::string. This allows "silent" fallback to another flow, like COPY_ON_ERROR.
* cmFileCommand: Add CREATE_LINK subcommandTushar Maheshwari2019-01-161-0/+121
| | | | | | | | | | | | | | This brings the functionality of `cmake -E create_symlink` and more to scripts. The default behavior is to create hard links. The `SYMBOLIC` argument can be used to create symlinks instead. The `COPY_ON_ERROR` argument enables a fallback to copying the file in case the link fails. The `RESULT <var>` retrieves the error message generated by the system. It is set to "0" on success. Fixes: #16926
* Merge topic 'semi-warnings'Brad King2019-01-161-6/+8
|\ | | | | | | | | | | | | b056bc3425 Fix most clang -Wextra-semi-stmt warnings in C++ files Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2795
| * Fix most clang -Wextra-semi-stmt warnings in C++ filesSean McBride2019-01-151-6/+8
| | | | | | | | Suppress one in code generated by flex.
* | Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-17/+20
|/ | | | Reduce the number of files relying on `cmake.h`.
* IWYU: Update CMake code for IWYU built with Clang 6Brad King2019-01-151-0/+1
| | | | | IWYU now correctly requires `<utility>` for `std::move`. It also requires a container header when used via a range-based for loop.
* Source: Fix various compiler warnings in Visual Studio 2017Bruno Manganelli2019-01-091-1/+1
|
* clang-tidy: Use default member initializationRegina Pfeifer2018-12-151-7/+3
|
* file: Fix formatting of error in SIZE sub-commandKyle Edwards2018-12-061-1/+1
|
* file: Add READ_SYMLINK sub-commandKyle Edwards2018-12-061-0/+30
|
* Merge topic 'file-size'Brad King2018-11-281-0/+32
|\ | | | | | | | | | | | | 12b471e828 file: add SIZE option Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2639
| * file: add SIZE optionWouter Klouwen2018-11-271-0/+32
| | | | | | | | | | This commit adds the SIZE option to file(). It returns the file size of the given path if it exists and produces an error if not.
* | clang-tidy: Enable checks from bugprone setRegina Pfeifer2018-11-211-3/+4
| |
* | clang-tidy: fix warnings from version 7Regina Pfeifer2018-11-201-1/+1
|/ | | | | Fix some warnings that are new since clang-tidy version 4, and update `.clang-tidy` to suppress the rest.
* Using front() and back() instead of calculationsCengizhan Pasaoglu2018-11-061-1/+1
|
* install: Set permissions on directories created by install(DIRECTORY)Kyle Edwards2018-10-011-18/+38
| | | | | | | The directories that are implicitly created by install(DIRECTORY) were not having their permissions being set by CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS. This change refactors cmFileCopier to take this into account for directory installation.
* Remove unnecessary c_str() callsVitaly Stakhovsky2018-09-051-4/+4
| | | | Use the new IsOn(),IsOff() overloads.
* Merge topic 'file-alt-httpauth'Brad King2018-08-311-0/+8
|\ | | | | | | | | | | | | 31301b46a7 file: Allow DOWNLOAD/UPLOAD using alternate authentication methods Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2320
| * file: Allow DOWNLOAD/UPLOAD using alternate authentication methodsClinton Stimpson2018-08-301-0/+8
| |
* | cmMakefile: return directories as const std::string&Vitaly Stakhovsky2018-08-271-1/+1
|/
* Remove unnecessary c_str() in RegularExpression::find callsVitaly Stakhovsky2018-08-071-4/+4
|
* 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.
* file(STRINGS): Use isprint() to test character typeDevin Nakamura2018-07-101-2/+3
| | | | | | | Use the more portable `isprint()` function to test characters rather than using hard-coded hex values. The function is documented by the C++ standard to return non-zero for the exact range of hex values we previously hard-coded, so this should not change behavior.
* Merge topic 'update-kwsys'Brad King2018-06-251-4/+4
|\ | | | | | | | | | | | | | | | | b41b30f16e Update use of KWSys SystemTools::SplitString for new signature f2d97c1cdf Merge branch 'upstream-KWSys' into update-kwsys 6d7fdedde6 KWSys 2018-06-22 (49068d94) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2165
| * Update use of KWSys SystemTools::SplitString for new signatureBrad King2018-06-221-4/+4
| |
* | file: Drop error cases added by CMake 3.12.0-rc1 to avoid regressionsBrad King2018-06-221-17/+11
|/ | | | | | | | | Refactoring in commit v3.12.0-rc1~418^2~3 (Refactor HandleGlobCommand, 2018-02-13) introduced error diagnostics for argument combinations that were previously accepted. Restore acceptance to avoid regressing projects that used those combinations even if they do not make sense. Fixes: #18097
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-16/+21
| | | | | | | | | | | | 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.
* file(WRITE): Report errors during write operationRuslan Baratov2018-05-161-0/+8
| | | | | We already report an error if the file cannot be opened for writing. Add another check to report an error if a write operation itself fails.
* file(INSTALL): Preserve file time when writing NTFS alternate streamYves Frederix2018-04-231-0/+12
| | | | | | | | | | When cross-compiling on a Windows host, we use a `:cmake_mode_t` NTFS alternate stream to store the file mode for use during packaging. Writing to this stream changes the file modification time, so save and restore the original modification time since we are not modifying the real file content. Fixes: #17922
* Add `CONFIGURE_DEPENDS` flag support to cmFileCommand::HandleGlobCommandShane Parris2018-03-291-0/+38
|
* file(GLOB): Ensure entire file list is sortedShane Parris2018-03-071-12/+7
|
* Refactor HandleGlobCommandShane Parris2018-02-281-71/+78
|
* Adds file(TOUCH) and file(TOUCH_NOCREATE) sub-commandsShane Parris2018-02-151-0/+38
|
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-23/+21
| | | | | | | | | | * 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.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-2/+2
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Move file/dir permissions code to common file.Domen Vrankar2017-11-081-49/+3
|
* CMake: enable setting default dir creation permissionsDomen Vrankar2017-11-081-1/+22
| | | | | | | | | Introduces CMAKE_DEFAULT_DIRECTORY_INSTALL_PERMISSIONS variable which enables the user to specify the default permissions for directory creation. This setting is then used to auto set the permissions on directories which are implicitly created by install() and file(INSTALL) commands such as CMAKE_INSTALL_PREFIX directories.
* file(DOWNLOAD|UPLOAD): Add 'NETRC' and 'NETRC_FILE' suboptionShane Parris2017-10-181-0/+58
|
* Fix left-over occurrences of else-after-returnMatthias Maennich2017-09-281-3/+2
| | | | | | | | Fix issues diagnosed by clang-tidy [readability-else-after-return] These were mostly only showing up on OSX. Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-12/+11
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Merge topic 'string-clear'Brad King2017-09-191-7/+7
|\ | | | | | | | | | | | | 5db3aac1 Meta: replace empty-string assignments with `clear()`. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1276
| * Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-7/+7
| |
* | Use C++11 override instead of CM_OVERRIDEBrad King2017-09-151-9/+9
|/ | | | | | | | We now require C++11 support including `override`. Drop use of the old compatibility macro. Convert references as follows: git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' | xargs sed -i 's/CM_OVERRIDE/override/g'
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-28/+21
| | | | | | 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-10/+12
|
* Use C++11 nullptrDaniel Pfeifer2017-08-241-21/+21
|
* CPackDeb: Enable the DEB generator on WindowsNils Gladitz2017-06-281-13/+28
| | | | | | | | While some features require external Unix tools the generator is mostly portable. By enabling it on Windows it can be used for cross platform packaging.
* Merge topic 'lint-function-args'Brad King2017-06-051-4/+4
|\ | | | | | | | | | | | | b1ec5dea Pass large types by const&, small types by value Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !927
| * Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-4/+4
| |
* | Provide and use CM_FALLTHROUGHDaniel Pfeifer2017-06-031-0/+1
|/