Files
CMake/Help/dev/experimental.rst
Matthew Woehlke 3d52d70b84 export: Add initial CPS support
Add initial support for exporting (install only, for now) Common Package
Specification (https://cps-org.github.io/cps/) format package
descriptions. This has some limitations, such as not supporting
generator expressions (as these cannot be portably exported), and only
partially supporting transitive dependencies, but should be usable for
at least some simple cases. (Actually, $<LINK_ONLY> is theoretically
supportable, but is not yet implemented.)

This still needs tests; these will be added in the next commit. Other
potential improvements include support for language-specific compile
definitions and inferring some package properties from project
properties. Additionally, there is no module support yet; this is partly
pending on having a tool agnostic format for providing the necessary
information.
2024-08-14 15:25:27 -04:00

83 lines
3.1 KiB
ReStructuredText

CMake Experimental Features Guide
*********************************
The following is a guide to CMake experimental features that are
under development and not yet included in official documentation.
See documentation on `CMake Development`_ for more information.
.. _`CMake Development`: README.rst
Features are gated behind ``CMAKE_EXPERIMENTAL_`` variables which must be set
to specific values in order to enable their gated behaviors. Note that the
specific values will change over time to reinforce their experimental nature.
When used, a warning will be generated to indicate that an experimental
feature is in use and that the affected behavior in the project is not part of
CMake's stability guarantees.
Export Package Dependencies
===========================
In order to activate support for this experimental feature, set
* variable ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES`` to
* value ``1942b4fa-b2c5-4546-9385-83f254070067``.
This UUID may change in future versions of CMake. Be sure to use the value
documented here by the source tree of the version of CMake with which you are
experimenting.
When activated, this experimental feature provides the following:
* The ``install(EXPORT)`` and ``export(EXPORT)`` commands have experimental
``EXPORT_PACKAGE_DEPENDENCIES`` arguments to generate ``find_dependency``
calls automatically.
* Details of the calls may be configured using the ``export(SETUP)``
command's ``PACKAGE_DEPENDENCY`` argument.
* The package name associated with specific targets may be specified
using the ``CMAKE_EXPORT_FIND_PACKAGE_NAME`` variable and/or
``EXPORT_FIND_PACKAGE_NAME`` target property.
Export |CPS| Package Information
================================
In order to activate support for this experimental feature, set
* variable ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO`` to
* value ``b80be207-778e-46ba-8080-b23bba22639e``.
This UUID may change in future versions of CMake. Be sure to use the value
documented here by the source tree of the version of CMake with which you are
experimenting.
When activated, this experimental feature provides the following:
* The experimental ``install(PACKAGE_INFO)`` command is available to export
package information in the |CPS|_ format.
C++ ``import std`` support
==========================
In order to activate support for ``import std`` in C++23 and newer targets,
set
* variable ``CMAKE_EXPERIMENTAL_CXX_IMPORT_STD`` to
* value ``0e5b6991-d74f-4b3d-a41c-cf096e0b2508``.
This UUID may change in future versions of CMake. Be sure to use the value
documented here by the source tree of the version of CMake with which you are
experimenting. It must be set before the ``CXX`` toolchain is discovered by
CMake, usually as part of a :command:`project` call.
When activated, this experimental feature provides the following:
* The :prop_tgt:`CXX_MODULE_STD` target property and its initializing variable
:variable:`CMAKE_CXX_MODULE_STD`.
* Targets with the property set to a true value and at least ``cxx_std_23``
may use ``import std;`` in any scanned C++ source file.
.. _CPS: https://cps-org.github.io/cps/
.. |CPS| replace:: Common Package Specification