Commit Graph

1701 Commits

Author SHA1 Message Date
xndcn
41488e0c41 Help: Fix cmake_path examples 2025-07-02 09:54:18 -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
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
Brad King
75da788360 Merge topic 'find-package-required'
857a039d66 find_*: Add variable to default calls to REQUIRED

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10364
2025-02-28 11:15:23 -05:00
Martin Duffy
857a039d66 find_*: Add variable to default calls to REQUIRED
This adds a `CMAKE_FIND_REQUIRED` variable which causes `find_package`,
`find_path`, `find_file`, `find_library` and `find_program` to be
considered `REQUIRED` by default.

It also introduces an `OPTIONAL` keyword to those commands, allowing
them to ignore the value of this variable.

Issue: #26576
2025-02-27 10:51:07 -05:00
Matthew Woehlke
c8ccd5a9e3 export: Add build-tree CPS support
Add Common Package Specification support to export(EXPORT).
2025-02-25 15:42:23 -05:00
Brad King
7f172faca5 Help: Add install() section heading for common options 2025-02-25 13:26:32 -05:00
Martin Duffy
609c949061 add_dependencies: Allow calling with no dependencies
Fixes: #26713
2025-02-24 13:56:31 -05:00
Brad King
4701678fa1 Merge topic 'doc-add_dependencies'
77a742b088 Help: add_dependencies requires at least two arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10370
2025-02-21 09:06:48 -05:00
Brad King
77a742b088 Help: add_dependencies requires at least two arguments
Update the documentation to match the implementation.
2025-02-20 08:25:58 -05:00
Brad King
00ee82c190 Merge topic 'policy_max-docs'
48095c623f Help/cmake_minimum_required: clarify policy_max `versionadded` note

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10363
2025-02-18 09:43:24 -05:00
Ben Boeckel
48095c623f Help/cmake_minimum_required: clarify policy_max versionadded note
While the prose clarifies this below, a quick glance at the docs can
make one believe that `...3.10` has no sensible use. However, it is
still useful to tell CMake 3.12 and up that at least 3.10 behavior is
accepted.
2025-02-18 06:20:32 +01:00
Nikita Nemkin
8d455809b0 string: Allow zero-length matches in all REGEX subcommands
The semantics mimic other languages like Python, Java, JS, etc.
To advance past a zero-length match, the search algorithm first
tries to find a non-zero alternative branch. If that fails, it
force-advances by 1 character.

Fixes: #13790, #13792, #18690, #26629
2025-02-15 01:01:49 +05:00
Nikita Nemkin
ca65fa9a7f string: Allow references to unmatched groups in REGEX REPLACE
References to unmatched groups will be replaced with empty strings.

Issue: #26629
Fixes: #19012
2025-02-15 01:00:58 +05:00
Brad King
8845d33292 Merge topic 'regex'
5d039f3be3 regex: Match ^ at most once in repeated searches

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10221
2025-02-14 09:38:04 -05:00