Commit Graph

1738 Commits

Author SHA1 Message Date
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
Brad King
852c54fa52 Merge topic 'fix-project-compat_version-doc'
01f6067ce4 Help: Note when `project(COMPAT_VERSION)` was added

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10858
2025-06-05 09:36:08 -04:00
Craig Scott
ab184e453f Merge topic 'patch-FindGTest'
d8b8183425 FindGTest: Deprecate result variables and update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10760
2025-06-04 16:56:31 -04:00
Matthew Woehlke
01f6067ce4 Help: Note when project(COMPAT_VERSION) was added
Tweak documentation of `project()` to note when the (experimental for
now) `COMPAT_VERSION` argument was added.
2025-06-04 11:21:57 -04:00
Matthew Woehlke
da97747dac CPS: Support additional metadata
Add support for specifying CPS's supplemental `description` and
`website` attributes. Add ability to inherit these from the `project()`,
similar to how version information can be inherited.
2025-06-03 16:50:46 -04:00
Matthew Woehlke
ecf81c1bc1 CPS: Get metadata from project
Modify {export,install}(PACKAGE_INFO) commands to inherit version
information from the current project in situations where it seems
reasonable to do so. Add an option to explicitly request inheritance
from a specific project.

This leverages the recently added project(COMPAT_VERSION).
2025-06-02 10:31:36 -04:00
Peter Kokot
d8b8183425 FindGTest: Deprecate result variables and update documentation
This updates the module documentation and deprecates some result
variables in favor of using imported targets.

Changes:
- Synced module documentation with other similar find modules.
- Reworded and updated descriptions.
- Renamed "Cache Variables" to "Hints".
- Added info about config mode.
- Added separate section "Deprecated Items".
- Mention of Threads::Threads imported target removed.
2025-06-02 08:01:19 +10:00
Brad King
26460454b7 Merge topic 'patch-CheckCompilerFlag'
ac67631b02 Check{,C,CXX,Fortran,OBJC,OBJCXX}CompilerFlag: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10840
2025-05-30 09:35:17 -04:00
Peter Kokot
ac67631b02 Check{,C,CXX,Fortran,OBJC,OBJCXX}CompilerFlag: Update documentation
- Added intro code blocks showing how to include these modules.
- Used word "command" instead of "macro".
- Added examples sections.
- Updated and synced descriptions of commands and arguments.
- Added a rubric title for variables that affect the checks.
- Listed CMAKE_TRY_COMPILE_TARGET_TYPE variable in the rubric together
  with CMAKE_REQUIRED_* variables.
- Added link to CheckCompilerFlag module in the target_compile_options()
  docs.
- Used lowercase style for check_fortran_compiler_flag() command.
- Added a link to `$<COMPILE_LANGUAGE:languages>` generator expression
  so it can be linked from other pages (See commit
  2e37a20f02 for more info on the initial
  style used).
- Fixed the GENEX_NOTE inclusion (starting with line after the 2nd line)
  where part of the sentence was rendered in the output.
2025-05-29 00:16:39 +02:00
Brad King
3fdd1a1d13 Autogen: Replace documentation links with their permanent redirects 2025-05-28 11:11:20 -04:00