Commit Graph

47771 Commits

Author SHA1 Message Date
Harry Mallon dbfece1004 file(UPLOAD): Add default ca_certs
Default ca_certs were not added when using `UPLOAD` with built-in
(non-system) cURL.  Previously we only did this for `DOWNLOAD`.

Fixes: #20551
2020-04-15 08:55:09 -04:00
Brad King a4173ef165 Tests: Enable coverage of special chars in include dirs for Makefiles
Issue: #20555
2020-04-15 08:34:51 -04:00
Brad King d74e651b78 Makefiles: Re-implement makefile target path escaping and quoting
Previously we used `cmSystemTools::ConvertToOutputPath` which internally
used KWSys methods

* SystemTools::ConvertToUnixOutputPath
* SystemTools::ConvertToWindowsOutputPath

These were written in very early days of CMake and have some
limitations:

* They do not encode all characters.  E.g. '#' is left out.
* They attempt to do some path cleanup and handle existing quotes.
  These days CMake has clean unquoted paths already.
* They attempted to encode paths both for makefile targets and
  for shell command lines.  The latter use has mostly been replaced.
* Choosing between the two methods depends on a global variable!
  Several code paths in CMake have to copy the global generator's
  member ForceUnixPaths variable over to the cmSystemTools global.

Re-implement the `ConvertToMakefilePath` method to drop use of those
methods.  Compute suitable makefile target path escaping and quoting
via local logic.  Add support for more characters like '#'.

Fixes: #20555
2020-04-15 08:34:49 -04:00
Brad King 031bfaa865 Makefiles: Factor out makefile target path escaping and quoting
Code paths that write makefile target paths use a combination of
`cmSystemTools::ConvertToOutputPath` and `cmMakeSafe`.  Some were
missing the latter.  Wrap these two steps up into a dedicated
`ConvertToMakefilePath` method provided on both the local and global
generators.
2020-04-15 08:34:48 -04:00
Brad King ca343dad07 Makefiles: Convert paths with '#' on command-lines to short path on Windows
In `ConvertToOutputForExisting` we convert paths with spaces to short
paths on Windows for use on command lines, e.g. for include directories.
Do the same for paths with `#` since tools like NMake do not have a way
to reliably put `#` in variable assignments.
2020-04-15 08:34:46 -04:00
Brad King af7de05853 Makefiles: Do not use '\#' escape sequence with Windows-style make tools
Since commit fbf7a92975 (Makefile: Handle '#' in COMPILE_OPTIONS,
2014-08-12, v3.1.0-rc1~174^2) we escape `#` as `\#` in `flags.make`
variable assignments so that they are not treated as a comment.
Windows-style make tools like NMake do not interpret backslashes
in that way.  Other means will be needed to handle `#` in contexts
where it is even possible.  The test suite is not covering this
for NMake anyway, and actually has a workaround in `Tests/TryCompile`
for the old behavior, which we can now update.
2020-04-15 08:34:18 -04:00
Brad King 87a06afce3 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2020-04-15 (5ada375f)
2020-04-15 06:41:18 -04:00
KWSys Upstream 1b37136633 KWSys 2020-04-15 (5ada375f)
Code extracted from:

    https://gitlab.kitware.com/utils/kwsys.git

at commit 5ada375fcf564e837672eecbca2d522105daebf1 (master).

Upstream Shortlog
-----------------

Ben Boeckel (3):
      83b20b65 clang-tidy: address `readability-braces-around-statements` lint
      535633fa clang-tidy: address `readability-isolate-declaration` lint
      de210648 clang-tidy: address `readability-else-after-return` lint
2020-04-15 06:41:16 -04:00
Kitware Robot c63fb217c0 CMake Nightly Date Stamp 2020-04-15 00:01:08 -04:00
Brad King 6046baecce Merge branch 'ibmi-aix-exports' into release-3.16
Merge-request: !4611
2020-04-14 14:50:11 -04:00
Brad King 096958dfce Merge branch 'FindMPI-pgi-spectrum-mpi-wrappers' into release-3.16
Merge-request: !4598
2020-04-14 14:49:56 -04:00
Brad King 420e91c951 AIX: Activate symbol export/import IBM i (OS400)
Fixes: #20582
2020-04-14 14:45:51 -04:00
Robert Maynard 8cc384f629 Compilers: Add paths from -print-sysroot to system prefix path 2020-04-14 13:48:28 -04:00
Ben Boeckel 894fdea2a9 FindPython: remove extra dereference
If the version is not found (e.g., missing headers), this causes a CMake
error about `if(blah VERSION_EQUAL)` being an invalid statement.
2020-04-14 11:03:35 -04:00
Ben Boeckel 0b9c9e2c8c FindPython: avoid autoderef in version comparisons 2020-04-14 11:03:35 -04:00
Vitaly Stakhovsky e64fa5f1b6 cmSourceFile::GetProperty: return cmProp 2020-04-14 10:57:17 -04:00
Brad King fc223f9860 cmGlobalXCodeGenerator: Fix genex interpreter overloads
Overload both signatures to add Xcode-specific functionality.

Co-Author: Vitaly Stakhovsky <vvs31415@gitlab.org>
2020-04-14 10:56:45 -04:00
Brad King d59c6ea5c6 Help: Convert find_package references to CMAKE_PREFIX_PATH to links 2020-04-14 10:08:23 -04:00
Jean-Michaël Celerier 03b6f3a2e8 Help: Document the CMAKE_PREFIX_PATH environment variable 2020-04-14 10:04:58 -04:00
Jiri Malak 06e2c54115 CMakePrintSystemInformation: Add CMAKE_SYSTEM_PROCESSOR 2020-04-14 09:48:50 -04:00
Brad King 734238d64f Merge topic 'sort_list_natural_20563'
da99eca1e7 list: add NATURAL sorting on SORT sub-command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4602
2020-04-14 09:45:55 -04:00
Brad King b54d80b293 Merge topic 'cmake-gui-system-processor'
11cbf79d15 cmake-gui: Pass CMAKE_SYSTEM_PROCESSOR to from gui to cmake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4604
2020-04-14 09:43:34 -04:00
Brad King 1ee921531c Merge topic 'clang-tidy-9.0-changes'
7cb72fadc8 cmConfigureFileCommand: simplify no-op argument handling
f413727d27 clang-tidy: address bugprone-sizeof-expression lint
609c3b7cdc cmComputeLinkInformation: reserve space in built-up string
89207abf1f cmParseCacheCoverage: use cmSystemTools::SplitString
59b7adddc4 nits: replace some "c" instances with 'c'
80edc2cd8a cmMakefile: use std::string_view
37872088cf clang-tidy: address readability-else-after-return lint
f2a33107be clang-tidy: address bugprone-branch-clone lints
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4584
2020-04-14 09:42:17 -04:00
Robert Maynard 4f1e24efa0 FindCUDAToolkit searches stub location last
Fixes #20252
2020-04-14 09:39:46 -04:00
Brad King ce9777c62f Merge topic 'UseJava-quoting'
01d5b888a3 UseJava: Quote -classpath argument correctly on more platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Marc Chevrier <marc.chevrier@gmail.com>
Merge-request: !4597
2020-04-14 09:39:37 -04:00
Johnny Jazeix d6840a4f3c CPack/NSIS: Add option for setting DPI-aware
See https://nsis.sourceforge.io/Reference/ManifestDPIAware
for more information.

Fixes: #17724
2020-04-14 13:47:49 +02:00
Kitware Robot deba768e14 CMake Nightly Date Stamp 2020-04-14 00:01:11 -04:00
Justin Goshi bc877a7e94 Add support to indicate UTF-8 custom command pipe output encoding
Adds a flag to indicate that pipe output from a custom command should be
interpreted as UTF-8 encoded. This change does not introduce a public
way to set the flag, but generators that create internally-generated
commands know if they are calling cmake, which uses UTF-8 pipes.

MSBuild added support for interpreting output of PreBuildEvent,
PreLinkEvent, PostBuildEvent, and CustomBuildStep as UTF-8. This change
will appear in Visual Studio 16.6 Preview 3. It is opt-in, and you need
to add the StdOutEncoding tag. MSBuild treats these as property bags so
if we emit the tag for earlier versions of Visual Studio it would be
safely ignored. This change emits the StdOutEncoding tag and sets it to
UTF-8 whenever the custom command UTF-8 pipe flag is set. This fixes
globalization issues when the output from cmake contained characters
that required MSBuild to interpret as UTF-8 before displaying them.
2020-04-13 12:54:47 -07:00
Johnny Jazeix da99eca1e7 list: add NATURAL sorting on SORT sub-command
Fixes: #20563
2020-04-13 18:26:28 +02:00
Ben Boeckel 7cb72fadc8 cmConfigureFileCommand: simplify no-op argument handling 2020-04-13 11:26:03 -04:00
Ben Boeckel f413727d27 clang-tidy: address bugprone-sizeof-expression lint 2020-04-13 11:26:03 -04:00
Ben Boeckel 609c3b7cdc cmComputeLinkInformation: reserve space in built-up string
This should avoid any reallocations that would occur in this function.
2020-04-13 11:26:03 -04:00
Ben Boeckel 89207abf1f cmParseCacheCoverage: use cmSystemTools::SplitString 2020-04-13 11:26:03 -04:00
Ben Boeckel 59b7adddc4 nits: replace some "c" instances with 'c' 2020-04-13 11:26:03 -04:00
Ben Boeckel 80edc2cd8a cmMakefile: use std::string_view 2020-04-13 11:26:03 -04:00
Ben Boeckel 37872088cf clang-tidy: address readability-else-after-return lint 2020-04-13 11:26:03 -04:00
Ben Boeckel f2a33107be clang-tidy: address bugprone-branch-clone lints
Arguably, many of these are bugs in `clang-tidy`. An if/else tree with
other conditionals between cloned blocks may be relying on the
intermediate logic to fall out of the case and inverting this logic may
be non-trivial.

See: https://bugs.llvm.org/show_bug.cgi?id=44165
2020-04-13 11:26:02 -04:00
Ben Boeckel 4e9e7c713e clang-tidy: ignore making members static
CMake has lots of instances of this which is outside the scope of this
topic right now.
2020-04-13 11:26:02 -04:00
Ben Boeckel b108c9fdaf TestDriver: avoid clang-tidy lints in generated code 2020-04-13 11:26:02 -04:00
Ben Boeckel 77a1e80380 clang-tidy: ignore the use-trailing-return-type lint
CMake isn't ready for this yet.
2020-04-13 11:26:02 -04:00
Jiri Malak 11cbf79d15 cmake-gui: Pass CMAKE_SYSTEM_PROCESSOR to from gui to cmake
Add missing `CMAKE_SYSTEM_PROCESSOR` cmake cache entry to passed options
for first configure.  We already pass `CMAKE_SYSTEM_{NAME,VERSION}`.
2020-04-13 11:17:10 -04:00
Brad King 1639ee70ef cmDepends: Update types to always use a Makefile generator
We only use these classes with a `cmLocalUnixMakefileGenerator3`.
Construct using that type instead of just `cmLocalGenerator` so
that the Makefile-specific methods are available.
2020-04-13 11:03:00 -04:00
Brad King 413d26030f cmGlobalNinjaGenerator: Remove outdated comment 2020-04-13 11:02:59 -04:00
Brad King eb28858586 Merge topic 'include-dir-special'
9be48c4d0b Tests: Add coverage for special characters in include directories
dc0dc974a9 Xcode: Fix quoting of paths with square brackets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4591
2020-04-13 11:01:03 -04:00
Brad King da586cf190 Merge branch 'release-3.17' 2020-04-13 10:57:23 -04:00
Brad King adc58e9612 Merge topic 'FindMPI-pgi-spectrum-mpi-wrappers'
cd449c6175 FindMPI: Add the pgi compiler wrapper names used by IBM Spectrum MPI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4598
2020-04-13 10:57:23 -04:00
Brad King e14386db8f Merge topic 'FindMPI-pgi-spectrum-mpi-wrappers' into release-3.17
cd449c6175 FindMPI: Add the pgi compiler wrapper names used by IBM Spectrum MPI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4598
2020-04-13 10:57:22 -04:00
Brad King 32aba2e7ee Merge branch 'release-3.17' 2020-04-13 10:55:50 -04:00
Brad King d3fa00a14b Merge branch 'release-3.16' into release-3.17 2020-04-13 10:54:25 -04:00
Brad King 140c11e8d0 Merge topic 'update-kwsys'
0b495b6ca9 Merge branch 'upstream-KWSys' into update-kwsys
4ab6fcd676 KWSys 2020-04-10 (b62956f5)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4594
2020-04-13 10:47:55 -04:00