Commit Graph

13 Commits

Author SHA1 Message Date
Matthew Woehlke
c79c5aea4a CPS: Refactor getting file set destination for install
Modify `cmExportInstallPackageInfoGenerator::GetFileSetDirectory` to not
have side effects, moving that logic to the call site instead. This will
allow the method to be used in other contexts.

Also, tweak a bunch of methods called by this method to not
unnecessarily require mutable objects.
2026-06-30 15:08:02 -04:00
Matthew Woehlke
5ed6b90a31 Diagnostics: Capture install state
Modify `cmInstallGenerator` to have a `cmDiagnosticContext` instead of
just a `cmListFileBacktrace`. Create helpers to obtain a state capture
that includes `CMD_INSTALL_ABSOLUTE_DESTINATION`. Modify most subclasses
(namely, ones that have a `DESTINATION`) to use this new state capture.

This fixes a limitation identified when 39a56136a3 (Diagnostic: Add warn
or error on absolute install paths, 2026-03-25) added the aforementioned
diagnostic, that the install generator(s) no longer have access to the
diagnostic state as of the `install` invocation which ultimately caused
the diagnostic if that scope is not the top-most scope of the current
subdirectory.

Note that some of the generators which capture context have not actually
implemented the diagnostic yet.
2026-05-08 11:23:11 -04:00
Matthew Woehlke
732b9585a7 Style: Use camelCase identifiers
Fix most snake_case identifiers in cmInstall* to use camelCase instead.

Also, update clang-tidy configuration to help with applying these
changes, though the relevant check remains off by default.
2026-05-06 11:17:02 -04:00
Robert Maynard
39a56136a3 Diagnostic: Add warn or error on absolute install paths
Add `-Winstall-absolute-destination` diagnostic to warn or
error when an install command has an absolute destination.

This allow projects to enforce the best practice of not allowing
absolute install DESTINATIONS.
2026-04-29 09:22:29 -04:00
Robert Maynard
fd76089631 cmInstallFileSetGenerator: Only support per config Destination. 2026-04-24 10:49:03 -04:00
Marc Chevrier
280733b7b2 File Sets: Refactor install/export to prepare for new file set types 2026-03-15 09:31:58 +01:00
Marc Chevrier
dee8799d16 FileSet management: Introduce dedicated classes for generation
To manage the generation step, introduce cmGeneratorFileSet and
cmGeneratorFileSets classes.
These reorganizations of the code are done in preparation of the
implementation of SOURCES file set type as well as user's file set types.

Issues: #27550, #27383
2026-02-19 17:35:56 +01:00
Vito Gamberini
d71b59a4f7 install(TARGETS): Don't ignore non-extant file sets
When installing FILE_SETs, it is possible the FILE_SET has not yet been
created with target_sources(FILE_SET). Instead of ignoring this
situation, we need to track the installed FILE_SET names and their
possible install destinations.

At generation time we resolve the names and destinations concretely. If
a FILE_SET wasn't provided or isn't an INTERFACE, we silently bail out.

Fixes: #26697
2025-06-12 16:58:11 -04: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
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
241ee252ce IWYU: Update for Debian 12 CI job
`include-what-you-use` diagnostics, in practice, are specific to
the environment's compiler and standard library.  Update includes
to satisfy IWYU for our CI job under Debian 12.
2023-07-28 09:14:08 -04:00
Brad King
11cc728e75 cmConstStack: Factor out of cmListFileBacktrace
This presents value semantics for a stack of constant values.
Internally it shares ownership to avoid copies.  Previously
this was implemented by `cmListFileBacktrace` explicitly,
but the approach can be re-used for other kinds of stacks.
2022-04-02 05:55:31 -04:00
Kyle Edwards
9b479124cc install(TARGETS): Add FILE_SET mode 2021-10-27 15:17:23 -04:00