[cmake-developers] making exports first-class (was: Making Config.cmake files easier to write)

Brad King brad.king at kitware.com
Fri Feb 17 13:54:24 EST 2012


On 2/17/2012 1:33 PM, Yury G. Kudryashov wrote:
> Eric Noulard wrote:
>
>> 2012/2/17 Alexander Neundorf<neundorf at kde.org>:
>>> We discussed that too already.
>>
>> Sorry, I surely missed this part if the discussion,
>> next time don't bother re-explaining me I'll go and dig the ML.
> A digest of the old discussion.
>
> The only non-bloated version of "do all the cmake-config magic" command I
> see is write_basic_config_file_for_export(MyExport). This would require some
> changes on C++ side (i.e., make it possible to query MyExport DESTINTATION,
> NAMESPACE, list of targets etc.). And this will work only for simple cases
> (e.g., a few libraries/executables with simple version logic).

If anyone is interested in working on something like this the C++ changes
you mention would need to make exports recorded by either export() or
install(EXPORT) into first-class objects.  A major missing feature from
them right now is having multiple logical exports with dependencies.
Currently an export must include the transitive closure of its own
dependencies.  If instead they were first class objects in CMake then
then the dependencies of one export could be satisfied by an export-level
dependency on another export.

Note that this is not directly tied to package configuration file generation.
Exports correspond to *target* files that can be loaded by package config
files to import the targets provided by an export into another project.
I suppose extra properties could be configured on the exports to generate
simple package configuration files but as you say it would only work for
simple cases.

-Brad



More information about the cmake-developers mailing list