Also revert commit 9702a01dc9 (Help: string(LENGTH): Fix synopsis link
to command description, 2023-12-30, v3.28.2~23^2). It was only needed
to avoid re-using a named reference that we've now removed.
Issue: #25546
Add the ability to generate CPS package information when install(EXPORT)
is used. This relies on additional information to be passed to CMake,
and is intended as a way of getting CPS out of existing projects without
needing to make changes to the projects' CMakeLists.txt. (Particularly,
this feature is intended for package distributors, not project authors.)
Currently, CMake allows specifying a license (`SPDX_LICENSE`) for both
projects and targets, which is largely motivated by CPS export. The
design of CPS is geared toward components (targets) only expressing an
explicit license when that component's license differs from the license
that applies to the package as a whole (or, at least, the license
generally used by the package's software components). Accordingly, the
project license is not used to initialize the `SPDX_LICENSE` target
property at export time. This, however, was not documented previously.
Add a note explaining this to the `SPDX_LICENSE` option of the `project`
command.
Fixes: #27295
The `SPDX_LICENSE` option of the `project` command requires that the
`CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO` gate is enabled, but this was
not documented. Add the missing documentation.
Fixes: #27328
- Reworded command description.
- Briefly mentioned that this command can also remove other flags given
by add_definitions().
- Added examples section.
- Mentioned also add_compile_definitions() command, as
remove_definitions() can remove also those.
Using `signature` renders the anchor links for each sub-command, and is
consistent with the other `Help/command` pages which contain multiple
sub-commands.
Adds support for "symbolic" components, which represent feature-level
capabilities of a package that do not correspond to actual build targets.
These are modeled as pseudo-targets, using the INTERFACE type as a base,
and can be queried via:
get_target_property(... <tgt> "SYMBOLIC")
This enables consumers to declare requirements on optional features
(e.g., SSL support) even when they do not map to concrete targets.
Fixes: #27187
Create a single place to store target data to prevent duplication.
This moves `targetType` and `targetLabels` out of the snippet files
and into a target map in the `cmakeContent` file referenced by each
snippet.
Fixes: #27244
This was added in 2.6.0 by commit c1b3484c2d (ENH: store the matches for
paren-delimited subexpression..., 2007-08-21, v2.6.0~1227), not in 3.9.
Only the documentation at this place was added in 3.9, by commit
eb08e1febb (Help: Document CMAKE_MATCH_<n> variables, 2017-04-18,
v3.9.0-rc1~257^2)
Explicitly state that if `<PackageName>_DIR` is set, but the version of
the package found there does not match the requested version, then
`find_package` will ignore that directory and continue searching.
Add a `CUSTOM_CONTENT` argument to `cmake_instrumentation()` for collecting
custom content from configure time.
Snippet files include a reference to a JSON file containing any `CUSTOM_CONTENT`
that was added by this command.
Fixes: #26703
Add the support of CACHE{variable} syntax to enable:
* better consistency with other commands which use this syntax
* more flexibility regarding cache variable options
Revert commit b70ef48b27 (install(DIRECTORY): Add
EXCLUDE_EMPTY_DIRECTORIES option, 2025-04-20, v4.1.0-rc1~212^2).
The implementation had at least two problems:
* It did not exclude the top-level directory if empty.
* It did not exclude non-empty directories whose contents are
all filtered out.
Revert the feature pending a revised implementation.
Issue: #19189Closes: #27092