Commit Graph

32810 Commits

Author SHA1 Message Date
Brad King 7b9757e507 Merge topic 'cuda_mark_toolkit_includes_as_system'
ea659b155d CUDA: Always mark cuda toolkit as system include

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7476
2022-08-19 07:25:00 -04:00
Kitware Robot 26f824f0fa CMake Nightly Date Stamp 2022-08-19 00:01:12 -04:00
Robert Maynard ea659b155d CUDA: Always mark cuda toolkit as system include
Fixes: #23731
2022-08-18 10:37:06 -04:00
Brad King 36d35d4eb1 Merge topic 'cmake-E-env-modify'
c9d70a7cc3 cmake -E env: Add --modify flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7571
2022-08-18 08:04:06 -04:00
Brad King a2cf0db74b Merge topic 'try_compile-no-try_run-args'
b976b844d2 try_compile: Don't accept try_run arguments
24c83bb35b try_compile: Fix quotes in reporting of unknown arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7585
2022-08-18 08:01:02 -04:00
Brad King a336c83520 Merge topic 'argparse-positional-tweak'
f2ef60ca54 cmArgumentParser: Ignore positional after keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7584
2022-08-18 07:58:54 -04:00
Brad King eee5616336 Merge topic 'create_test_sourcelist-special-chars'
f0802b2f50 create_test_sourcelist: Add support for more special characters in paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7587
2022-08-18 07:57:48 -04:00
Kitware Robot b59615e924 CMake Nightly Date Stamp 2022-08-18 00:01:11 -04:00
Matthew Woehlke b976b844d2 try_compile: Don't accept try_run arguments
Modify cmCoreTryCompile to only recognize try_run arguments when
actually parsing try_run. (The old behavior was to recognize try_run
arguments for try_compile also and then complain.)

This has a small chance that a try_run keyword will be consumed as part
of a multi-valued keyword argument. However, this behavior is more
consistent with other commands, as we don't normally treat keywords as
universally reserved. Also, the code is noticeably simplified.
2022-08-17 15:44:35 -04:00
Matthew Woehlke 24c83bb35b try_compile: Fix quotes in reporting of unknown arguments
In commit 6b427d8da9 (cmCoreTryCompile: Port to cmArgumentParser,
2022-08-01) we inadvertently dropped a matching quote during refactoring
of reporting unknown arguments given to try_compile/try_run.  Add the
missing quote to match the old behavior and not have an imbalanced quote
in the warning.
2022-08-17 15:44:29 -04:00
Klaas Speller f0802b2f50 create_test_sourcelist: Add support for more special characters in paths
Use `cmSystemTools::MakeCidentifier` to robustly create a valid function
name to which the test path maps.

Fixes: #23855
2022-08-17 15:34:41 -04:00
Alex Reinking c9d70a7cc3 cmake -E env: Add --modify flag
When `cmake -E env` is given the `--modify` flag, try to parse the
following argument as an `ENVIRONMENT_MODIFICATION` operation and apply
it to the environment.

This generalizes `--unset=`:

1.  When implementing `ENVIRONMENT_MODIFICATION` features for other CMake
    commands, the `MYVAR=OP:VALUE` strings do not need to be translated
    to OP-specific flags.
2.  This provides a natural and consistent extension point to introduce
    new operations without introducing very many flags.
3.  Users need to learn only one syntax to access the same functionality.

There is one difference between the behavior here as compared to CTest's
interpretation of the `ENVIRONMENT_MODIFICATION` test property.
The `MYVAR=reset:` command when run in `cmake -E env` will reset `MYVAR`
to whatever its value was when `cmake -E env` launched, rather than try
to checkpoint after plain `MYVAR=VALUE` options.  This makes `MYVAR=VALUE`
and `--modify MYVAR=set:VALUE` semantically equivalent.
2022-08-17 12:54:39 -04:00
Matthew Woehlke f2ef60ca54 cmArgumentParser: Ignore positional after keyword
Tweak cmArgumentParser to ignore positional arguments once a keyword
argument has been seen. This prevents mingling of keyword arguments
being able to effectively skip positional arguments, with later
arguments being picked up again; this seems highly likely to lead to
user confusion. This is also consistent with how other languages (e.g.
Python) handle a mix of "named" and positional arguments.
2022-08-17 11:03:51 -04:00
Brad King b0ab42c120 Merge topic 'fix-xcode-install-path'
61acaa12af xcode: Don't set INSTALL_PATH unless target is SHARED_LIBRARY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7473
2022-08-17 08:41:33 -04:00
Kitware Robot eb10bcb9fc CMake Nightly Date Stamp 2022-08-17 00:01:14 -04:00
Tor Arne Vestbø 61acaa12af xcode: Don't set INSTALL_PATH unless target is SHARED_LIBRARY
An empty INSTALL_PATH will confuse Xcode, resulting in the archive
action producing archives that can not be uploaded to the App Store.

The logic to pull out a install_name_dir only applies to
SHARED_LIBRARY targets, so we can skip the setting of the
property for all other targets.

There might be cases where the INSTALL_PATH code path will also
end up setting an empty INSTALL_PATH, but it's unclear whether
this is a problem, so to keep the patch minimal the existing
code is left as is.

Fixes: #15183
2022-08-16 13:35:36 -04:00
Brad King 5b949bbb91 Merge topic 'refactor-environment-modification'
a5d45e685f Tests: Add case for ENVIRONMENT_MODIFICATION property OP=reset behavior
e2854b4fa2 cmCTestRunTest: Implement the ENVIRONMENT test property with EnvDiff too
bfa1c5285b cmSystemTools: Add EnvDiff class to hold ENVIRONMENT_MODIFICATION logic
a0b1c4ee90 cmCTestRunTest: Simplify by using GetSystemPathlistSeparator
4e6cbb1f13 cmCTestRunTest: Remove unnecessary CMAKE_BOOTSTRAP guard

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7572
2022-08-16 13:03:33 -04:00
Brad King 67465ca856 Merge topic 'xcode-avoid-compile-flags-on-resources'
7b2359ac53 Xcode: don't set SKIP_PRECOMPILE_HEADERS when source has no language

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !7562
2022-08-16 12:50:00 -04:00
Brad King 14aca54c0a Merge topic 'doc-cmake-cli-options'
0224576995 Help: Replace `cmake -P` option mentions w/ Sphinx role
1b94770f27 Help: Insert link to `cmake --toolchain` option
2c54cd871a Help: Turn items of presets manual page into description list
e2198fd9dc Help: Format `-Werror`/`-Wno-error` in the way it can be referenced
a6070b480f Help: Use placeholder instead of listing choices in option lines
8ba20cb56f Help: Simplify `cmake --log-level` option definition
146e4e6bad Help: Split `ctest` options into groups like `cmake` man page has
4c1008d739 Help: Use `:option:` role to reference `ctest` options
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7554
2022-08-16 12:46:26 -04:00
Brad King ea73a8ea38 Merge topic 'export-no-shdeps'
0ebff0d61a export: Restore exclusion of private shared library dependencies from checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7557
2022-08-16 12:42:21 -04:00
Brad King c082c5c167 Merge topic 'automoc-silence-warnings'
844244ccdc automoc: avoid compiler warnings in linker-warning-silencing code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7558
2022-08-16 12:40:48 -04:00
Kitware Robot ca2f19ca9c CMake Nightly Date Stamp 2022-08-16 00:01:09 -04:00
Alex Reinking e2854b4fa2 cmCTestRunTest: Implement the ENVIRONMENT test property with EnvDiff too
Going through the same internal API for both `ENVIRONMENT` and
`ENVIRONMENT_MODIFICATION` properties will make it easier to implement
checkpointing for `MYVAR=reset:` more efficiently if the need ever
presents itself.  It also makes the two-stage nature of the environment
mutation clearer in the code itself.
2022-08-15 14:19:16 -04:00
Alex Reinking bfa1c5285b cmSystemTools: Add EnvDiff class to hold ENVIRONMENT_MODIFICATION logic
Prepare to re-use this logic when enhancing `cmake -E env`.
2022-08-15 14:11:47 -04:00
Alex Reinking a0b1c4ee90 cmCTestRunTest: Simplify by using GetSystemPathlistSeparator
Part of the implementation of `ENVIRONMENT_MODIFICATION` replicated the
logic in this function. Using it here de-duplicates code and will be
useful during the upcoming refactoring.
2022-08-15 14:11:20 -04:00
Alex Reinking 4e6cbb1f13 cmCTestRunTest: Remove unnecessary CMAKE_BOOTSTRAP guard
CTest is not compiled during CMake's `bootstrap` build.
2022-08-15 14:10:34 -04:00
Brad King 0ebff0d61a export: Restore exclusion of private shared library dependencies from checks
Refactoring in commit 8c65b7042e (cmExportFileGenerator: Simplify
collection of targets missing from export set, 2022-04-11,
v3.24.0-rc1~281^2) accidentally dropped the behavior change from
commit 0ad2a1c181 (Export: Never treat private link libraries as
public package dependencies., 2013-09-24, v3.0.0-rc1~559^2).
Restore the behavior and add a test.

Fixes: #23838
2022-08-15 10:40:03 -04:00
Kitware Robot 7f2eadafea CMake Nightly Date Stamp 2022-08-15 00:01:27 -04:00
Alex Turbov a6070b480f Help: Use placeholder instead of listing choices in option lines
This avoids any ambiguity with whether the choices are literal
values or not. It also makes the option lines more concise.
2022-08-14 09:58:41 +04:00
Alex Turbov 28ecfd1690 Help: Short options first, then long, then Windows style 2022-08-14 09:58:41 +04:00
Alex Turbov 798834ef63 Help: <f><file> for --help* option descriptions 2022-08-14 09:58:41 +04:00
Kitware Robot 6752268610 CMake Nightly Date Stamp 2022-08-14 00:01:09 -04:00
Kitware Robot dc5bf8f506 CMake Nightly Date Stamp 2022-08-13 00:01:12 -04:00
Kitware Robot c4a07be926 CMake Nightly Date Stamp 2022-08-12 00:01:07 -04:00
Andrey Filipenkov 7b2359ac53 Xcode: don't set SKIP_PRECOMPILE_HEADERS when source has no language
Resources that should go into "Copy Bundle Resources" build phase are added as source files but don't have an associated language

Fixes: #23821
2022-08-11 15:26:30 +03:00
Kitware Robot 5d0685aa3e CMake Nightly Date Stamp 2022-08-11 00:01:15 -04:00
Albert Astals Cid 844244ccdc automoc: avoid compiler warnings in linker-warning-silencing code
Revise the code added by !7296 (merged).
Make cmake_automoc_silence_linker_warning less warning-y.
Fix weak-tables clang warning and copyable-polymorph clazy warning.

Fixes: #23823
2022-08-10 22:03:11 +02:00
Brad King 20e544eb24 Merge topic 'fortran-module-dep'
219a9b1e14 Fortran: Fix suprious dependencies with submodules
a7211d6a2f Fortran: Teach lexer to handle CRLF newlines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7529
2022-08-10 09:17:33 -04:00
Kitware Robot 29115e706a CMake Nightly Date Stamp 2022-08-10 00:01:10 -04:00
Vitaly Mogulian 219a9b1e14 Fortran: Fix suprious dependencies with submodules
In commit 695f0d0d3a (cmFortranParser: Parse keywords as lexical tokens,
2016-09-05, v3.7.0-rc1~150^2) we created keyword-specific variants of
the original `USE WORD other EOSTMT` production, such as
`MODULE WORD other EOSTMT` and `INTERFACE WORD other EOSTMT`.  The same
pattern was used by more keyword-specific productions in commit b5ac8b8aa7
(Fortran: Add support for submodule syntax in dependency scanning,
2016-09-05, v3.7.0-rc1~73^2~1).

The postfix part (`other`) of several keyword-specific productions is
not needed to match Fortran syntax.  See the Fortran 2018 standard,
para.4.1.4/1 on p.28, para.14.2.1/2 on pp.293-294.  The postfix is
needed only for a case of operator 'use':

    use <module-name> [, only : <list-of-vars>]

The unnecessary postfix matching from the keyword-specific productions
such as module, submodule, and interface declarations can cause spurious
module dependencies to be detected, so remove it.

Extend the test suite with examples covering the previously-broken
cases.

Fixes: #18427
2022-08-09 09:11:30 -04:00
Brad King a7211d6a2f Fortran: Teach lexer to handle CRLF newlines
We read sources in binary format, so we need to explicitly match CR
(`\r`) characters that occur as part of newlines in CRLF sources.
This is particularly important when line continuation (`&`) occurs
in the middle of module declaration or usage.
2022-08-09 09:09:51 -04:00
Kitware Robot 241fc839d5 CMake Nightly Date Stamp 2022-08-09 00:01:12 -04:00
Brad King ed86192cd8 Merge topic 'doc-markup-program-options'
a6abdf6c8f Help: Consistent options declaration -- short first, then long
f4563f05db Help: Value for `--graphviz=` option actually is mandatory
04843d743e Help: Replace a bunch of more ``--option`` to `:option:` role
09446266ee Help: Replace mentions of ``-D`` option with :option:`-D` role
b57f27b087 Help: Replace mentions of ``-T`` and ``-A`` options with role
d25b232dee Help: Replace mentions of ``-G`` option with :option:`-G` role
63940e1cab Help: Replace mentions of ``-C`` option with :option:`-C` role
183a49cbfe Help: Replace mentions of ``-S`` option with :option:`-S` role
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7544
2022-08-08 09:39:41 -04:00
Kitware Robot 33d2491449 CMake Nightly Date Stamp 2022-08-08 00:01:11 -04:00
Kitware Robot 767052c372 CMake Nightly Date Stamp 2022-08-07 00:01:05 -04:00
Kitware Robot 40db0c34b6 CMake Nightly Date Stamp 2022-08-06 00:01:10 -04:00
Brad King c3da25f3d9 Merge topic 'string-JSON-error-typo'
e0d3e6e147 string(JSON): Fix typo in error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7547
2022-08-05 08:54:53 -04:00
Brad King 9274bdff27 Merge topic 'find_package-one-more-path'
19366408fe cmFindPackageCommand: Protect overrides of `cmDirectoryListGenerator`
e55c154c5b cmFindPackageCommand: Add one more search path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7542
2022-08-05 08:53:09 -04:00
Kitware Robot ba2a9fb765 CMake Nightly Date Stamp 2022-08-05 00:01:13 -04:00
Sean Kahler e0d3e6e147 string(JSON): Fix typo in error message
`s/then/than/` in a comparison.
2022-08-04 15:50:59 -04:00