1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-19 02:17:27 +08:00
Commit Graph

1713 Commits

Author SHA1 Message Date
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
Peter Kokot
67055f5b3a CMakeDependentOption: Update documentation
This updates the module documentation to be more synced with other
modules. Also, this module on the first glance doesn't do what most
people might think. Because when condition evaluates to false, internal
cache remains with the same value, and a local variable is created with
the value provided in the last argument.

- Command arguments described separately and their placeholders renamed
  to more intuitive names.
- More examples added, starting with a very basic syntax usage to more
  complex ones, each described in more details.
- Each example has include() added to be more clear that this is a
  module command.
2025-03-31 02:42:49 +02:00
Brad King
f37d0f33b2 Merge topic 'patch-CTEST_CVS_CHECKOUT'
77d23eaa8f CTEST_CVS_CHECKOUT: Add deprecated directive to docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10512
2025-03-25 10:36:29 -04:00
Peter Kokot
77d23eaa8f CTEST_CVS_CHECKOUT: Add deprecated directive to docs
This variable got introduced in CMake 2.4 and was documented as
deprecated in CMake 3.1.
2025-03-24 01:06:29 +01:00
Peter Kokot
acba9cb083 execute_process: Document {OUTPUT,ERROR}_STRIP_TRAILING_WHITESPACE 2025-03-21 03:02:10 +01:00
Brad King
ff197bc744 Merge topic 'patch-debug-configurations'
99546ef425 Help: Improve DEBUG_CONFIGURATIONS documentation and usage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10477
2025-03-18 09:42:51 -04:00
Peter Kokot
99546ef425 Help: Improve DEBUG_CONFIGURATIONS documentation and usage
This adds a short example demonstrating how to set this property.
Additionally, a paragraph is added to the target_link_libraries() and
its debug/optimized keywords to mention that imported targets with
IMPORTED_CONFIGURATIONS property may provide better alternative for
linking.
2025-03-15 15:47:51 +01:00
Vito Gamberini
f59bab006d PkgC: Add NAME and PREFIX
Fixes: #26067
2025-03-14 15:17:27 -04:00
Brad King
b7abc78e6c Merge topic 'pkg-config-import-populate'
28a92bde80 PkgC: Implement cmake_pkg_config IMPORT / POPULATE
7f172faca5 Help: Add install() section heading for common options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10393
2025-03-12 09:06:04 -04:00
Vito Gamberini
28a92bde80 PkgC: Implement cmake_pkg_config IMPORT / POPULATE
Issue: #26067
2025-03-11 11:24:07 -04:00
Brad King
f65fcde174 Merge topic 'document-cps-components-resolution'
dd8bf95271 Help: Document handling of CPS transitive components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10434
2025-03-10 10:19:04 -04:00
Matthew Woehlke
dd8bf95271 Help: Document handling of CPS transitive components
Add documentation explaining how CMake handles component requests of a
CPS transitive dependency.
2025-03-07 13:19:43 -05:00
Brad King
f8b284cb3e Merge topic 'fix-cps-component-documentation'
b8d4c58e6c Merge branch 'backport-fix-cps-component-documentation' into fix-cps-component-documentation
76e11bd4ea Help: Fix find_package documentation about CPS and COMPONENTS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10405
2025-03-04 08:45:07 -05:00
Matthew Woehlke
b8d4c58e6c Merge branch 'backport-fix-cps-component-documentation' into fix-cps-component-documentation
* backport-fix-cps-component-documentation:
  Help: Fix find_package documentation about CPS and COMPONENTS
2025-03-03 11:49:46 -05:00
Peter Kokot
d9de3fe322 cmake_host_system_information: Extend fallback script example
This fixes some typos and extends example how to use the
CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS list variable.
2025-02-28 23:22:24 +01:00
Matthew Woehlke
76e11bd4ea Help: Fix find_package documentation about CPS and COMPONENTS
The recent addition of component handling for CPS neglected to update
the documentation of how find_package handles component requests when
importing from CPS. Make those changes now.
2025-02-28 17:00:00 -05:00