Commit Graph

1641 Commits

Author SHA1 Message Date
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
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
Brad King
b2674f3b38 Merge topic 'instrumentation-doc-fixes' into release-4.0
32e9d27c88 instrumentation: Remove undocumented binaryDir field from snippets
d88458b5ea instrumentation: Improve documentation for CMake Instrumentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10320
2025-02-11 07:46:46 -05:00
Brad King
b902fbd0c6 execute_process: Clarify when a Windows command interpreter is used
We've always executed `.bat` and `.cmd` files through `cmd /c`, but
previously it was implicit in undocumented `CreateProcessW` behavior.
2025-02-11 07:26:56 -05:00
Brad King
e388ed687a execute_process: Improve invocation of .cmd/.bat with spaces
Extend the fix from commit 74c9d40876 (execute_process: Fix invocation
of .cmd/.bat with spaces, 2025-01-31) to work without relying on
conversion to a "short path", which may not exist.  Instead, extending
the `cmd /c` wrapper to `cmd /c call` seems to support spaces directly.

Suggested-by: Alexandru Croitor <alexandru.croitor@qt.io>
Fixes: #26655
2025-02-10 19:44:19 -05:00
Brad King
120e26b828 Merge topic 'doc-execute_process-CMP0176-version' into release-4.0
5a2c0407b8 Help: Clarify when execute_process ENCODING UTF-8 became the default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10316
2025-02-10 19:02:40 -05:00
Martin Duffy
d88458b5ea instrumentation: Improve documentation for CMake Instrumentation 2025-02-10 16:57:45 -05:00
AJIOB
5a2c0407b8 Help: Clarify when execute_process ENCODING UTF-8 became the default
In commit e782811cfe (execute_process: Change default ENCODING to UTF-8,
2024-09-13, v3.31.0-rc1~94^2) we implied this by the version ranges in
the older defaults.  State it explicitly.
2025-02-10 16:18:16 -05:00
Brad King
7065e7a555 Merge topic 'instrumentation-build-hooks'
2680f30caf instrumentation: Allow multiple CALLBACK arguments
fc1d55f6a5 instrumentation: Add preBuild and postBuild hooks for ninja
f62a4ab2ee instrumentation: Refactor cmInstrumentation constructor and usage
c57d1752d4 cmUVProcessChain: Add Detached option for spawning daemons

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10230
2025-02-05 09:08:33 -05:00
Martin Duffy
2680f30caf instrumentation: Allow multiple CALLBACK arguments
Don't require quotes around CALLBACK argument and allow it to be passed
multiple times.
2025-02-04 11:15:20 -05:00
Brad King
8dfb1f40b7 Merge topic 'execute_process-cmd-bat'
74c9d40876 execute_process: Fix invocation of .cmd/.bat with spaces
104ca10208 cmWorkerPool: Adopt MaybePrependCmdExe calls to reduce duplication
cf7ba6d43d cmWorkerPool: Convert RunCommand signature to move semantics
c091fd1420 cmUVProcessChain: Convert AddCommand signature to move semantics
c1f6b04176 cmSystemTools: Teach MaybePrependCmdExe to always use backslashes
817b3967f8 cmSystemTools: Teach MaybePrependCmdExe to return GetShortPathNameW failure
611a3000f7 cmSystemTools: Make MaybePrependCmdExe case-insensitive
98fed0f116 cmSystemTools: Adopt MaybePrependCmdExe

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10270
2025-02-04 09:02:48 -05:00
Brad King
0c5898558e Merge topic 'find-cps-components'
894f256a12 find_package: Find CPS components
ac20cd43c0 find_package: Fix reporting of transitive dependency errors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10262
2025-02-03 10:07:25 -05:00
Brad King
74c9d40876 execute_process: Fix invocation of .cmd/.bat with spaces
The `CreateProcessW` documentation states "to run a batch file, you must
start the command interpreter".  Use `cmd /c the.bat` to run batch files.
Also, use a "short path" to the `.bat` file if needed to avoid spaces.

Previously this worked in some cases only due to undocumented behavior
of `CreateProcessW` when given a `.bat` file.

Fixes: #26655
2025-02-03 09:13:26 -05:00
Matthew Woehlke
894f256a12 find_package: Find CPS components
Implement finding components of CPS packages. Specifically, reject any
candidate packages that don't provide all required components, and
ignore appendices that don't provide requested (required or optional)
components. This applies to both top-level searches and also searching
for package dependencies.
2025-02-01 06:44:43 -05:00
Nikita Nemkin
9c963de998 Help: Remove stray spaces and one colon 2025-01-31 12:23:29 -05:00
Nikita Nemkin
51e4d81f16 Help: Remove accidental blockquotes around lists
Indenting a list relative to the previous paragraph creates
a blockquote. Combined with the natural list indent it results
in an overly large left margin.
2025-01-31 12:23:29 -05:00
Nikita Nemkin
718043b540 Help: Convert some literal blocks into tables and lists
Also, ensure that header-less tables have a top border in cmake.css.
2025-01-31 12:23:29 -05:00
Brad King
3e64c6a56e Merge topic 'msvc-runtime-checks'
2b2344b412 MSVC: Add abstraction for runtime checks
49dcd1ce5d Help: Fix MSVC_DEBUG_INFORMATION_FORMAT description of example
2f8e643d9d CMP0141: Fix documentation copied from CMP0091

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !10214
2025-01-30 08:48:01 -05:00
Nikita Nemkin
9890cfc4ec Help: More syntax highlighting for literal blocks
Covers almost all blocks containing actual code, except:

* Parsed-literal blocks can't be highlighted, including many command
  summaries and substitution-heavy docs like find_... commands.
  This is a Sphinx limitation.

* Code with errors, like CMP0049, DEPLOYMENT_ADDITIONAL_FILES,
  DEPLOYMENT_REMOTE_DIRECTORY, @PACKAGE_INIT@ substitution in the
  tutorial, bracket arguments/comments in cmake-language.7 and
  cmake-developer.7.

* FindQt4 module, which needs reformatting.
2025-01-29 16:48:53 -05:00
AJIOB
2b2344b412 MSVC: Add abstraction for runtime checks
Replace our hard-coded default for `/RTC1` with a first-class
abstraction to select runtime checks from an enumeration of logical
names.  Add a `MSVC_RUNTIME_CHECKS` target property and corresponding
`CMAKE_MSVC_RUNTIME_CHECKS` variable.

Removing the old default flag requires a policy because existing
projects may rely on string processing to edit them and choose
runtime checks under the old behavior.  Add policy CMP0184 to
provide compatibility.

Fixes: #26614
2025-01-29 13:07:41 -05:00
Brad King
ec7cc80370 Merge topic 'patch-lower-case-style'
4e6a13f211 Use lower case style for commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !10245
2025-01-29 11:37:51 -05:00
Brad King
e509c0a423 Merge topic 'patch-else'
9f2efc3270 Remove optional arguments from else() and end*() commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !10243
2025-01-29 11:35:30 -05:00
Peter Kokot
4e6a13f211 Use lower case style for commands
Where possible this syncs the CS for command names:

- check_c_source_compiles()
- check_cxx_compiler_flag()
- check_cxx_source_compiles()
- check_cxx_symbol_exists()
- check_include_file_cxx()
- check_include_file()
- check_include_files()
- check_library_exists()
- check_source_compiles()
- check_struct_has_member()
- check_symbol_exists()
- check_type_size()
- cmake_dependent_option()
- cmake_parse_arguments()
- feature_summary()
- file()
- find_package_handle_standard_args()
- if(), endif...
- install(FILES)
- list()
- message()
- pkg_check_modules()
- select_library_configurations()
- set_package_info()
- test_big_endian()
2025-01-28 13:51:46 -05:00
Peter Kokot
477737b7bf
load_cache: Add note about export()
The export() command can be a better option when outside project can be
adjusted in such way.
2025-01-28 15:22:29 +01:00
Brad King
aeff709a27 Merge topic 'patch-load-cache-script-mode'
18ae68a97c load_cache: Mention script mode support (-P)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10241
2025-01-28 09:19:58 -05:00
Brad King
d6a7a83700 Merge topic 'fix-typos-found-by-pygrep-hooks'
bc4c71627a Help: Fix typos found by the `rst-backticks` hook
c833629508 Help: Fix typos found by the `rst-directive-colons` hook

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10237
2025-01-28 08:35:19 -05:00
Peter Kokot
9f2efc3270
Remove optional arguments from else() and end*() commands
This adds a brief explanation of the optional condition in the `else()`
and removes all legacy usages of `else()` and `end*()` commands.
2025-01-28 03:01:23 +01:00
Peter Kokot
18ae68a97c
load_cache: Mention script mode support (-P)
When using the relevant load_cache(READ_WITH_PREFIX) signature, it also
works in script mode (cmake -P ...), unlike the 2nd obsolete signature.
2025-01-28 00:59:50 +01:00
Brad King
3ffac3063d Merge topic 'doc-policy-deprecation-schedule'
3e0720a2ae Help: Add cmake_minimum_required(VERSION) example to cmake-policies(7)
085de39879 Help: Document policy transition schedule in cmake-policies(7)
60e302a539 Help: Drop policy scope from cmake-policies(7)
3b926b32e3 Help: Drop CMAKE_MINIMUM_REQUIRED_VERSION from cmake-policies(7)
ec9e5feb93 Help: Organize cmake-policies(7) by supported and unsupported policies
6be0fe22be Help: Mention CMAKE_POLICY_DEFAULT_CMP<NNNN> in cmake_minimum_required

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10222
2025-01-27 11:18:46 -05:00
Brad King
084f6055a8 Merge topic 'patch-CMAKE_OBJDUMP'
dc7aabf4d0 Help: Document CMAKE_OBJDUMP variable
4bd3519e89 CPack: Avoid mentioning internal CMake module in documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10224
2025-01-27 10:30:58 -05:00
Brad King
304f086b71 Merge topic 'doc-cmake_host_system_information-OS_NAME'
ff11a95962 Help: Clarify cmake_host_system_information OS_NAME

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nicole Mazzuca <nicole.mazzuca@remarkable.no>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !10232
2025-01-27 10:26:33 -05:00
Alex Turbov
bc4c71627a
Help: Fix typos found by the rst-backticks hook
The corresponding `pre-commit` configuration is coming in the
separate MR.

Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2025-01-27 01:43:26 +04:00
scivision
7be01178a0 Help: JSON argument should be quoted
The error that results from a semicolon anywhere in a JSON string
is not obvious.

Issue: #26628
2025-01-24 12:00:56 -05:00
Brad King
ff11a95962 Help: Clarify cmake_host_system_information OS_NAME
Fixes: #26631
2025-01-24 10:58:35 -05:00
Peter Kokot
dc7aabf4d0 Help: Document CMAKE_OBJDUMP variable 2025-01-24 10:43:18 -05:00
Brad King
5f6114f8b8 Merge topic 'patch-load-cache'
6fc8d20250 load_cache: Improve explanation of command signatures

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10216
2025-01-24 10:20:13 -05:00
Brad King
6be0fe22be Help: Mention CMAKE_POLICY_DEFAULT_CMP<NNNN> in cmake_minimum_required
We already mention it in equivalent text for `cmake_policy`.
2025-01-23 09:41:08 -05:00
Brad King
1d4d4362d9 Merge topic 'remove-old-compatibility'
77f71ad4e2 Remove compatibility with CMake versions older than 3.5
fb1bd1d330 CMP0065: Remove support for OLD behavior
d9dd38cccf CMP0064: Remove support for OLD behavior
d88047c329 Remove compatibility with CMake versions older than 3.3
ac1a9cb160 CMP0063: Remove support for OLD behavior
36fffb673a CMP0062: Remove support for OLD behavior
789a7d73d4 CMP0061: Remove support for OLD behavior
3dc19e24cb CMP0060: Remove support for OLD behavior
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10210
2025-01-23 09:36:59 -05:00
Brad King
63924c4afa Merge topic 'ci-typos'
c3777c1536 ci: Extend spellcheck job with 'typos' tool
d11552c2d9 codespell: Exclude paths by patterns following pre-commit check conventions
11d0a631d4 codespell: Split multi-valued configuration across multiple lines
54dfadaf5a ci: Rename "codespell" job to more general name "spellcheck"
17fc94e5e3 ci: Add typos 1.29.4 to Fedora base image
ddf8220572 ci: Use Fedora 41 default flang package now that it is new enough
1e2d19ea4f gitignore: Tell tools honoring .gitignore to ignore .git too
0d0a94bcfb Tests: Fix Fortran syntax for initialized variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10211
2025-01-23 09:34:02 -05:00
Peter Kokot
6fc8d20250
load_cache: Improve explanation of command signatures
This extends the descriptions of command signatures and options.
Additional examples are listed at the bottom for better understanding
and overview of this command.
2025-01-22 23:40:39 +01:00
Brad King
77f71ad4e2 Remove compatibility with CMake versions older than 3.5
This compatibility has been deprecated since commit 3a4791548d
(Deprecate compatibility with CMake versions older than 3.5, 2023-02-09,
v3.27.0-rc1~508^2).  The behavior itself has been deprecated
since CMake 3.5.

Issue: #26613
2025-01-22 10:40:55 -05:00
Brad King
fb1bd1d330 CMP0065: Remove support for OLD behavior 2025-01-22 10:40:55 -05:00
Brad King
d88047c329 Remove compatibility with CMake versions older than 3.3
This compatibility has been deprecated since commit 3a4791548d
(Deprecate compatibility with CMake versions older than 3.5, 2023-02-09,
v3.27.0-rc1~508^2).  The behavior itself has been deprecated
since CMake 3.3.

Issue: #26613
2025-01-22 10:40:54 -05:00
Brad King
789a7d73d4 CMP0061: Remove support for OLD behavior 2025-01-22 10:40:54 -05:00
Brad King
3dc19e24cb CMP0060: Remove support for OLD behavior 2025-01-22 10:40:54 -05:00
Alex Turbov
c3777c1536 ci: Extend spellcheck job with 'typos' tool
Unlike the `codespell`, `typos` is capable of finding typos
in combined identifiers (`CamelCase` or `snake_case`).
2025-01-22 08:51:45 -05:00