find_package()'s debug mode provides information about which
prefixes are searched, but not which roots are prepended to each
prefix. Display this information if debugging is enabled.
* Wraps the llpkgc parser with cmPkgConfigParser
* Adds various resolution and mangling code under cmPkgConfigResolver
* Documents new command cmake_pkg_config(EXTRACT). Documentation is written with
the assumption additional subcommands will be added soon.
* Adds various tests for the above
Fix some additional places in export generation logic that were still
hard-coding the import prefix. Change cmGeneratorExpression::Preprocess
to take the desired prefix as an argument. (This replaces taking a
boolean whether to resolve relative paths; if a non-empty prefix is
given, that is used to resolve relative paths, otherwise relative paths
are left alone.) This should ensure that import properties always spell
the prefix according to the format being generated.
Move some logic that is specific to CMake-format exports from
GenerateImportFileConfig to an overload of GenerateImportConfig, so that
the former can be moved (back) to the generic base class. This will
allow it to also be used for Common Package Specification exports. To
facilitate this, also add a method to get the format-specific character
used to separate the export file base name from the config suffix, so
that the rest of the logic to determine the file name can be shared.
Refactor methods in the build and install export file generators to have
the same, simplified API. Expose the resulting method as an abstract
method on the base class, so that it can be called from mode-agnostic
generators. While we're at it, refactor cmExportInstallFileGenerator's
version to use std::any_of.
e947e7b6e2 cmListFileCache: use cmStrCat instead of string stream
55a4a585fa cmListFileParser: use unique_ptr to own cmListFileLexer instance
63f8134744 cmListFileCache: convert cmListFileParser from struct to class
1bf4900df7 cmListFileCache: avoid redundant operator<< calls
459c01d520 cmListFileCache: move cmListFileParser into an anonymous namespace
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9680
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.
When 033dc7ee2f introduced
`AddSystemIncludeDirectory()`, the function was not handling the
situation which a system include cache key is not added properly like
in `IsSystemIncludeDirectory()`. The error was not exposed when
`AUTOMOC` is `ON` and `AUTOUIC` is `ON` because
`GetIncludeDirectoriesImplicit()` inside `initMoc()` was triggering
`IsSystemIncludeDirectory()`.
This commit adds calling
`AddSystemIncludeCacheKey()` inside `AddSystemIncludeDirectory()`
when the system include cache key is not added before.
Fixes: #26146
Add a `-LR[A][H] <regex>` flag with similar functionality to `-L[A][H]`,
but instead of listing all cached variables, it show only specific
variables that match the name regex.
1e35163ae8 WHOLE_ARCHIVE link feature: rely now on linker configuration
c1c4cf9545 Linker configuration: introduce a new architecture
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9665