Commit Graph

1747 Commits

Author SHA1 Message Date
Brad King
303ffae24f Merge topic 'deprecate-CMAKE_ENABLE_EXPORTS'
33d9146472 CMAKE_ENABLE_EXPORTS: Deprecate variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11381
2025-11-05 10:25:26 -05:00
Peter Kokot
33d9146472 CMAKE_ENABLE_EXPORTS: Deprecate variable
This makes it more clear which variable should be used.

Fixes #27357
2025-11-04 20:07:39 +01:00
Hanna Rusakovich
a73ddd2ddb file(CREATE_LINK): Implement COPY_ON_ERROR for directories
Add policy `CMP0205` for compatibility with projects not expecting this.

Fixes: #27294
2025-10-31 08:42:59 +03:00
Brad King
5ae9d92a92 Merge topic 'project-license-doc'
ebf0a359ad Help: Improve documentation of project SPDX_LICENSE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11348
2025-10-28 09:32:40 -04:00
Matthew Woehlke
ebf0a359ad Help: Improve documentation of project SPDX_LICENSE
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
2025-10-27 10:38:40 -04:00
Brad King
f96cb60ba3 Merge topic 'fix-project-license-doc'
6500ea2776 Help: Add missing gate for project(SPDX_LICENSE)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11342
2025-10-24 17:02:26 -04:00
Matthew Woehlke
6500ea2776 Help: Add missing gate for project(SPDX_LICENSE)
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
2025-10-23 11:36:16 -04:00
Peter Kokot
6374f70915 remove_definitions: Update documentation
- 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.
2025-10-21 22:23:15 +02:00
Brad King
8183c6a9ba Merge topic 'fix-copy-on-error-directory-info'
657e9be724 file(CREATE_LINK): Document `COPY_ON_ERROR` behavior on directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11299
2025-10-12 09:20:20 -04:00
Brad King
7095118a78 Merge topic 'fix-copy-on-error-directory-info' into release-4.2
657e9be724 file(CREATE_LINK): Document `COPY_ON_ERROR` behavior on directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11299
2025-10-12 09:20:18 -04:00
Alex Overchenko
657e9be724 file(CREATE_LINK): Document COPY_ON_ERROR behavior on directories
Issue: #27294
2025-10-10 10:26:36 -04:00
Tyler Yankee
c575d84555 Help: Use signature directive for cmake_path command
Using `signature` renders the anchor links for each sub-command, and is
consistent with the other `Help/command` pages which contain multiple
sub-commands.
2025-10-08 20:44:38 -04:00
Brad King
927ccf212f Merge topic 'help-TRYRUN_OUTPUT_STDOUT'
6d61783103 Help: Document try_run output cache entries for cross-build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11284
2025-10-07 09:02:32 -04:00
Jinzhe Zeng
6d61783103 Help: Document try_run output cache entries for cross-build
Document `try_run` cache entries added by commit a2cd0687db (try_run:
Add RUN_OUTPUT_STDOUT_VARIABLE and RUN_OUTPUT_STDERR_VARIABLE.,
2022-07-08, v3.25.0-rc1~443^2):

* `<runResultVar>__TRYRUN_OUTPUT_STDOUT`
* `<runResultVar>__TRYRUN_OUTPUT_STDERR`

Fixes: #27281
2025-10-06 10:33:54 -04:00
Brad King
0d01bc72b8 Merge topic 'cps-symbolic-info'
62a1d3e7f1 FileAPI: Add symbolic property to targets
d92b6c3e20 CPS: Add Symbolic Components
03284e018f Help: Simplify file-api version information for "abstract" field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11132
2025-10-03 11:24:50 -04:00
Brad King
caf01b88bc Merge topic 'instrumentation-target-content'
97adbc91fa instrumentation: Move target data into content files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !11251
2025-10-03 11:21:17 -04:00
Taylor Sasser
d92b6c3e20 CPS: Add Symbolic Components
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
2025-10-02 10:46:02 -04:00
Martin Duffy
97adbc91fa instrumentation: Move target data into content files
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
2025-10-02 09:28:20 -04:00
Brad King
6babe38916 Help: Fix cmake_language(TRACE) command anchor 2025-10-01 09:23:33 -04:00
Brad King
0c51c19553 Merge topic 'patch-rst-typos'
ee25bc5434 Help: Fix typos in versionadded directives

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11237
2025-09-25 09:12:55 -04:00
Peter Kokot
ee25bc5434 Help: Fix typos in versionadded directives 2025-09-23 20:53:21 +02:00
Alex Turbov
cb07358256 cmake_language: add TRACE subcommand
Closes 27235.
2025-09-23 03:02:03 +04:00
Timo Röhling
d94d79a909 string: Add REGEX QUOTE sub-command
Add a command to generate a regular expression that matches an
input string literally by escaping special characters.

Fixes: #18580
2025-09-18 13:25:20 -04:00
Alexander Grund
2adfa8b0d4 Help: Fix version added for CMAKE_MATCH_<n>
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)
2025-09-11 13:09:18 -04:00
Brad King
d75c507d0a Merge topic 'instrumentation-trace'
8d04c4d741 Experimental: Update the Instrumentation UUID
bf52fbfbc4 instrumentation: Add Google trace output
b6dcbc4387 Tests/RunCMake/Instrumentation: Improve formatting
27bc7d5782 Tests/RunCMake/Instrumentation: Factor out common JSON logic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11124
2025-09-04 09:15:59 -04:00
Tyler Yankee
bf52fbfbc4 instrumentation: Add Google trace output
Add a feature to parse snippets into a trace file compatible with the
Google Trace Event Format.

Fixes: #26674
2025-09-03 15:24:10 -04:00
Brad King
c3bdb07a94 Merge topic 'document_find_package_dir_version'
f104bdb3b9 Help: Specify `<PackageName>_DIR` interaction with a version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11114
2025-09-01 14:37:50 -04:00
Meszaros, Gergely
f104bdb3b9 Help: Specify <PackageName>_DIR interaction with a version
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.
2025-08-26 08:27:15 +00:00
Martin Duffy
e6b37105ba instrumentation: Collect custom content from CMake configure
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
2025-08-21 07:20:12 -04:00
Tyler Yankee
ac8fe36aba Help: Improve clarity of foreach behavior 2025-08-13 16:29:18 -04:00
Marc Chevrier
8af64914d6 set/unset commands: add CACHE{variable} syntax support
Add the support of CACHE{variable} syntax to enable:
* better consistency with other commands which use this syntax
* more flexibility regarding cache variable options
2025-08-04 20:46:23 +02:00
Vito Gamberini
cba75e669a find_xxx: Clarify command description
Also cleans up a missing infinitive in find_file

Fixes: #25844
2025-08-01 11:33:13 -04:00
Brad King
318f90ff5f Merge topic 'revert-install-DIRECTORY-exclude-empty'
21e99dbf49 install(DIRECTORY): Revert "Add EXCLUDE_EMPTY_DIRECTORIES option"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10977
2025-07-29 09:40:54 -04:00
Brad King
21e99dbf49 install(DIRECTORY): Revert "Add EXCLUDE_EMPTY_DIRECTORIES option"
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: #19189
Closes: #27092
2025-07-28 14:21:09 -04:00
Ralf Habacker
b3f2455862 Help: The old add_test() form does not support TEST_LAUNCHER
Extend commit 1ec0372ed4 (add_test: Optionally use a launcher for tests
running in-project targets, 2023-11-11, v3.29.0-rc1~237^2~1).

Fixes: #27083
2025-07-28 08:20:00 +02:00
Brad King
5e26f8d3a7 Merge topic 'instrumentation-ctest-interface'
21ac285cd8 Experimental: Update the Instrumentation UUID
9dec460c8c instrumentation: Store CDash settings in query files
afa94bae1e instrumentation: Rename queries field to options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10934
2025-07-21 10:13:32 -04:00
Brad King
f8dcf102d9 Merge topic 'find-package-unwind'
f61768107e find_package: Implement UNWIND_INCLUDE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10943
2025-07-21 10:09:00 -04:00
Vito Gamberini
f61768107e find_package: Implement UNWIND_INCLUDE
This implements a limited exception mechanism for find_package() via
the UNWIND_INCLUDE keyword.

When package discovery via find_package(UNWIND_INCLUDE) fails the
StateSnapshot is updated to an UNWINDING state. In this state further
calls to find_package() and include() are forbidden. While in the
UNWINDING state, the include() command immediately calls
SetReturnInvoked() whenever it is reached.

The UNWINDING state is reset when a parent call to find_package() is
reached.

Fixes: #26897
2025-07-13 16:08:19 -04:00
Martin Duffy
afa94bae1e instrumentation: Rename queries field to options
Fixes: #26728
2025-07-10 16:25:07 -04:00
Dan Raviv
72bb891348 Help: Document WORKING_DIRECTORY default behavior missing in some commands 2025-07-09 19:33:35 -07:00
Brad King
62c8d7207b Merge topic 'doc-cmake_path'
41488e0c41 Help: Fix cmake_path examples

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10923
2025-07-03 12:58:32 -04:00
xndcn
41488e0c41 Help: Fix cmake_path examples 2025-07-02 09:54:18 -04:00
Matthew Woehlke
755a24ccae CPS: Add export support for [default_]license
Add `LICENSE` and `DEFAULT_LICENSE` arguments to the `PACKAGE_INFO`
modes of the `install` and `export` commands. If not otherwise
specified, the `LICENSE` will be taken from the project's
`SPDX_LICENSE`, if available.
2025-06-20 14:01:25 -04:00
Matthew Woehlke
fba540daf6 project: Add SPDX_LICENSE argument
Add an argument to the `project` command to allow specifying a license
for a project as a whole. This is in addition to specifying licenses on
individual targets, and will be used to set the license(s) on exported
packages.

Also, move listing of `COMPAT_VERSION` variables to follow
lexicographical order.
2025-06-20 14:01:25 -04:00
Matthew Woehlke
f0b419c473 Help: Tweak project DESCRIPTION documentation
Replace the 'project-description-string' descriptor in the `project`,
`export` and `install` commands with 'description-string'. This is more
consistent, as none of the other descriptors include 'project-', and
it's arguably wrong in the context of `export`/`install`, as the
description applies to a package.
2025-06-20 14:01:25 -04:00
Brad King
4fd8f96c26 Merge topic 'improve-project-doc'
1cd8c8f02a Help: Mention use of project() variables in packages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10895
2025-06-20 13:47:12 -04:00
Matthew Woehlke
1cd8c8f02a Help: Mention use of project() variables in packages
The `project` command mentions that it sets variables "intended for use
as default values in package metadata". Add a sentence that the
`install` and `export` commands actually do so for CPS. Also add
`COMPAT_VERSION` to the list of relevant options.
2025-06-19 10:34:46 -04:00
Moritz Haase
61d8fae116 find_package: Use deterministic search order by default
Historically, find_package() does not guarantee the order in which directories
matching a search path containing a glob expression are processed in - the
"first valid package" will be selected if there are multiple candidates. In such
cases, which package is chosen is completely random and can change, potentially
leading to build failures and reproducibility issues. This is rather unexpected
and confusing for developers.

Now that CMake has bumped its major version, it's a good time to change default
sort order and direction could be changed to natural sorting with a descending
order. That will result in the newest version of a library being picked in case
there are multiple ones available.
2025-06-18 06:34:59 +02:00
Ben Boeckel
b634998727 Help: add and make references to generators consistent 2025-06-12 21:25:24 +02:00
Brad King
7fbd43c84c Merge topic 'cps-more-metadata'
da97747dac CPS: Support additional metadata
f224e131a5 CPS: Refactor metadata handling
7155903e53 cmExportPackageInfoGenerator: Fix style

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10856
2025-06-06 08:28:25 -04:00