experimental.rst 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. CMake Experimental Features Guide
  2. *********************************
  3. The following is a guide to CMake experimental features that are
  4. under development and not yet included in official documentation.
  5. See documentation on `CMake Development`_ for more information.
  6. .. _`CMake Development`: README.rst
  7. Features are gated behind ``CMAKE_EXPERIMENTAL_`` variables which must be set
  8. to specific values in order to enable their gated behaviors. Note that the
  9. specific values will change over time to reinforce their experimental nature.
  10. When used, a warning will be generated to indicate that an experimental
  11. feature is in use and that the affected behavior in the project is not part of
  12. CMake's stability guarantees.
  13. Export Package Dependencies
  14. ===========================
  15. In order to activate support for this experimental feature, set
  16. * variable ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES`` to
  17. * value ``1942b4fa-b2c5-4546-9385-83f254070067``.
  18. This UUID may change in future versions of CMake. Be sure to use the value
  19. documented here by the source tree of the version of CMake with which you are
  20. experimenting.
  21. When activated, this experimental feature provides the following:
  22. * The ``install(EXPORT)`` and ``export(EXPORT)`` commands have experimental
  23. ``EXPORT_PACKAGE_DEPENDENCIES`` arguments to generate ``find_dependency``
  24. calls automatically.
  25. * Details of the calls may be configured using the ``export(SETUP)``
  26. command's ``PACKAGE_DEPENDENCY`` argument.
  27. * The package name associated with specific targets may be specified
  28. using the ``CMAKE_EXPORT_FIND_PACKAGE_NAME`` variable and/or
  29. ``EXPORT_FIND_PACKAGE_NAME`` target property.
  30. Export |CPS| Package Information for ``install(EXPORT)``
  31. ========================================================
  32. In order to activate support for this experimental feature, set
  33. * variable ``CMAKE_EXPERIMENTAL_MAPPED_PACKAGE_INFO`` to
  34. * value ``ababa1b5-7099-495f-a9cd-e22d38f274f2``.
  35. These UUIDs may change in future versions of CMake. Be sure to use the values
  36. documented here by the source tree of the version of CMake with which you are
  37. experimenting.
  38. When activated, this experimental feature provides the following:
  39. * Setting ``CMAKE_INSTALL_EXPORTS_AS_PACKAGE_INFO`` enables generation of
  40. package information in the |CPS|_ format via the ``install(EXPORT)`` command.
  41. .. _CPS: https://cps-org.github.io/cps/
  42. .. |CPS| replace:: Common Package Specification
  43. C++ ``import std`` support
  44. ==========================
  45. In order to activate support for ``import std`` in C++23 and newer targets,
  46. set
  47. * variable ``CMAKE_EXPERIMENTAL_CXX_IMPORT_STD`` to
  48. * value ``451f2fe2-a8a2-47c3-bc32-94786d8fc91b``.
  49. This UUID may change in future versions of CMake. Be sure to use the value
  50. documented here by the source tree of the version of CMake with which you are
  51. experimenting. It must be set before the ``CXX`` toolchain is discovered by
  52. CMake, usually as part of a ``project()`` call.
  53. When activated, this experimental feature provides the following:
  54. * The ``CXX_MODULE_STD`` target property and its initializing variable
  55. ``CMAKE_CXX_MODULE_STD``.
  56. * Targets with the property set to a true value and at least ``cxx_std_23``
  57. may use ``import std;`` in any scanned C++ source file.
  58. Build database support
  59. ======================
  60. In order to activate support for exporting build databases, set
  61. * variable ``CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE`` to
  62. * value ``73194a1d-c0b5-41b9-9190-a4512925e192``.
  63. This UUID may change in future versions of CMake. Be sure to use the value
  64. documented here by the source tree of the version of CMake with which you are
  65. experimenting.
  66. When activated, this experimental feature provides the following:
  67. * The :prop_tgt:`EXPORT_BUILD_DATABASE` target property and its initializing
  68. variable :variable:`CMAKE_EXPORT_BUILD_DATABASE` and environment variable
  69. :envvar:`CMAKE_EXPORT_BUILD_DATABASE`.
  70. * Targets with the property set to a true value will have their C++ build
  71. information exported to the build database.
  72. Software Bill Of Materials |SBOM|
  73. =================================
  74. In order to activate support for the :command:`install(SBOM)` command,
  75. set
  76. * variable ``CMAKE_EXPERIMENTAL_GENERATE_SBOM`` to
  77. * value ``ca494ed3-b261-4205-a01f-603c95e4cae0``.
  78. This UUID may change in future versions of CMake. Be sure to use the value
  79. documented here by the source tree of the version of CMake with which you are
  80. experimenting.
  81. When activated, this experimental feature provides the following:
  82. * The experimental ``export(SBOM)`` and ``install(SBOM)`` commands are
  83. available to generate a Software Bill of Materials or "SBOM" for the current
  84. project. See :command:`install(SBOM)` for a complete overview of the command.
  85. Rust Support
  86. ============
  87. In order to activate support for Rust, set
  88. * variable ``CMAKE_EXPERIMENTAL_RUST`` to
  89. * value ``3cc9b32c-47d3-4056-8953-d74e69fc0d6c``.
  90. This UUID may change in future versions of CMake. Be sure to use the value
  91. documented here by the source tree of the version of CMake with which you are
  92. experimenting.