summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
|/
* Add const-reference qualificationsPavel Solodovnikov2017-05-261-1/+1
|
* Merge topic 'mingw-w64-compile'Brad King2017-05-161-0/+4
|\ | | | | | | | | | | | | | | 9557b403 cmFileCommand: Fix build on mingw-w64 845f5e3c bootstrap: fix build on mingw-w64 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !837
| * cmFileCommand: Fix build on mingw-w64Aleksey Chernov2017-05-151-0/+4
| | | | | | | | Include header needed for `CP_ACP`.
* | c++: prefer vectors over listsBen Boeckel2017-05-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | None of these usages of `std::list` were inserting or removing elements in the middle of the structure, so there were no benefits to using it. Other uses were related to C pointers being stable in a list of strings whereas in a vector of strings, small pointer optimizations could be moved and become invalid after a modification to the hosting vector. None of these uses modified the vector after handing out a C string to an external store.
* | clang-tidy: remove else after break and continueDaniel Pfeifer2017-04-211-2/+2
| |
* | file: Add COPY/INSTALL option for fixed layout relative to a directoryBrad King2017-04-131-1/+39
| | | | | | | | | | | | | | | | Add a `FILES_FROM_DIR` option to install a specific set of files specified relative to a given directory and preserve their layout in the destination. Currently we intend to use this internally to implement other things so we don't provide an `install()` porcelain or documentation yet.
* | file: Refactor COPY/INSTALL relative path handlingBrad King2017-04-131-10/+13
| | | | | | | | Delay conversion to absolute path until the last moment.
* | 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'
* | Merge topic 'iwyu'Brad King2017-03-301-2/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 48cfb295 cmFortranParser: remove unnecessary typedef 90bb5f64 cmCommandArgumentParserHelper: remove unnecessary include ab5f4e81 cmFortranParserImpl: remove unnecessary include f8ed8bef testEncoding: use cmsys::ifstream 8647c6cd testEncoding: include <cmsys/ConsoleBuf.hxx> on Windows only 21a6ed49 cmFileCommand: add <cm_curl.h> include a2275bdd cmFileCommand: remove unnecessary friend declaration Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !626
| * | cmFileCommand: add <cm_curl.h> includeDaniel Pfeifer2017-03-291-0/+1
| | |
| * | cmFileCommand: remove unnecessary friend declarationDaniel Pfeifer2017-03-291-2/+0
| | |
* | | handle non-existing symlink creation locationsDomen Vrankar2017-03-281-0/+3
|/ /
* | Add self-sufficient wrapper for <sys/stat.h>Daniel Pfeifer2017-03-241-4/+1
| |
* | file: Add READ_ELF command to parse ELF binariesFlorian Apolloner2017-03-101-0/+69
|/ | | | | Leave it undocumented for now because we intend to use it internally and it cannot be made available everywhere.
* file: Fix crash on GLOB with no expressions after LIST_DIRECTORIESBrad King2017-01-161-1/+1
| | | | | | | | Since commit v3.3.0-rc1~318^2~1 (file: Teach GLOB to list directories optionally, 2015-03-17) using `LIST_DIRECTORIES` followed by no expression causes a crash. Fix the logic to avoid the crash. Fixes: #16565
* clang-tidy: apply readability-static-definition-in-anonymous-namespace fixesDaniel Pfeifer2016-12-121-9/+6
|
* clang-tidy: apply readability-redundant-string-init fixesDaniel Pfeifer2016-12-121-1/+1
|
* iwyu: Fix more findingsDaniel Pfeifer2016-11-281-15/+26
|
* file: Add support for SHA-3 algorithmsBrad King2016-11-101-1/+3
|
* Merge topic 'import-librhash'Brad King2016-11-101-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cd8a57ae Add option to build CMake against a system librhash 71180fc8 FindLibRHash: Add module to find the librhash package 3216e94c Remove unused cm_sha2 infrastructure 5420278d Port hash computation to cmCryptoHash 9a596b33 cmCryptoHash: Re-implement in terms of librhash 47f91a61 cmCryptoHash: Avoid using subclasses at client sites d0ff3e70 librhash: Port to KWIML for ABI and integer type information 465a85fb librhash: Avoid signed left-shift overflow fc2cb74f librhash: Implement bswap_32 as a function even in strict C90 mode 0bd333bc librhash: Implement bswap_64 even in strict C90 mode 7189d62c librhash: Use __builtin_bswap{32,64} on Clang af7ebf8a librhash: Install COPYING file with CMake documentation bb01f20e librhash: Disable warnings to avoid changing 3rd party code 31bb727f librhash: Build the library within CMake 53048afa librhash: Remove source fragments not needed for CMake 5cb1b345 Merge branch 'upstream-librhash' into import-librhash ...
| * Port hash computation to cmCryptoHashBrad King2016-11-101-1/+2
| | | | | | | | | | Avoid using KWSys MD5 or `cm_sha2` and use the `cmCryptoHash` abstraction instead.
* | Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-0/+1
|/
* Encoding: Remove option to use ANSI code page internallyClinton Stimpson2016-11-021-3/+3
| | | | | | The switch to use UTF-8 encoding has been defaulted to on for quite some time since commit v3.2.0-rc1~116^2 (Encoding: Switch to use UTF-8 internally by default on Windows, 2014-12-26).
* Remove redundant c_str() callsDaniel Pfeifer2016-10-301-2/+2
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-2/+2
|
* Fix newly discovered clang-tidy issuesDaniel Pfeifer2016-10-211-6/+2
| | | | | | | Clang-tidy reports some issues only from the currently compiled source file and its associated header file. Separating the compilation of commands exposed some clang-tidy issues that were not reported previously. Fix them.
* fix more issues reported by clang-tidyDaniel Pfeifer2016-10-201-18/+36
|
* 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.
* Use braces around statementsDaniel Pfeifer2016-09-161-1/+2
|
* Avoid else after returnDaniel Pfeifer2016-09-161-24/+34
|
* file(DOWNLOAD|UPLOAD): Add HTTPHEADER suboptionRuslan Baratov2016-09-151-0/+36
|
* file(DOWNLOAD|UPLOAD): Add 'USERPWD' suboptionRuslan Baratov2016-09-131-0/+26
|
* file(DOWNLOAD|UPLOAD): Warn on unexpected argumentsRuslan Baratov2016-09-091-0/+10
| | | | | Emit warning message on unparsed argument instead of silently ignoring it. Can't stop with the error message because it may break old code.
* Use better KWSys SystemTools::GetEnv and HasEnv signaturesDāvis Mosāns2016-07-181-5/+6
|
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-7/+7
| | | | | | | | | | | | Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to our own implementation adopted from the KWSys auto_ptr implementation. Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers that do not warn about it. Automate the client site conversions: git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \ 's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
* use CM_NULLPTRDaniel Pfeifer2016-06-281-16/+16
|
* mark functions with CM_OVERRIDEDaniel Pfeifer2016-06-271-9/+9
|
* Remove redundant arguments from fstream constructorsDaniel Pfeifer2016-06-141-2/+2
| | | | Don't pass the default value of the openmode parameter explicitly.
* file: Sort GLOB results to make it deterministic (#14491)Reiner Herrmann2016-05-171-0/+1
| | | | | | | | | | | | | | | | | Even though the `file(GLOB)` documentation specifically warns against using it to collect a list of source files, projects often do it anyway. Since it uses `readdir()`, the list of files will be unsorted. This list is often passed directly to add_executable / add_library. Linking binaries with an unsorted list will make it unreproducible, which means that the produced binary will differ depending on the unpredictable `readdir()` order. To solve those reproducibility issues in a lot of programs (which don't explicitly `list(SORT)` the list manually), sort the resulting list of the `file(GLOB)` command. A more detailed rationale about reproducible builds is available [here](https://reproducible-builds.org/).
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-1805/+1169
| | | | | | | | | | | | | 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-35/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Isolate formatted streaming blocks with clang-format off/onBrad King2016-05-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clang-format tool can do a good job formatting most code, but well-organized streaming blocks are best left manually formatted. Find blocks of the form os << "...\n" "...\n" ; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}' Find blocks of the form os << "...\n" << "...\n" << "...\n"; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}' Surround such blocks with the pair /* clang-format off */ ... /* clang-format on */ in order to protect them from update by clang-format. Use the C-style `/*...*/` comments instead of C++-style `//...` comments in order to prevent them from ever being swallowed by re-formatting of surrounding comments.
* Source: Stabilize include order of sys/types.h before sys/stat.hBrad King2016-05-031-1/+3
| | | | | 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.