1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-05-12 08:05:28 +08:00

4 Commits

Author SHA1 Message Date
Brad King
888259c894 CMP0022: Remove support for OLD behavior 2025-01-18 09:51:45 -05:00
Matthew Woehlke
20fa4ce8d8 export: Factor out CMake-specific export generation (2/2)
In order to support generation of Common Package Specifications, the
mechanisms CMake uses to export package information need to be made more
abstract. The prior commits began this refactoring; this continues by
(actually) restructuring the classes used to generate the actual export files.
To minimize churn, this introduces virtual base classes and
diamond inheritance in order to separate logic which is format-agnostic
but depends on the export mode (build-tree versus install-tree) from
logic which is format-specific but mode-agnostic.

This could probably be refactored further to use helper classes instead,
and a future commit may do that, however an initial attempt to do that
was proving even more invasive, such that this approach was deemed more
manageable.

While we're at it, add 'const' in more places where possible.
2024-07-23 12:13:39 -04:00
Matthew Woehlke
6c66340a64 export: Fix const placement
Use clang-format to fix placement of const qualifiers to be consistently
right of the typename. The inconsistency was getting annoying,
especially as the following refactor changes a lot of methods and
sometimes adds const. (Being inconsistent within a file is not ideal,
but in some cases there was inconsistency within single lines!)
2024-07-18 12:08:43 -04:00
Matthew Woehlke
1bceab3520 export: Factor out CMake-specific export generation (*/2)
In order to support generation of Common Package Specifications, the
mechanisms CMake uses to export package information need to be made more
abstract. This will involve substantial refactoring of the classes used
to generate the actual export files. In order to help git track what's
happening, create the new files as copies of the files that will serve
as their source material. The class names have been updated and
formatting repaired, but no other refactoring has been done, which
should still allow git to detect the copies.

This commit is a purely intermediate step that exists for no other
reason than to improve history tracking.
2024-07-18 12:08:43 -04:00