Commit Graph

209 Commits

Author SHA1 Message Date
Peter Kokot
d5793a6e57
cmake.m4: Update Autoconf macros documentation
This updates the documentation for the CMAKE_FIND_BINARY and
CMAKE_FIND_PACKAGE Autoconf macros to imitate other Autoconf macros
internal documentation style with some stylistic adjustments for
readability of the arguments.

- CMAKE_FIND_PACKAGE: Links to docs are added instead of listing
  compiler IDs. The 5th ($5) and 6th ($6) arguments descriptions are
  updated to be action-if-found and action-if-not-found according to the
  current code.
2025-03-23 16:09:02 +01:00
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -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
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
Daniel Tierney
abbe41578d cmake: Add SARIF diagnostics output support
Closes: #26587
2025-01-29 08:43:19 -05:00
Brad King
72e27a4856 Merge topic 'fix-typos-found-by-pre-commit-hooks'
d620d77d26 FindDoxygen: Rename `_Doxygen_dne_header` -> `_Doxygen_do_not_edit_header`
e7ff3cccea PushToAndroidDevice.cmake: Rename `cmake_parse_arguments` prefix
bc8621d999 Fix: A lot of typos in code found by `typos`
b33beb7af5 Help: Fix some typos found by `sphinx-lint`
78e45c2db6 Style: Replace TABs with spaces for indentation in some files
74e0173f66 Tests(NuGet): Fix the test to ignore empty and space-only lines

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10151
2025-01-14 09:44:34 -05:00
Brad King
74c462b4f8 Merge topic 'xcode-scheme-test-config'
7d28005244 Xcode: Support for test action 'Build Configuration' scheme property
1f4e1ccbc8 Help: Move launch config scheme property to the correct section
8aaae0f643 vim: Remove duplicated keywords from cmake.vim

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10154
2025-01-13 11:37:31 -05:00
Alex Turbov
bc8621d999
Fix: A lot of typos in code found by typos
Yet another great code spellchecker: https://github.com/crate-ci/typos/

(Will be added later as a `pre-commit` hook)
2025-01-12 18:49:34 +04:00
Alex Turbov
78e45c2db6
Style: Replace TABs with spaces for indentation in some files
Mark files that must use TABs to indent in the `.gitattributes`.
Use space instead of TABs in sources and some data/test files.
2025-01-12 18:49:25 +04:00
Alex Turbov
b65930a7a7 Fortran: Add Fortran_BUILDING_INTRINSIC_MODULES for building intrinsics
In commit fe3f846e1b (Makefiles: Add support for building Fortran
intrinsics, 2020-11-19, v3.22.0-rc1~565^2) the property was added with
incorrect spelling `Fortran_BUILDING_INSTRINSIC_MODULES`.  Add a new
property with the correct spelling.  Keep the old one for compatibility.

Issue: #21463
2025-01-09 15:30:00 -05:00
Cristiano Carvalheiro
7d28005244 Xcode: Support for test action 'Build Configuration' scheme property
Also allow scoped property checking on Xcode scheme tests to
 be able to distinguish between launch and test actions build config.
2025-01-09 16:36:33 +00:00
Cristiano Carvalheiro
8aaae0f643 vim: Remove duplicated keywords from cmake.vim 2025-01-09 14:43:06 +00:00
Cristiano Carvalheiro
419cfe30d0 Xcode: Support for 'LLDB Init File' scheme property
Fixes: #24002
2024-12-13 08:31:11 -05:00
Cristiano Carvalheiro
65ad1bbd4c vim: Remove duplicated keywords from cmake.vim 2024-12-13 08:31:11 -05:00
Garrett Campbell
9ed178f9d8 Add generator-agnostic DEBUGGER_WORKING_DIRECTORY target property
Generalize the `VS_DEBUGGER_WORKING_DIRECTORY` property.

Issue: #16478
2024-12-09 10:47:10 -05:00
Alex Turbov
3ae031992a
bash-completion: Complete a workflow name after the --workflow option
Update bash completion for commit b80aa1d3a3 (preset: Easier command
line interface for Workflow Presets, 2024-09-30, v3.31.0-rc1~17^2).

Issue: #26270
2024-10-27 21:08:12 +04:00
Pierre Rouleau
8eb8e27fb2 cmake-mode.el: Use line-beginning-position instead of obsolete point-at-bol
That fixes Emacs 29 warning:

    cmake-mode.el:186:48: Warning: ‘point-at-bol’ is an obsolete function
      (as of 29.1); use ‘line-beginning-position’ or ‘pos-bol’ instead.
2024-08-13 15:50:51 -04:00
Brad King
b0ba99f152 Merge topic 'doc-add_test-typo'
ca39258a66 Help: Fix typo in add_test documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9687
2024-07-29 10:59:00 -04:00
Brad King
ca39258a66 Help: Fix typo in add_test documentation 2024-07-26 10:37:35 -04:00
Alex Turbov
549fb86168 bash-completion: Handle cmake --workflow
Issue: #21000
Issue: #26100
2024-07-02 09:29:33 -04:00
Calum Robinson
0721f9bf0f VS: Add VS_FRAMEWORK_REFERENCES
Fixes: #26082
2024-06-26 16:44:51 +01:00
eutro
3ecf6bd1b1 cmake-mode.el: fix bracket string/comment syntax-propertize
With `lexical-binding: t`, the `end` variable is undefined in
`cmake--syntax-propertize-until-bracket-close`, causing syntax
highlighting errors. This fixes that by passing `end` from the caller.
2024-06-24 09:51:05 -04:00
Craig Scott
3889640e8b
Auxiliary: Modernize bash completion for ctest and cpack
This applies a similar modernization as was done in 1ff41ba26e
(Auxiliary: bash-completion: use _comp_initialize, 2024-06-02)
for the cmake executable. The _init_completion function was
deprecated upstream in bash-completion 2.12.
2024-06-07 18:48:46 +10:00
Ahmad Samir
1ff41ba26e Auxiliary: bash-completion: use _comp_initialize
_init_completion has been deprecated upstream since 2.12.

https://github.com/scop/bash-completion/blob/main/bash_completion.d/000_bash_completion_compat.bash#L237
2024-06-02 20:07:23 +03:00
Ahmad Samir
d03b4acaa9 Auxiliary: Bash-comp: use _init_completion instead of _split_longopt
Using `_init_completion -s` will handle the option splitting and set the
`split` var [1].

Keep setting `split` manually for the older manual bash completion
initialization.

[1] https://github.com/scop/bash-completion/blob/main/bash_completion.d/000_bash_completion_compat.bash#L227
2024-06-02 18:25:00 +03:00
halx99
56a96d1f1f VS: Add option to import .props in .vcxproj.filters files
Adds new target property VS_FILTER_PROPS

Fixes: #25948
2024-05-02 00:30:00 +08:00
Konstantin Kharlamov
f0bfcc125d cmake-mode.el: fix "docstring wider than 80 characters" warning
Fixes:
    In cmake-help:
    cmake-mode.el:492:2: Warning: docstring wider than 80 characters
2024-04-11 18:24:18 +03:00
Konstantin Kharlamov
c1e5c9f162 cmake-mode.el: fix "no lexical-binding directive" warning
Fixes:
    In toplevel form:
    cmake-mode.el:1:1: Warning: file has no ‘lexical-binding’ directive on its first line
2024-04-11 18:23:48 +03:00
Joerg Bornemann
91336c7469 cmake-mode.el: Simplify jumping to begin/end of functions/macros
This change was spawned by the desire to use `narrow-to-defun` in CMake
files. However, there was no "CMake version" of that function, and it
turns out that we don't need one if we make `beginning-of-defun` and
`end-of-defun` work in `cmake-mode`.

In the setup code of `cmake-mode` we now set the local variables
`beginning-of-defun-function` and `end-of-defun-function`. This makes
`beginning-of-defun` and `end-of-defun` work as expected.

Functions that use this facility also work now: `mark-defun` and
`narrow-to-defun` and possibly others.

We remove `cmake-mark-defun` since it's superfluous now.

We remove the defun-related key bindings since the standard functions
that are bound globally work fine with this patch.
2024-01-25 11:51:17 -05:00
Orkun Tokdemir
7c39dabdbc Autogen: AUTO*_EXECUTABLE: add support for per-config values
* Per-config values were added to `AUTO*_EXECUTABLE`.
* Dependency order was refactored for `cmake_autogen` and `cmake_autorcc` to avoid unnecessary rebuilds.
* A new parameter was added for `cmake_autogen` and `cmake_autorcc` to specify the config name of the `auto*_executable` to be used.
* Add `AUTOGEN_BETTER_GRAPH_MULTI_CONFIG` target property to change the behavior of the dependency graph.
* The timestamp target is split into three targets for per-config to avoid redundant `mocs_compilation` builds when `AUTOGEN_BETTER_GRAPH_MULTI_CONFIG`	 is ON
* Per-config `DEP_FILE_RULE_NAME` values were added to `AutogenInfo.json` for `Multi-Config` usage.
* Some functions were refactored to avoid code duplication.

This commit reimplements fddd0f0443

Fixes: #20074
2024-01-17 16:02:58 +01:00
Craig Scott
d0ab70d57d
Help: Fix typo in dependency provider method keyword
The cmake.vim file is generated by scanning for keyword-like
strings in the docs. Update the corresponding wrong entry
there too directly for now, which will fix the wrong entry until
the next full regeneration of the file.

Fixes: #25503
2023-12-16 10:27:39 +11:00
Brad King
46c9feaec7 Merge topic 'vim-syntax'
56fb01a176 vim: Fix syntax highlighting for bracket arguments and comments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9061
2023-12-12 08:40:56 -05:00
namniav
56fb01a176 vim: Fix syntax highlighting for bracket arguments and comments
Fix VIM syntax highlighting for `cmakeBracketArgument`, `cmakeComment`
and `cmakeBracketComment`.

Fixes: #25488
2023-12-11 10:10:44 -05:00
Eisuke Kawashima
27bfbbc2c0 vim: add undo_indent to match upstream vim indentation scripts
This resets `inde` (`indentexpr`) and `indk` (`indentkeys`) to the
global values when closing.  Upstream `vim` updated their indentation
scripts in April 2022 to add this.
2023-12-11 10:07:33 -05:00
Brad King
1f7a653e90 Merge topic 'swift-compilation-mode'
0f80101b73 Tests: Update Swift tests to use CMP0157 NEW behavior
c1d787e473 Swift: Add abstraction for compilation mode
c39384f540 Tests: Simplify RunCMake.Swift conditions to enable use of Swift

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8918
2023-11-19 11:47:37 -05:00
Evan Wilde
c1d787e473 Swift: Add abstraction for compilation mode
Add a `CMAKE_Swift_COMPILATION_MODE` variable and corresponding
`Swift_COMPILATION_MODE` target property to control the compilation
mode.  Select among `wholemodule`, `singlefile`, and `incremental`.

Add policy CMP0157 to remove the default `-wmo` flags in favor of the
abstract setting.

Issue: #25366
2023-11-17 08:43:21 -05:00
tophoo
7a07887055 Autogen: Add support for response files for moc predef targets
Add support for response files for moc predef targets and make the limit when
to use response files for autogen targets configurable.
2023-11-16 16:29:02 +01:00
William Sciaroni
5e0c1777a3 Optionally make test target depend on all
Fixes: #8774
2023-11-10 13:19:11 -05:00
Ben Boeckel
0c07f39006 cmExperimental: remove the flag for C++ modules
All the major compilers now have scheduled releases with support for
scanning, so remove the experimental gate.

Fixes: #18355
2023-10-02 10:17:31 -04:00
Patrick Boettcher
664b0e2fc3 Merge branch 'upstream-vim-cmake-syntax'
* upstream-vim-cmake-syntax:
  vim-cmake-syntax 2023-07-13 (7c6f28d0)
2023-07-13 15:14:56 +02:00
Cordell Bloor
90a949f7ce HIP: Add HIP language to Vim syntax highlighting
The HIP language shares most properties in common with CXX or CUDA,
although there are a few from each that it doesn't share.
2023-07-07 10:29:39 -04:00
Craig Scott
652a785311
Help: Wording, formatting and ordering fixes for SKIP_LINTING docs
Amends b480315e0c (TargetGenerator: Add SKIP_LINTING source property,
2023-05-12).
2023-05-19 12:29:06 +10:00
Orkun Tokdemir
b480315e0c TargetGenerator: Add SKIP_LINTING source property
The `SKIP_LINTING` source property was added to disable code check for
desired source files. The `SKIP_LINTING`includes `cpplint`, `clang-tidy`, \
`cppcheck` and `include-what-you-use`. If `SKIP_LINTING` is set on a
source file, the tools mentioned above will not be run on that source file.
2023-05-16 10:47:56 -04:00
Brad King
28dd02c3ba Merge topic 'autogen-system-include'
7bf4e30090 Autogen: Default AUTOGEN_USE_SYSTEM_INCLUDE to ON if it is not set
033dc7ee2f Autogen: Add AUTOGEN_USE_SYSTEM_INCLUDE target property
8ba16db163 Tests/RunCMake: Add option for dynamic expected output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8400
2023-05-04 09:01:08 -04:00
Orkun Tokdemir
033dc7ee2f Autogen: Add AUTOGEN_USE_SYSTEM_INCLUDE target property
`AUTOGEN_USE_SYSTEM_INCLUDE` was added. `AUTOGEN_USE_SYSTEM_INCLUDE`
is a boolean property that can be set on a target to indicate that the
autogen target include directory should be added as a system include
directory or normal include directory to the target.
2023-05-03 09:03:46 -04:00
Joris Clement
f4d2772049 vim: Add missing RELATIVE keyword for FILE command 2023-04-27 15:40:26 -04:00
Damien Nguyen
0722569cf3
Properly handle cases where topic argument is defaulted 2023-04-21 14:34:51 +02:00
Craig Scott
e245b4df75 Merge topic 'automoc-macro-names'
c5c3aff1f5 Autogen: Add INTERFACE_AUTOMOC_MACRO_NAMES target property
69cf9700e6 Autogen: Defer setup until Generate step
7cecb6353e cmGeneratorTarget: Factor out EvaluatedTargetProperty infrastructure
2daba01ddf cmGeneratorTarget: Avoid incidental include-what-you-use warning
850b4d990c IWYU: Add mapping for 'std::remove_reference<Defer &>::type'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8391
2023-04-10 18:06:06 -04:00
Orkun Tokdemir
c5c3aff1f5
Autogen: Add INTERFACE_AUTOMOC_MACRO_NAMES target property
Add this target property to specify macro names that propagate to
dependents as `AUTOMOC_MACRO_NAMES`.  The dependents will automatically
generate MOC files for source files that contain the inherited macro
names.

Co-Authored-By: Craig Scott <craig.scott@crascit.com>
Fixes: #19679
2023-04-09 20:51:15 +10:00
Zhengyi Fu
915ef090c9 cmake-mode.el: escape shell arguments
Shell arguments containing "<" or ">" should be escaped.  Otherwise,
names such as CMAKE_<LANG>_FLAGS will be treated as IO redirection.
2023-04-01 07:57:46 +08:00