Commit Graph

9579 Commits

Author SHA1 Message Date
Brad King 79d7dab1f7 Merge topic 'find_package-refactor-path-generation'
2f69c0233c cmFindPackageCommand: Optimize the last calls to `TryGeneratedPaths`
076a4b44b0 cmFindPackageCommand: Path generators are actually reusable
664abd486f cmFindPackageCommand: Better names for template parameters
c862797a40 cmFindPackageCommand: Rename some generators
fdd14b1744 cmFindPackageCommand: Deduplicate directory listing code
08e7fb3cfa cmFindPackageCommand: Compile-time path generator expressions
61eb5d4de5 cmFindPackageCommand: Avoid friendship between command class and generator
ef62f213f8 cmFindPackageCommand: Drop dead code
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7445
2022-08-03 09:39:48 -04:00
Brad King 4368a524c6 cmCMakePathCommand: Enforce non-empty string arguments via binding type 2022-07-28 08:25:00 -04:00
Brad King 7ca8d9f0f8 cmArgumentParser: Model non-empty strings with wrapper type
Some clients have been explicitly checking whether the string specified
after a keyword is empty.  Offer them a way to specify that the string
must be non-empty as part of the binding type.
2022-07-28 08:24:47 -04:00
Brad King 110baa254b Merge topic 'command-arg-parser'
236bacc244 cmArgumentParser: Offer bindings for positional arguments
1f2eb63d1c cmArgumentParser: Add callback bindings
f5d2f6076a cmArgumentParser: Generalize expected argument count
078e2aec8f cmArgumentParser: Generalize internal state tracking
77fcb00a2b cmArgumentParser: Propagate constructors through binding wrapper types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7514
2022-07-28 08:15:50 -04:00
Brad King b6ffca53f8 Merge topic 'verify-interface-header-sets-interface-library-source-language'
41f15193e5 VERIFY_INTERFACE_HEADER_SETS: Fall back to global languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7517
2022-07-28 08:12:10 -04:00
Brad King d9cca8e83d Merge topic 'verify-interface-header-sets-add-compile-definitions'
27fd172d8d VERIFY_INTERFACE_HEADER_SETS: Finalize compile info for verify targets
626e641a19 cmTarget: Factor out FinalizeTargetCompileInfo()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7516
2022-07-28 08:11:19 -04:00
Kyle Edwards 41f15193e5 VERIFY_INTERFACE_HEADER_SETS: Fall back to global languages
If a target doesn't have any source files, fall back to the global
list of enabled languages to determine the language of the header
file to verify.

Fixes: #23774
2022-07-27 13:29:09 -04:00
Kyle Edwards 27fd172d8d VERIFY_INTERFACE_HEADER_SETS: Finalize compile info for verify targets
Fixes: #23732
2022-07-27 12:25:15 -04:00
Brad King 236bacc244 cmArgumentParser: Offer bindings for positional arguments 2022-07-27 07:03:32 -04:00
Brad King 1f2eb63d1c cmArgumentParser: Add callback bindings 2022-07-27 07:03:32 -04:00
Brad King 77fcb00a2b cmArgumentParser: Propagate constructors through binding wrapper types 2022-07-27 07:03:31 -04:00
Brad King e1d4984706 Tests: Add RunCMake.try_compile case covering empty value arguments 2022-07-26 15:09:49 -04:00
Brad King 6a85813806 Tests: Add RunCMake.try_compile case covering list arguments with no values 2022-07-26 15:09:49 -04:00
Brad King 31ee3cd49d try_compile: Fail earlier when bindir is not an absolute path
If the bindir is not an absolute path, other errors occur later.
Fail early with a clear error in this case.
2022-07-26 14:41:28 -04:00
Brad King f7e81802f2 cmArgumentParser: Offer binding for list of parsed keywords
Some clients ask for this list in their `Parse()` call.
Offer them a way to express this request as a binding.
2022-07-25 13:52:01 -04:00
Brad King f95a5832c7 cmArgumentParser: Drop unused keywordsMissingValue argument to Parse()
All clients have been converted to encoding this requirement in their
bindings.
2022-07-25 13:51:43 -04:00
Brad King 4f8f577015 Merge topic 'cmake-help-flags-after-dashdash'
14a0e750cb cmake: In -P mode ignore flags like `--version` after `--`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7496
2022-07-25 12:00:39 -04:00
Brad King cc663a8c1d Merge topic 'cmake-P-path-args'
febe3190f0 Merge branch 'backport-3.23-cmake-P-path-args'
846a650ff7 cmake: In -P mode ignore extra paths on the command line
c362cba566 cmake: simplify to a single source of truth of working mode
261fa5db39 cmake: In -P mode ignore extra paths on the command line
314135cdf1 cmake: simplify to a single source of truth of working mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7494
2022-07-25 11:57:48 -04:00
Brad King ea209b9f9d Merge topic 'command-arg-parser-result'
8a18e82e95 cmCMakePathCommand: Report keyword errors via argument parser results
7e4a9afa1a cmCMakeHost*Command: Report keyword errors via argument parser results
74ec6b63c2 cmFileCommand: Report keyword errors via argument parser results
e56108f629 cmExecuteProcessCommand: Report keyword errors via argument parser results
b7c82b26b0 cmArgumentParser: Capture keyword errors in parse results
50876f6b9a cmArgumentParser: Add structure to capture operational results
5955ec1992 cmArgumentParser: Store keyword action map with explicit name
119e1f7fbc cmArgumentParser: Factor out common static/dynamic implementation
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7488
2022-07-25 11:52:27 -04:00
Robert Maynard 14a0e750cb cmake: In -P mode ignore flags like --version after --
Fixes: #21031
2022-07-22 14:30:21 -04:00
Robert Maynard 846a650ff7 cmake: In -P mode ignore extra paths on the command line
Fixes: #23748
2022-07-22 13:55:52 -04:00
Brad King 8a18e82e95 cmCMakePathCommand: Report keyword errors via argument parser results 2022-07-22 10:32:25 -04:00
Brad King 7e4a9afa1a cmCMakeHost*Command: Report keyword errors via argument parser results 2022-07-22 10:32:24 -04:00
Brad King 74ec6b63c2 cmFileCommand: Report keyword errors via argument parser results 2022-07-22 10:32:24 -04:00
Brad King e56108f629 cmExecuteProcessCommand: Report keyword errors via argument parser results 2022-07-22 10:32:24 -04:00
Brad King b7c82b26b0 cmArgumentParser: Capture keyword errors in parse results
Since commit f46b2e9142 (cmArgumentParser: Model maybe-missing string
with wrapper type, 2022-07-06) we know during parsing whether or not it
is an error for a keyword to be missing a value.  Record such errors in
the parse results structure.  Offer clients a helper method to report
them.  This provides clients with an alternative to manually checking
`keywordsMissingValue` and generating their own error message.
2022-07-22 10:32:24 -04:00
Brad King 50876f6b9a cmArgumentParser: Add structure to capture operational results
Create a way for the parser to record errors or incidental information
about the argument parsing operation that clients can inspect afterward.
Offer clients a way to hold the structure as part of their arguments
structure.
2022-07-22 10:32:18 -04:00
Brad King 96564c5b2d Merge topic 'FindVulkan-dxc'
1277b873c9 FindVulkan: Add `dxc` (DirectX Shader Compiler) component

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7474
2022-07-22 10:16:23 -04:00
Brad King 66998035c1 Merge topic 'try_run_split_output'
a2cd0687db try_run: Add RUN_OUTPUT_STDOUT_VARIABLE and RUN_OUTPUT_STDERR_VARIABLE.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7453
2022-07-22 10:14:34 -04:00
Brad King 1cee9a9012 Merge topic 'tutorial_cdash_rearrange'
6c77ccec51 Tutorial: Move step 8 to step 5. Shift steps 5-7 to 6-8.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7480
2022-07-22 10:13:49 -04:00
HellsingDarge 1277b873c9 FindVulkan: Add dxc (DirectX Shader Compiler) component 2022-07-20 17:06:31 -04:00
Brad King 1b095729da Tests: Add RunCMake.cmake_path cases for BASE_DIRECTORY missing value 2022-07-20 16:03:12 -04:00
Brad King 5512057c13 Tests: Add RunCMake.file-CHMOD cases for keywords missing values
These make the existing `no-perms` case redundant, so repurpose it
to replace `no-keyword`.
2022-07-20 16:03:12 -04:00
Brad King 1cf2c94c69 Tests: Simplify RunCMake.file-CHMOD cases
Run each case as a `cmake -P` script instead of a full project.
The caller handles build directory removal and creation.
2022-07-20 16:03:12 -04:00
Brad King 11a0f72ac0 Tests: Simplify RunCMake.file-CHMOD case names
The `CHMOD-` prefix is redundant with the overall test name.
2022-07-20 16:03:12 -04:00
Brad King db66f1fede Merge topic 'vs-ZERO_CHECK-proj'
7219988b00 VS: Exclude ZERO_CHECK.proj from .sln for include_external_msproject

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7478
2022-07-20 09:25:11 -04:00
Sumit Bhardwaj 7219988b00 VS: Exclude ZERO_CHECK.proj from .sln for include_external_msproject
In `cmGlobalVisualStudio7Generator::WriteTargetsToSolution`, we skip
writing `ZERO_CHECK.proj` to solution file as the check in
`cmGlobalVisualStudioGenerator::IsInSolution` returns `false` for
`ZERO_CHECK`. However, we write ZERO_CHECK to ProjectDependencies for
external projects as there are no checks in
`cmGlobalVisualStudio71Generator::WriteExternalProject`.

Similar to `cmGlobalVisualStudioGenerator::IsInSolution`, we introduce
`IsDepInSolution(const std::string&)` which excludes `ZERO_CHECK.proj`
from being added to sln file for the cases where we have `ZERO_CHECK.proj`.

Fixes: #23708
2022-07-20 08:51:38 -04:00
Markus Ferrell 6c77ccec51 Tutorial: Move step 8 to step 5. Shift steps 5-7 to 6-8. 2022-07-19 15:32:42 -04:00
Kyle Edwards a186c1aff6 Ninja Multi-Config: Deduplicate compile_commands.json for cross configs
compile_commands.json was being written for every permutation of
cross configurations. Deduplicate so only one command is output
for each configuration.

Fixes: #23733
2022-07-15 16:22:21 -04:00
Kyle Edwards cf8fdf5e43 Merge topic 'export-try-compile-crash'
29c7546a61 cmGlobalGenerator: Only compute build files for all targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7472
2022-07-14 09:56:04 -04:00
Kyle Edwards df559cd8c8 Merge topic 'export-try-compile-crash' into release-3.24
29c7546a61 cmGlobalGenerator: Only compute build files for all targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7472
2022-07-14 09:56:03 -04:00
Kyle Edwards b051fa5392 Merge topic 'vs-msb-8028'
d99d33d749 VS: Generate IntDir property for INTERFACE libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7462
2022-07-14 09:54:46 -04:00
Kyle Edwards 29c7546a61 cmGlobalGenerator: Only compute build files for all targets
If we're creating generation objects for imported targets only, we
don't need the export sets. Only compute build file generators
if generating for all targets.

Fixes: #23709
2022-07-13 11:34:34 -04:00
Alex Turbov a081606855 Tests: Add more find_package search path cases 2022-07-11 17:14:01 +04:00
Patrick Northon a2cd0687db try_run: Add RUN_OUTPUT_STDOUT_VARIABLE and RUN_OUTPUT_STDERR_VARIABLE. 2022-07-08 15:49:02 -04:00
Jonas Fierlings d99d33d749 VS: Generate IntDir property for INTERFACE libraries
This prevents MSBuild from complaining with warning MSB8028.

Fixes #23043
2022-07-08 16:47:01 +02:00
Brad King 974511a870 Merge topic 'command-arg-parser-maybe-empty'
f46b2e9142 cmArgumentParser: Model maybe-missing string with wrapper type
e6d1e29ffa cmArgumentParser: Model maybe-empty and non-empty lists with wrapper types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7459
2022-07-08 09:06:52 -04:00
Brad King cf043b9150 Merge topic 'xcode_swift_definitions'
5cb625eb2f Xcode: Pass compile definitions to Swift

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7388
2022-07-08 09:02:08 -04:00
Brad King f46b2e9142 cmArgumentParser: Model maybe-missing string with wrapper type
Bindings to `std::string` require one value.  Some clients have been
filtering `keywordsMissingValue` to support keywords that tolerate a
missing value.  Offer them a type-safe way to achieve this instead.
2022-07-07 09:49:04 -04:00
Brad King e6d1e29ffa cmArgumentParser: Model maybe-empty and non-empty lists with wrapper types
Previously bindings to `std::vector<std::string>` required at least one
value.  Some clients have been filtering `keywordsMissingValue` to
support keywords followed by empty lists.  Instead, require clients to
specify whether a keyword's list can be empty as part of the binding
type.
2022-07-07 09:48:58 -04:00