experimental.rst 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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
  31. ================================
  32. In order to activate support for this experimental feature, set
  33. * variable ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO`` to
  34. * value ``b80be207-778e-46ba-8080-b23bba22639e``.
  35. This UUID may change in future versions of CMake. Be sure to use the value
  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. * The experimental ``install(PACKAGE_INFO)`` command is available to export
  40. package information in the |CPS|_ format.
  41. Find/Import |CPS| Packages
  42. ==========================
  43. In order to activate support for this experimental feature, set
  44. * variable ``CMAKE_EXPERIMENTAL_FIND_CPS_PACKAGES`` to
  45. * value ``e82e467b-f997-4464-8ace-b00808fff261``.
  46. This UUID may change in future versions of CMake. Be sure to use the value
  47. documented here by the source tree of the version of CMake with which you are
  48. experimenting.
  49. When activated, this experimental feature provides the following:
  50. * The :command:`find_package` command will also search for packages which are
  51. described using |CPS|_. Refer to the :command:`find_package` documentation
  52. for details.
  53. C++ ``import std`` support
  54. ==========================
  55. In order to activate support for ``import std`` in C++23 and newer targets,
  56. set
  57. * variable ``CMAKE_EXPERIMENTAL_CXX_IMPORT_STD`` to
  58. * value ``d0edc3af-4c50-42ea-a356-e2862fe7a444``.
  59. This UUID may change in future versions of CMake. Be sure to use the value
  60. documented here by the source tree of the version of CMake with which you are
  61. experimenting. It must be set before the ``CXX`` toolchain is discovered by
  62. CMake, usually as part of a :command:`project` call.
  63. When activated, this experimental feature provides the following:
  64. * The :prop_tgt:`CXX_MODULE_STD` target property and its initializing variable
  65. :variable:`CMAKE_CXX_MODULE_STD`.
  66. * Targets with the property set to a true value and at least ``cxx_std_23``
  67. may use ``import std;`` in any scanned C++ source file.
  68. .. _CPS: https://cps-org.github.io/cps/
  69. .. |CPS| replace:: Common Package Specification
  70. Build database support
  71. ======================
  72. In order to activate support for exporting build databases, set
  73. * variable ``CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE`` to
  74. * value ``73194a1d-c0b5-41b9-9190-a4512925e192``.
  75. This UUID may change in future versions of CMake. Be sure to use the value
  76. documented here by the source tree of the version of CMake with which you are
  77. experimenting.
  78. When activated, this experimental feature provides the following:
  79. * The :prop_tgt:`EXPORT_BUILD_DATABASE` target property and its initializing
  80. variable :variable:`CMAKE_EXPORT_BUILD_DATABASE` and environment variable
  81. :envvar:`CMAKE_EXPORT_BUILD_DATABASE`.
  82. * Targets with the property set to a true value will have their C++ build
  83. information exported to the build database.
  84. Instrumentation
  85. ===============
  86. In order to activate support for the :command:`cmake_instrumentation` command,
  87. set
  88. * variable ``CMAKE_EXPERIMENTAL_INSTRUMENTATION`` to
  89. * value ``ec7aa2dc-b87f-45a3-8022-fe01c5f59984``.
  90. To enable instrumentation at the user-level, files should be placed under
  91. either
  92. ``<CMAKE_CONFIG_DIR>/instrumentation-ec7aa2dc-b87f-45a3-8022-fe01c5f59984`` or
  93. ``<CMAKE_BINARY_DIR>/.cmake/instrumentation-ec7aa2dc-b87f-45a3-8022-fe01c5f59984``.
  94. To include instrumentation data in CTest XML files (for submission to CDash),
  95. you need to set the following environment variables:
  96. * ``CTEST_USE_INSTRUMENTATION=1``
  97. * ``CTEST_EXPERIMENTAL_INSTRUMENTATION=ec7aa2dc-b87f-45a3-8022-fe01c5f59984``