Commit Graph

1819 Commits

Author SHA1 Message Date
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 5cd2669146 Add deprecation warnings for policies CMP0142 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for policies
introduced in CMake 3.25 and below to encourage projects to port
away from setting policies to OLD.
2025-02-05 14:20:48 -05:00
Alex Turbov d34971f455 Refactor: Eliminate redundant std::to_string as arg of cmStrCat
Plus optimize some other string operations in the modified files.
2025-01-26 04:03:38 +04: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 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 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 1393fbf13f CMP0059: Remove support for OLD behavior 2025-01-22 10:40:54 -05:00
Brad King 10cfc8f538 Merge topic 'extern-domain'
e109307c43 Add support for foreign targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10171
2025-01-22 09:30:49 -05:00
Vito Gamberini e109307c43 Add support for foreign targets 2025-01-21 15:26:40 -05:00
Brad King 2782d095b0 Remove compatibility with CMake versions older than 3.2
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.2.

Issue: #26613
2025-01-21 09:44:05 -05:00
Brad King dc24d88062 Remove compatibility with CMake versions older than 3.1
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.1.

Issue: #26613
2025-01-20 09:46:55 -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 8e0a0291ef Remove compatibility with CMake versions older than 3.0
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.0.

Issue: #26613
2025-01-19 09:41:04 -05:00
Brad King 6973f8304e CMP0050: 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 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 cddac8736d CMP0040: Remove support for OLD behavior 2025-01-19 09:41:02 -05:00
Brad King 84f737545f CMP0037: Remove support for OLD behavior 2025-01-19 09:41:01 -05:00
Brad King 65b45de1dd CMP0024: Remove support for OLD behavior 2025-01-19 09:40:59 -05:00
Brad King 3c4afba8cc Remove compatibility with CMake versions older than 2.8.12
This compatibility has been deprecated since commit 5845c218d7
(Deprecate compatibility with CMake versions older than 2.8.12,
2020-06-12, v3.19.0-rc1~629^2).  The behavior itself has been
deprecated since CMake 2.8.12.

Issue: #26613
2025-01-18 09:51:45 -05:00
Brad King 092d6de4be CMP0019: Remove support for OLD behavior 2025-01-18 09:51:44 -05:00
Brad King b6930d24f8 cmMakefile: Simplify GetModulesFile decision logic
After removing CMP0017, the logic can be simpler.
2025-01-18 09:51:44 -05:00
Brad King d74210a8bd CMP0017: Remove support for OLD behavior 2025-01-18 09:51:44 -05:00
Brad King 785523a136 Remove compatibility with CMake versions older than 2.8.0
This compatibility has been deprecated since commit 5845c218d7
(Deprecate compatibility with CMake versions older than 2.8.12,
2020-06-12, v3.19.0-rc1~629^2).  The behavior itself has been
deprecated since CMake 2.8.0.

Issue: #26613
2025-01-17 09:36:10 -05:00
Brad King 35282387ea CMP0014: Remove support for OLD behavior 2025-01-17 09:28:37 -05:00
Brad King fad9c55b8b CMP0013: Remove support for OLD behavior 2025-01-17 09:28:37 -05:00
Brad King 3c0dbb66f5 CMP0011: Remove support for OLD behavior 2025-01-17 09:28:36 -05:00
Brad King cf832e75bc CMP0010: Remove support for OLD behavior 2025-01-17 09:28:36 -05:00
Brad King 03934f16fa CMP0005: Remove support for OLD behavior 2025-01-17 09:28:35 -05:00
Brad King 136528aa1b CMP0002: Remove support for OLD behavior 2025-01-17 09:28:35 -05:00
Brad King e62b6cb748 CMP0000: Remove support for OLD behavior 2025-01-17 09:28:34 -05:00
Brad King 5c7bb0bfd9 Merge topic 'rename-cmakelists'
fcbc883fa3 cmake: Allow configuration of default script names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !10059
2024-12-18 08:49:58 -05:00
Martin Duffy fcbc883fa3 cmake: Allow configuration of default script names
Adds the ``--project-file`` command-line option to modify the default script
name loaded by CMake and ``add_subdirectory`` to values other than
``CMakeLists.txt``.

Fixes: #21570
2024-12-17 12:47:02 -05:00
Matthew Woehlke a73955ae76 cmMakefile: Allow arbitrary stack manipulation
Create a helper class to allow insertion of arbitrary entries into the
call stack (i.e. not associated with ExecuteCommand, ReadDependentFile,
etc.). Refactor ExecuteCommand helper class to leverage this and to be
named more consistently with similar helpers.
2024-12-07 09:11:45 -05:00
Brad King 659d8bd430 cmPolicies: Remove now-unused REQUIRED_IF_USED and REQUIRED_ALWAYS states 2024-11-13 11:43:07 -05:00
Brad King 58a90857f0 cmPolicies: Simplify representation of removed policies
A policy that can be set defaults to `WARN` internally.
A policy that has been removed always uses `NEW`.
The `REQUIRED_IF_USED` and `REQUIRED_ALWAYS` states
are not needed.
2024-11-13 11:33:29 -05:00
Alex Turbov f3f70c2f90 StringAlgorithms: Refactor cmTokenize() function
- Refactor and optimize the loop to make it shorter and faster
- Make it push elements into an arbitrary (templated) output iterator
- Make it a template on a separator type with the most used defaults
- Add a backward compatible signature to return `std::vector<std::string>`
- Add an alternative function `cmTokenizedView()` to return a vector of string views
2024-11-06 18:42:17 +04:00
Brad King ee83165923 cmake: Explicitly normalize input paths as they exist on disk
`CollapseFullPath` has two use cases:

1.  Normalize input paths from command-line arguments and environment
    variables.  On Windows, load their on-disk capitalization.

2.  Simplify paths constructed internally.  These should already have
    the correct capitalization.

Audit all `CollapseFullPath` call sites and code paths leading to them.
Replace those calls that normalize input paths with calls to
`ToNormalizedPathOnDisk` to express that they need the on-disk case.

By making this distinction we will later be able to remove the on-disk
capitalization lookup `CollapseFullPath`, thus eliminating disk accesses
from internal path processing.

Issue: #20214
2024-10-22 13:26:19 -04:00
Daniel Pfeifer 281e9039cb cmWorkingDirectory: Unify error messages 2024-10-18 15:04:07 -04:00
Daniel Pfeifer 1440b05bf1 cmMakefile: invoke callback after command execution
`cmMakefile` has a hook that invokes a callback before each command
execution.  The only user of that hook is `cmCTestScriptHandler`,
which uses it to update the elapsed time since it was started.
The `ctest_sleep` command again updates the elapsed time explicitly.
This explicit update can be saved by invoking the callback after
the command execution instead.
2024-10-11 15:38:25 +02:00
Brad King fe6cf6d28c Add deprecation warnings for policies CMP0139 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for policies
introduced in CMake 3.24 and below to encourage projects to port
away from setting policies to OLD.
2024-10-10 09:31:52 -04:00
Brad King 2daeb0b504 Merge topic 'build-databases'
e77655555c cmExperimental: gate build database support behind a flag
23cbeb5035 ci: enable `build_database` CXXModules tests
6863c1d823 Tests/CXXModules: add tests for module commands
123107c1a4 Tests/CXXModules: add support for running targets under a given config
438038b5e1 Tests/CXXModules: support building specific targets of example trees
84bc710d84 cmGlobalGenerator: generate build database files for targets
670f753f24 cmDyndepCollation: write build database metadata
dcf9a66ffe cxxmodules: plumb control data for exporting build databases
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9708
2024-09-05 09:20:23 -04:00
Ben Boeckel c48affe037 cmMakefile: support "after generator target" generator actions
These actions may require additional information gathered during
generation. Run them at the appropriate time.
2024-08-27 11:30:23 -04:00
Vitaly Stakhovsky 58da4aa47d Source: Avoid comparing pointers to nullptr 2024-08-27 10:56:38 -04:00
Alex Turbov 62bb8a77a5 cmMakefile: Teach ConfigureFile to move the temp file instead of copying it
In the variables substitution mode `cmMakefile::ConfigureFile`
was copy file and then remove temporary rendered file.

With updated signature of `MoveFileIfDifferent` it can be used
instead of `CopyFileIfDifferent`.
2024-07-18 10:29:47 -04:00
Alex Turbov 0a0a826b86 cmMakefile: Use find_if instead of manual loop
...in the `cmMakefile::ValidateCustomCommand()` as it was a warning
issued by `clang-tidy`.
2024-07-18 10:29:47 -04:00