Commit Graph

47683 Commits

Author SHA1 Message Date
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
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
Brad King
b30e5fd972 Merge topic 'clang_cuda_prep'
d86fcc6359 CUDAToolkit: Deduce toolkit binary directory from compiler path only for NVCC
87e98bf8be CUDA: Forward CMAKE_CUDA_COMPILER_TARGET in try_compile()
60e60b9201 GNU: Disable depfiles in try-compile mode only for GCC
5f02add366 CUDA: Refactor PTX compilation flag into compiler modules
25439c7d62 Clang: Refactor CXX standard flags into __compiler_clang_cxx_standards()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4567
2020-04-13 10:46:12 -04:00
Kitware Robot
e42389c83f CMake Nightly Date Stamp 2020-04-13 00:01:13 -04:00
Marc Chevrier
9446ec7a2b Merge topic 'FindPython-help-updates'
525c730afe Help: FindPython: fix typos and add some clarifications

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4599
2020-04-12 08:30:25 -04:00
Kitware Robot
26e4d9345c CMake Nightly Date Stamp 2020-04-12 00:01:10 -04:00
Craig Scott
baff868b41 Merge topic 'docs-CMAKE_CURRENT_FUNCTION' into release-3.17
10ee9611f0 Help: Improve wording of CMAKE_CURRENT_FUNCTION_LIST_DIR docs
22fbc404a7 Help: Add cross-references for CMAKE_CURRENT_FUNCTION* docs
d2b139687a Help: Minor grammar cleanups of CMAKE_CURRENT_FUNCTION* docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !4595
2020-04-11 09:12:29 -04:00
Craig Scott
b7e4f80298 Merge branch 'release-3.17' 2020-04-11 09:12:29 -04:00
Craig Scott
75e45f50e5 Merge topic 'docs-CMAKE_CURRENT_FUNCTION'
10ee9611f0 Help: Improve wording of CMAKE_CURRENT_FUNCTION_LIST_DIR docs
22fbc404a7 Help: Add cross-references for CMAKE_CURRENT_FUNCTION* docs
d2b139687a Help: Minor grammar cleanups of CMAKE_CURRENT_FUNCTION* docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !4595
2020-04-11 09:12:29 -04:00
Craig Scott
f0b213e291 Merge topic 'docs-SKIP_PRECOMPILE_HEADERS-formatting' into release-3.17
a293d05c41 Help: Fix unescaped asterisks in docs for SKIP_PRECOMPILE_HEADERS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4592
2020-04-11 09:10:33 -04:00
Craig Scott
41167155d3 Merge branch 'release-3.17' 2020-04-11 09:10:33 -04:00
Craig Scott
b5f39772a4 Merge topic 'docs-SKIP_PRECOMPILE_HEADERS-formatting'
a293d05c41 Help: Fix unescaped asterisks in docs for SKIP_PRECOMPILE_HEADERS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4592
2020-04-11 09:10:33 -04:00
Marc Chevrier
525c730afe Help: FindPython: fix typos and add some clarifications 2020-04-11 12:57:23 +02:00
Kitware Robot
120eb23104 CMake Nightly Date Stamp 2020-04-11 00:01:11 -04:00
Chuck Atkins
cd449c6175 FindMPI: Add the pgi compiler wrapper names used by IBM Spectrum MPI 2020-04-10 12:01:59 -04:00
Brad King
7e302b6438 Merge topic 'openal-typo'
dab57d3f5f FindOpenAL: Fix documentation typos

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4596
2020-04-10 11:05:37 -04:00
Brad King
bf120819c4 Merge topic 'find_program-exe-no-read'
86e6349ef7 find_program: Find programs that are executable but not readable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4571
2020-04-10 09:49:50 -04:00
Nguyễn Gia Phong
dab57d3f5f FindOpenAL: Fix documentation typos 2020-04-10 20:49:10 +07:00
Brad King
9ef0f35670 Merge topic 'ccmake-better-string-ops'
603a532b58 cmCursesLongMessageForm: avoid unnecessary string allocation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sylvain Joubert <joubert.sy@gmail.com>
Merge-request: !4590
2020-04-10 09:48:41 -04:00
Brad King
35eb021942 Merge topic 'FindBLAS_FindLAPACK_ArmPL'
14ffa6e90e Find{BLAS,LAPACK}: Add support for ArmPL targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4502
2020-04-10 09:47:29 -04:00
Brad King
6c737b273a Merge topic 'googletest-skipped'
89a843d6ea GoogleTest: Add testcase for skipped tests
98868dad1c GoogleTest: Add support for skipped tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4586
2020-04-10 09:46:14 -04:00
Alexander Stein
89a843d6ea GoogleTest: Add testcase for skipped tests
This simply runs a mocked test case which uses the prefix for signaling
a skipped test.  CTest's output is checked for a skipped test result.
2020-04-10 09:43:39 -04:00
Alexander Stein
98868dad1c GoogleTest: Add support for skipped tests
Skipped tests are currently reported as successful. Using
SKIP_REGULAR_EXPRESSION on googletest's output prefix, skipped tests can
be detected and accounted accordingly.
Using SKIP_RETURN_CODE is not possible, googletests exit code is not
affected by skipped tests.

Fixes: #19669
2020-04-10 09:43:26 -04:00
Brad King
9be48c4d0b Tests: Add coverage for special characters in include directories
We have tests for special characters in preprocessor definitions and
custom command line arguments.  Add such a test for include directories.
Currently the Makefiles generators do not escape paths in `depend.make`
in all cases, so leave a FIXME comment and skip the test for those.

Issue: #20555
2020-04-10 09:37:30 -04:00
Brad King
dc0dc974a9 Xcode: Fix quoting of paths with square brackets
The Xcode project file format needs paths containing square
brackets ('[' or ']') to be quoted.

Issue: #20555
2020-04-10 09:37:18 -04:00
Brad King
e61e9cec6d Merge branch 'release-3.16' 2020-04-10 08:52:58 -04:00
Craig Scott
10ee9611f0 Help: Improve wording of CMAKE_CURRENT_FUNCTION_LIST_DIR docs
The original wording was somewhat confusing in talking about rendering of
templates. While technically correct, a less experienced user may not know
that terminology. The wording has been updated to more clearly describe the
example usage.

The old way of implementing the example is not "bad", it was the only way to do
things before the CMAKE_CURRENT_FUNCTION_LIST_DIR variable was added.
The example has been updated to remove the Bad/Good captions to reflect this.
Indentation of the examples was also fixed to make them conform to the guidelines.
2020-04-10 22:02:11 +10:00
Brad King
0b495b6ca9 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2020-04-10 (b62956f5)
2020-04-10 07:56:14 -04:00
KWSys Upstream
4ab6fcd676 KWSys 2020-04-10 (b62956f5)
Code extracted from:

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

at commit b62956f5d70fef750e8414342f1566a29e8e7899 (master).

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

Ben Boeckel (6):
      ccab3808 clang-tidy: address readability-isolate-declaration lints
      87b57076 clang-tidy: address readability-braces-around-statements lints
      13b45a41 clang-tidy: address readability-else-after-return lints
      ebb48d58 clang-tidy: address google-readability-casting lint
      09942f51 testSystemTools: add tests for SplitString
      986519af SystemTools: handle splitting a string starting with the separator
2020-04-10 07:56:13 -04:00
Craig Scott
22fbc404a7 Help: Add cross-references for CMAKE_CURRENT_FUNCTION* docs 2020-04-10 21:56:07 +10:00
Craig Scott
d2b139687a Help: Minor grammar cleanups of CMAKE_CURRENT_FUNCTION* docs 2020-04-10 21:55:38 +10:00
Brad King
4c82f309c5 CMake 3.16.6 v3.16.6 2020-04-10 07:37:32 -04:00
Craig Scott
a293d05c41 Help: Fix unescaped asterisks in docs for SKIP_PRECOMPILE_HEADERS 2020-04-10 19:03:47 +10:00
Kitware Robot
41c0adde02 CMake Nightly Date Stamp 2020-04-10 00:01:10 -04:00
Olly Perks
14ffa6e90e Find{BLAS,LAPACK}: Add support for ArmPL targets
Add support for the Arm Performance Libraries (ArmPL) which provide an
implementation of BLAS, LAPACK and FFTW for use on Arm Linux systems:

    https://developer.arm.com/tools-and-software/server-and-hpc/compile/arm-compiler-for-linux/arm-performance-libraries
2020-04-09 11:55:04 -04:00
Brad King
fab932c3cb Merge branch 'release-3.17' 2020-04-09 11:27:14 -04:00
Ben Boeckel
603a532b58 cmCursesLongMessageForm: avoid unnecessary string allocation
The addition makes a temporary string and then drops it after adding it
to `this->Messages`. Instead, just incrementally append.
2020-04-09 11:04:45 -04:00
Brad King
bd580b7d56 CMake 3.17.1 v3.17.1 2020-04-09 08:33:17 -04:00
Brad King
9532929216 Merge topic 'file-upload-tls'
bf94dcba76 file(UPLOAD): Add support for TLS_VERIFY and TLS_CAINFO

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4580
2020-04-09 08:31:19 -04:00