Commit Graph

337 Commits

Author SHA1 Message Date
Evan Wilde
321c647640 Include source file without an extension after the same name with an extension
CMP0115 requires that source files listed in CMake must include their
file extension, but there are cases when projects have different source
files with the same name, but one with an extension and one without.
In the current state, CMake will ignore the file without the extension
an always map it to the file with an extension.

```cmake
add_library(foo bar.c bar)
```

In the above example, the target `foo` will only recognize and depend on
`bar.c` and miss the file `bar` unless `bar` comes before `bar.c` in the
source list.
This issue also affects how custom commands emit files.

This change adds a new policy to recognize files with and without a file
extension as different files, both when building targets, and when they
are being created.

Fixes: #26058
2025-02-14 10:01:10 -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
2d86cf314f FindRuby: Drop upper-case RUBY_ results in favor of Ruby_ variables
Add policy CMP0185 for compatibility.

Fixes: #26640
2025-02-01 07:12:30 -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
Kitware Robot
0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
Brad King
fb1bd1d330 CMP0065: Remove support for OLD behavior 2025-01-22 10:40:55 -05:00
Brad King
d9dd38cccf CMP0064: Remove support for OLD behavior 2025-01-22 10:40:55 -05:00
Brad King
ac1a9cb160 CMP0063: Remove support for OLD behavior 2025-01-22 10:40:54 -05:00
Brad King
36fffb673a CMP0062: Remove support for OLD behavior 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
Brad King
1393fbf13f CMP0059: Remove support for OLD behavior 2025-01-22 10:40:54 -05:00
Brad King
8f9f01b24d CMP0058: Remove support for OLD behavior 2025-01-22 10:40:53 -05:00
Brad King
c283aafe62 CMP0057: Remove support for OLD behavior 2025-01-22 10:40:53 -05:00
Brad King
cbe7fc4b81 CMP0056: Remove support for OLD behavior 2025-01-21 09:44:05 -05:00
Brad King
cfcb36ca34 CMP0055: Remove support for OLD behavior 2025-01-21 09:44:05 -05:00
Brad King
90d814f024 CMP0054: Remove support for OLD behavior 2025-01-20 09:46:55 -05:00
Brad King
1150fae89a CMP0053: Remove support for OLD behavior 2025-01-20 09:46:55 -05:00
Brad King
f0b1ca4d70 CMP0052: Remove support for OLD behavior 2025-01-20 09:46:54 -05:00
Brad King
e4fddc8e37 CMP0051: Remove support for OLD behavior 2025-01-20 09:46:54 -05:00
Brad King
6973f8304e CMP0050: Remove support for OLD behavior 2025-01-19 09:41:03 -05:00
Brad King
9f6011e307 CMP0049: Remove support for OLD behavior 2025-01-19 09:41:03 -05:00
Brad King
292048874f CMP0048: Remove support for OLD behavior 2025-01-19 09:41:03 -05:00
Brad King
05b2c563bb CMP0047: Remove support for OLD behavior 2025-01-19 09:41:03 -05:00
Brad King
d9498a474e CMP0046: Remove support for OLD behavior 2025-01-19 09:41:03 -05:00
Brad King
1e8a744f07 CMP0045: Remove support for OLD behavior 2025-01-19 09:41:03 -05:00
Brad King
9094eaa778 CMP0044: Remove support for OLD behavior 2025-01-19 09:41:02 -05:00
Brad King
ed99370f63 CMP0043: Remove support for OLD behavior
Note that per-source `COMPILE_DEFINITIONS_<CONFIG>` are not covered by
the policy, and are still supported.
2025-01-19 09:41:02 -05:00
Brad King
9b148ed1ac CMP0042: Remove support for OLD behavior 2025-01-19 09:41:02 -05:00
Brad King
7193c2d23d CMP0041: Remove support for OLD behavior 2025-01-19 09:41:02 -05:00
Brad King
cddac8736d CMP0040: Remove support for OLD behavior 2025-01-19 09:41:02 -05:00
Brad King
0b6412b514 CMP0039: Remove support for OLD behavior 2025-01-19 09:41:01 -05:00
Brad King
af28f030d8 CMP0038: Remove support for OLD behavior 2025-01-19 09:41:01 -05:00
Brad King
84f737545f CMP0037: Remove support for OLD behavior 2025-01-19 09:41:01 -05:00
Brad King
850174c507 CMP0036: Remove support for OLD build_name command 2025-01-19 09:41:01 -05:00
Brad King
5b255fe7da CMP0035: Remove support for OLD variable_requires command 2025-01-19 09:41:01 -05:00
Brad King
84c3943873 CMP0034: Remove support for OLD utility_source command 2025-01-19 09:41:01 -05:00
Brad King
76702e36e3 CMP0033: Remove support for OLD export_library_dependencies command 2025-01-19 09:41:00 -05:00
Brad King
ff6d55f8c5 CMP0032: Remove support for OLD output_required_files command 2025-01-19 09:41:00 -05:00
Brad King
dc0c6734d3 CMP0031: Remove support for OLD load_command command 2025-01-19 09:41:00 -05:00
Brad King
6bdf4efbb3 CMP0030: Remove support for OLD use_mangled_mesa command 2025-01-19 09:41:00 -05:00
Brad King
683a02f5a0 CMP0029: Remove support for OLD subdir_depends command 2025-01-19 09:41:00 -05:00
Brad King
84b7c9f5dd CMP0028: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Brad King
5754c9f731 CMP0027: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Brad King
f8bc8780c1 CMP0026: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Brad King
796cf2d8eb CMP0025: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Brad King
65b45de1dd CMP0024: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Brad King
0453f70400 CMP0023: Remove support for OLD behavior 2025-01-18 09:51:45 -05:00
Brad King
888259c894 CMP0022: Remove support for OLD behavior 2025-01-18 09:51:45 -05:00
Brad King
e31d1c7600 CMP0021: Remove support for OLD behavior 2025-01-18 09:51:44 -05:00