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
Brad King
1a35351125
Add CMAKE_POLICY_VERSION_MINIMUM to help configure outdated projects
...
Provide packagers and end users with a way to try configuring projects that
have not been updated to set their policy version to a supported level.
Closes : #26698
2025-02-13 14:00:26 -05:00
Brad King
d723198539
Help: De-duplicate policy version documentation
2025-02-13 12:36:54 -05:00
Brad King
e5d29e9e00
Help: Drop cmake_minimum_required pre-2.4 behavior
...
The long outdated pre-2.4 compatibility behavior is no longer relevant
since CMake 4.0 dropped support for pre-3.5 compatibility.
2025-02-13 12:22:21 -05:00
Nikita Nemkin
5d039f3be3
regex: Match ^ at most once in repeated searches
...
When doing successive matches, track the input start and current search
start positions separately to prevent the `^` anchor from matching in
the middle of the string. Add policy CMP0186 to provide compatibility.
Issue: #26629
Fixes : #16899
2025-02-13 20:00:02 +05:00
Brad King
3f2386db2b
Merge topic 'find-cps-version' into release-4.0
...
3e6466eb16 find_package: Honor version requests when finding CPS packages
7a0e698384 find_package: Fix CPS version parsing
35a7ed125b find_package: Fix reporting of rejected CPS files' version
Acked-by: Kitware Robot <kwrobot@kitware.com >
Acked-by: buildbot <buildbot@kitware.com >
Merge-request: !10297
2025-02-13 09:33:04 -05:00
Matthew Woehlke
3e6466eb16
find_package: Honor version requests when finding CPS packages
...
Teach find_package to check a CPS package's version (when provided)
against a version request given to the find_package invocation.
2025-02-12 11:36:41 -05:00
Brad King
1d274d34b9
Merge topic 'instrumentation-build-snippet' into release-4.0
...
c8e319d08c instrumentation: Add experimental notes to docs
f777af7734 instrumentation: Update docs for available snippets
2299b2fcab instrumentation: Add build snippet
Acked-by: Kitware Robot <kwrobot@kitware.com >
Acked-by: buildbot <buildbot@kitware.com >
Merge-request: !10328
2025-02-12 09:43:17 -05:00
Brad King
33b3fb0876
Merge topic 'help-find-library' into release-4.0
...
4b7ed0ec79 Help: Clarify find_library() behavior for suffixed libraries
Acked-by: Kitware Robot <kwrobot@kitware.com >
Merge-request: !10322
2025-02-12 09:30:30 -05:00
Brad King
ae103956b0
Merge topic 'doc-target_link_libraries' into release-4.0
...
1d07da0912 Help: Clarify context of target_link_libraries pre-4.0 behavior documentation
b7dc28cb8c Help: Drop target_link_libraries redundant prose on debug/optimized keywords
b4bac3018f Help: Drop target_link_libraries mention of CMP0003 and CMP0004
639eee1a0c Help: Call out target_link_libraries legacy signatures earlier
Acked-by: Kitware Robot <kwrobot@kitware.com >
Acked-by: Yegor Yefremov <yegorslists@googlemail.com >
Merge-request: !10326
2025-02-12 09:28:50 -05:00
Brad King
7e5a80c7ff
Merge topic 'execute_process-cmd-bat' into release-4.0
...
b902fbd0c6 execute_process: Clarify when a Windows command interpreter is used
e388ed687a execute_process: Improve invocation of .cmd/.bat with spaces
Acked-by: Kitware Robot <kwrobot@kitware.com >
Acked-by: Nikita Nemkin <nikita@nemkin.ru >
Acked-by: Alexey Edelev <alexey.edelev@qt.io >
Merge-request: !10321
2025-02-12 09:10:03 -05:00
Martin Duffy
c8e319d08c
instrumentation: Add experimental notes to docs
2025-02-11 13:47:56 -05:00
Brad King
1d07da0912
Help: Clarify context of target_link_libraries pre-4.0 behavior documentation
...
Update paragraphs that exist only to document pre-4.0 behavior to
explicitly state so.
Fixes : #26679
2025-02-11 09:30:57 -05:00
Brad King
b7dc28cb8c
Help: Drop target_link_libraries redundant prose on debug/optimized keywords
...
This is already documented in the overview, and does not need to be
repeated for a specific signature.
Issue: #26679
2025-02-11 09:30:55 -05:00
Brad King
b4bac3018f
Help: Drop target_link_libraries mention of CMP0003 and CMP0004
...
These policies have been removed by CMake 4.0 and have not been
practically relevant in many years.
Issue: #26679
2025-02-11 09:24:07 -05:00
Brad King
639eee1a0c
Help: Call out target_link_libraries legacy signatures earlier
2025-02-11 09:23:06 -05:00
Nikita Nemkin
4b7ed0ec79
Help: Clarify find_library() behavior for suffixed libraries
...
The name is used as-is only if it contains a recognized suffix.
Clarify this behavior and add links to the relevant variables.
Fixes : #18401
2025-02-11 08:50:59 -05:00