Commit Graph

1728 Commits

Author SHA1 Message Date
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
Matthew Woehlke
551d4e399a Help: Improve CPS install documentation
Add documentation for several options related to CPS export/install that
were not previously documented. Add note to update documentation when
(if) COMPAT_VERSION support is not specific to CPS.
2025-05-27 12:28:05 -04:00
Peter Kokot
4b0bce12c8 CheckLinkerFlag: Update documentation
- Added intro code block showing how to include this module.
- Added a list of variables that can affect the check. The
  CMAKE_REQUIRED_LINK_OPTIONS is skipped as it is currently internally
  overridden by the module's check command.
- Added examples section.
- Described command arguments as a list.
- Added included section describing the `LINKER:` (and `SHELL:`) prefix.
- Added link to the module in target_link_options() docs.
2025-05-20 22:12:16 +02:00
Peter Kokot
f70f972562 CMakeDependentOption: Sync documentation
- Added intro code block with include() showing how to load this module.
- Used "command" instead of "macro".
- Removed duplicate mention of CMakeDependentOption module in the
  option() documentation.
- Synced captions in examples.
2025-05-12 21:10:29 +02:00
Hao Dong
b70ef48b27 install(DIRECTORY): Add EXCLUDE_EMPTY_DIRECTORIES option
EXCLUDE_EMPTY_DIRECTORIES option excludes empty directories under the
directory to install. A directory is considered not empty if and only if
the directory contains at least one file or one symbolic link or one
none-empty sub-directory.

Closes: #19189
2025-05-06 10:59:24 -04:00
Brad King
0fb355143e Help: Reformat install(DIRECTORY) options as a definition list
This makes it easier to find documentation for each option.
Previously they were sprinkled throughout prose.  It also
provides a good place for ``versionadded`` directives.
2025-05-05 15:05:33 -04:00
Brad King
9f4fdf10ff Merge topic 'doc-block'
9eef69bbec Help: block() command: enhance the `PROPAGATE` example

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10722
2025-04-29 11:02:38 -04:00
Marc Chevrier
9eef69bbec Help: block() command: enhance the PROPAGATE example
Fixes: #26902
2025-04-28 17:16:02 +02:00
Vito Gamberini
0138df29dc project: add COMPAT_VERSION keyword
Fixes: #26893
2025-04-25 13:42:11 -04:00
Peter Kokot
7b79c2b39d exec_program: Add example how to upgrade to execute_process()
This hopefully helps a bit when upgrading CMake code that uses
`exec_program()` command.

Changes:
- Used third-person phrasing for the command description.
- The `exec_program()` command arguments in signature updated a bit.
- Mention of CMakeLists.txt file removed as this command also worked in
  CMake scripts and other modes.
- Added examples section.
2025-04-17 01:02:47 +02:00
Alex Turbov
9784834b4c Help: Use *.rst extension for included files
So, editor(s) can correctly highlight the RST syntax in the included files.
2025-04-14 03:07:46 +04:00