Commit Graph

642 Commits

Author SHA1 Message Date
André Klitzing
c4647d8432 Change ComputeFileMD5 to ComputeFileHash
* Use a parameter to select hash algorithm
* Return a std::string as result or an empty
  string if it fails
* Avoids unnecessary copy of hash value
2017-07-14 08:57:17 +02:00
Pavel Solodovnikov
db2d46e2dd Remove second arg: npos in substr usages 2017-06-01 14:19:52 -04:00
Pavel Solodovnikov
8b6f439ef2 Access string npos without instance 2017-06-01 14:19:51 -04:00
Pavel Solodovnikov
1e4e2f993c Remove unused variables 2017-05-26 19:52:31 +03:00
Pavel Solodovnikov
76bdb40762 Change std::basic_string<char> to std::string 2017-05-24 23:30:57 +03:00
Brad King
74672e2ffa Merge topic 'ninja-dyndep-response-file'
594d3d6f Ninja: support response file for cmake_ninja_depends on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !722
2017-04-25 09:41:18 -04:00
Bernhard Burgermeister
594d3d6fff Ninja: support response file for cmake_ninja_depends on Windows
The internal tool "cmake_ninja_depends" now supports reading the list of ddi
files from a reponse file to circumvent Windows command line length limits.

Use this response file for dyndep rule on Windows.
2017-04-25 09:32:50 +02:00
Brad King
fa338c97d7 Merge topic 'clang-tidy'
73020305 clang-tidy: avoid copy
b432e933 clang-tidy: use .empty() to check emptyness
012972a9 clang-tidy: remove reduntant .data() calls
b26577c9 clang-tidy: remove else after break and continue

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !734
2017-04-24 09:27:48 -04:00
Brad King
718daeb4e6 Merge topic 'unified-commandline-length'
bbb5c3ef Ninja,Makefile: Unify command line limit logic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !705
2017-04-21 08:51:49 -04:00
Daniel Pfeifer
b26577c92a clang-tidy: remove else after break and continue 2017-04-21 10:44:07 +02:00
Brad King
c94f1bcf92 Drop Visual Studio 7 .NET 2003 generator
This generator has been deprecated since CMake 3.6.  Remove it.
2017-04-19 15:28:05 -04:00
Christian Pfeiffer
bbb5c3efe2 Ninja,Makefile: Unify command line limit logic
Move the logic to cmSystemTools to be shared among the generators.
Revise the implementation and add comments justifying each possible
source for a limit.
2017-04-19 11:02:24 -04:00
Daniel Pfeifer
1d829c862c Use quotes for non-system includes
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'
2017-04-11 22:35:21 +02:00
Daniel Pfeifer
e9fc7ff505 Add self-sufficient wrapper for <sys/stat.h> 2017-03-24 22:58:25 +01:00
Daniel Pfeifer
41ec352832 IWYU: use pragma export 2017-03-23 23:38:46 +01:00
Brad King
3c0de6db2d Merge topic 'iwyu'
d58d28a9 ParserHelper: Move macros to bottom of files
07953c18 remove file cmStandardIncludes.h
f918b053 cmFortranParser: include what you use
b74314c6 cmDependsJavaParser: include what you use
74404df4 cmCommandArgumentParser: include what you use
e7168c08 cmExprParser: include what you use
ee72803e fix some include-what-you-use diagnostics
2017-02-20 10:43:07 -05:00
Daniel Pfeifer
ee72803e9f fix some include-what-you-use diagnostics 2017-02-17 22:12:21 +01:00
Brad King
3287ba0254 Make CMAKE_ROOT independent of case of path used to invoke cmake
We compute the location of `CMAKE_ROOT` and other resources relative to
the location of our own executable.  On some platforms this path is
computed in a way that depends on the case of the path used to invoke
the executable.  Convert the result to the actual case preserved by the
filesystem on disk in order to make it consistent regardless of how the
executable is launched.

This approach generalizes the fix made by commit v3.8.0-rc1~71^2
(cmSystemTools: use the actual case for root detection, 2017-01-18).

Issue: #16648
2017-02-17 11:09:12 -05:00
Brad King
0f891007a9 Merge topic 'case-insensitive-bindir-detection'
7f0a21a5 cmSystemTools: use the actual case for root detection
2017-01-20 11:54:37 -05:00
Ben Boeckel
7f0a21a51e cmSystemTools: use the actual case for root detection
On Windows, calling a binary installed with the default `bin` binary
directory will fail to be detected when called as `BIN\cmake.exe` due to
the string compare. Get the actual case of the path before checking that
the path ends with `CMAKE_BIN_DIR`.

Fixes #16574.
2017-01-18 10:08:40 -05:00
Daniel Pfeifer
2988abd939 clang-tidy: apply modernize-use-bool-literals fixes 2016-12-12 14:04:14 -05:00
Dāvis Mosāns
40bd42dfbc Add Encoding option for RunChild, RunMakeCommand and RunProcess 2016-11-15 01:00:46 +02:00
Dāvis Mosāns
595feb3234 Windows: Encode child process output to internally-used encoding
Typically Windows applications (eg. MSVC compiler) use current console's
codepage for output to pipes so we need to encode that to our
internally-used encoding (`KWSYS_ENCODING_DEFAULT_CODEPAGE`).
2016-11-14 21:21:20 +02:00
Brad King
5420278dc8 Port hash computation to cmCryptoHash
Avoid using KWSys MD5 or `cm_sha2` and use the `cmCryptoHash`
abstraction instead.
2016-11-10 08:29:38 -05:00
Brad King
47f91a6183 cmCryptoHash: Avoid using subclasses at client sites
Use only the main `cmCryptoHash` interface.
2016-11-10 08:29:37 -05:00
Dāvis Mosāns
39b08858f6 cmSystemTools: Flush output buffer for list_item_verbose
When `std::cout` and `FILE *stdout` are used at same time need to
explicitly flush otherwise they can be out of sync.
2016-10-13 09:24:45 -04:00
James Cowgill
cd4f573ae9 cmSystemTools, elf: handle DT_MIPS_RLD_REL_MAP in RemoveRPath 2016-10-07 08:30:00 -04:00
James Cowgill
b8b1d15186 cmSystemTools: rewrite RemoveRPath using DyanmicEntryList methods 2016-10-07 08:29:59 -04:00
Brad King
86578eccf2 Simplify CMake per-source license notices
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.
2016-09-27 15:14:44 -04:00
Brad King
b7dcadac44 Merge topic 'add-strverscmp'
88494325 Tests: Add test for our strverscmp implementation
07f69bd5 cmSystemTools: Add strverscmp
2016-09-15 08:46:45 -04:00
Brad King
07f69bd5cc cmSystemTools: Add strverscmp
Add support for natural string order by comparing non-numerical
character directly and numerical number by firstly collecting contiguous
digits.  The order is defined by the `strverscmp(3)` manual [1].

[1] http://man7.org/linux/man-pages/man3/strverscmp.3.html

Inspired-by: Pierluigi Taddei <pierluigi.taddei@gmail.com>
2016-09-13 11:52:28 -04:00
Daniel Pfeifer
8f324c7cef cmSystemTools: simplify boolean expressions 2016-09-12 09:28:21 -04:00
Daniel Pfeifer
1a9de8035c surround macro arguments with parentheses 2016-09-05 22:09:49 +02:00
Daniel Pfeifer
efed6468ed fix a load of include-what-you-use violations 2016-09-03 08:04:56 -04:00
Daniel Pfeifer
7b6349da4d CMake: don't use else after return 2016-08-18 20:36:29 +02:00
Daniel Pfeifer
e7b842e189 Make sure unnused parameters are /*named*/ 2016-08-17 01:49:57 +02:00
Chuck Atkins
02d177c9cc Add additional <= and >= comparison operators
This adds the LESS_EQUAL, GREATER_EQUAL, and associated STR and VERSION
equivalents to use the combined <= and >= functionality.
2016-08-09 09:30:34 -04:00
Dāvis Mosāns
b1f87a50b3 Use better KWSys SystemTools::GetEnv and HasEnv signatures 2016-07-18 09:51:01 -04:00
Daniel Pfeifer
1d6909a287 use CM_NULLPTR 2016-06-28 09:02:26 -04:00
Daniel Pfeifer
a16bf141bc Add missing braces around statements.
Apply fixits of clang-tidy's readability-braces-around-statements
checker.
2016-06-10 18:36:24 +02:00
Brad King
3d6638471a Merge topic 'size-empty'
c6220de2 Use the empty() method to check for emptyness.
2016-06-03 10:45:52 -04:00
Brad King
811831a958 Merge topic 'simplify-boolean-expressions'
7f6b8d33 Simplify boolean expressions
2016-06-03 10:45:40 -04:00
Daniel Pfeifer
c6220de276 Use the empty() method to check for emptyness.
Apply fix-its from clang-tidy's readability-container-size-empty
checker.
2016-06-02 21:35:50 +02:00
Daniel Pfeifer
7f6b8d3399 Simplify boolean expressions
Use clang-tidy's readability-simplify-boolean-expr checker.
After applying the fix-its, revise all changes *very* carefully.
Be aware of false positives and invalid changes.
2016-06-02 08:24:04 -04:00
Nicolas BUNEL
18bfbc972f Add option to control 'bin' directory of CMake's own installation (#16076)
Add a `CMAKE_BIN_DIR` cache entry to CMake's own build configuration.
Add a `--bindir` option to the `bootstrap` script to set it.
2016-06-01 11:12:36 -04:00
Brad King
2a028b7898 Merge topic 'style-cmSystemTools'
8e801eb5 cmSystemTools: Fix indentation typo
2016-05-26 09:52:02 -04:00
Brad King
8e801eb517 cmSystemTools: Fix indentation typo 2016-05-25 09:27:54 -04:00
Daniel Pfeifer
5784747d1b Improve string find: prefer character overloads.
Apply fix-its from clang-tidy's performance-faster-string-find checker.
Ignore findings in kwsys.
2016-05-24 23:22:24 +02:00
Brad King
f4d3c44cc7 Fix support for large RPATH updates (#16105)
Avoid using a KWSys RegularExpression to search for RPATH substrings.
It cannot handle large expressions.
2016-05-19 11:59:25 -04:00
Kitware Robot
d9fd2f5402 Revise C++ coding style using clang-format
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.
2016-05-16 16:05:19 -04:00