3.25.rst 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. CMake 3.25 Release Notes
  2. ************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.24 include the following.
  6. New Features
  7. ============
  8. Presets
  9. -------
  10. * The :manual:`cmake-presets(7)` schema version has been bumped to ``6``.
  11. * The :manual:`cmake-presets(7)` format now supports a
  12. ``packagePresets`` field to specify presets for :option:`cpack --preset`.
  13. * The :manual:`cmake-presets(7)` format now supports a
  14. ``workflowPresets`` field to specify presets for :option:`cmake --workflow`.
  15. Languages
  16. ---------
  17. * The :manual:`Compile Features <cmake-compile-features(7)>` functionality
  18. is now aware of C++26, and defines a ``cxx_std_26`` meta-feature.
  19. C++26 compiler modes may also be specified via the :prop_tgt:`CXX_STANDARD`,
  20. :prop_tgt:`CUDA_STANDARD`, :prop_tgt:`HIP_STANDARD`,
  21. or :prop_tgt:`OBJCXX_STANDARD` target properties.
  22. * ``CUDA`` language support now includes device link-time optimization when
  23. using ``nvcc``. The :variable:`CMAKE_INTERPROCEDURAL_OPTIMIZATION` variable
  24. and the associated :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` target property
  25. will activate device LTO.
  26. Command-Line
  27. ------------
  28. * A :option:`cmake --workflow --preset <cmake--workflow --preset>` mode was
  29. added to drive sequences of configure, build, test, and package operations
  30. through a single command.
  31. * The :option:`cmake -E capabilities <cmake-E capabilities>` command
  32. gained a new ``tls`` field that tells whether or not TLS is enabled.
  33. * The :option:`cmake -E env <cmake-E env>` command-line tool gained
  34. a ``--modify`` flag to support :prop_test:`ENVIRONMENT_MODIFICATION`
  35. operations.
  36. * The :option:`cmake --debug-trycompile` option now prints log messages
  37. reporting the directory in which each try-compile check is done.
  38. Compilers
  39. ---------
  40. * Support for the `Tasking compiler toolsets`_ (SmartCode, TriCore,
  41. Standalone: ARM, MCS, 8051) was added with compiler id ``Tasking``.
  42. See the :variable:`CMAKE_TASKING_TOOLSET` variable.
  43. .. _`Tasking compiler toolsets`: https://tasking.com
  44. Commands
  45. --------
  46. * The :command:`add_subdirectory` command gained a ``SYSTEM`` option
  47. to enable the :prop_dir:`SYSTEM` directory property in the subdirectory.
  48. * The :command:`block` and :command:`endblock` commands were added to manage
  49. specific scopes (policy or variable) for a contained block of commands.
  50. * The :command:`cmake_language` command gained a new
  51. ``GET_MESSAGE_LOG_LEVEL`` sub-command. It can be used to
  52. query the current message logging level.
  53. * The :command:`find_file`, :command:`find_path`, :command:`find_library`, and
  54. :command:`find_program` commands gained a ``VALIDATOR`` option to specify a
  55. function to be called for each candidate item to validate it.
  56. * The :command:`find_package` command now considers paths of
  57. the form ``<prefix>/<name>*/(cmake|CMake)/<name>*/`` when
  58. searching for package configuration files.
  59. * The :command:`return` command gained a ``PROPAGATE`` option to propagate
  60. variables to the scope to which control returns.
  61. See policy :policy:`CMP0140`.
  62. * The :command:`try_compile` and :command:`try_run` commands gained new
  63. signatures that more consistently use keyword dispatch and do not require a
  64. binary directory to be specified. Additionally, these signatures use a
  65. unique directory for each invocation, which allows multiple outputs to be
  66. preserved when using :option:`cmake --debug-trycompile`.
  67. * The :command:`try_compile` and :command:`try_run` commands gained the
  68. option ``NO_CACHE`` to store results in normal variables.
  69. * The :command:`try_run` command gained ``RUN_OUTPUT_STDOUT_VARIABLE``
  70. and ``RUN_OUTPUT_STDERR_VARIABLE`` options to capture stdout and stderr
  71. separately from the output of the compiled program.
  72. Variables
  73. ---------
  74. * The :variable:`BSD` and :variable:`CMAKE_HOST_BSD` variables are now set
  75. to a string value when the target or host system is BSD, respectively.
  76. * The :variable:`LINUX` and :variable:`CMAKE_HOST_LINUX` variables are
  77. now set to true when the target or host system is Linux, respectively.
  78. * The :variable:`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` variable and
  79. :prop_tgt:`MSVC_DEBUG_INFORMATION_FORMAT` target property were introduced
  80. to select the debug information format for compilers targeting the MSVC ABI.
  81. See policy :policy:`CMP0141`.
  82. * The :variable:`CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION` variable and
  83. corresponding :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_API_VALIDATION` target
  84. property were added to tell the :generator:`Xcode` generator what to put
  85. in the scheme's ``Metal: API Validation`` setting.
  86. * The :variable:`CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION` variable and
  87. corresponding :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION` target
  88. property were added to tell the :generator:`Xcode` generator what to put
  89. in the scheme's ``Metal: Shader Validation`` setting.
  90. * The :variable:`CMAKE_XCODE_SCHEME_LAUNCH_MODE` variable and corresponding
  91. :prop_tgt:`XCODE_SCHEME_LAUNCH_MODE` target property were added to tell
  92. the :generator:`Xcode` generator what to put in the scheme's "Launch"
  93. mode setting.
  94. * The :variable:`CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION` variable and
  95. corresponding :prop_tgt:`XCODE_SCHEME_LAUNCH_CONFIGURATION` target
  96. property were added to tell the :generator:`Xcode` generator what
  97. configuration to put in the scheme's Launch action.
  98. Properties
  99. ----------
  100. * The :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property now supports
  101. :manual:`generator expressions <cmake-generator-expressions(7)>`.
  102. * The :prop_tgt:`EXPORT_NO_SYSTEM` target property was added to
  103. specify that :command:`install(EXPORT)` and :command:`export`
  104. commands will generate na imported target with
  105. :prop_tgt:`SYSTEM` property ``OFF``.
  106. * The :prop_tgt:`SYSTEM` target property was added to specify
  107. whether a target should be treated as a system library (i.e.
  108. its include directories are automatically ``SYSTEM`` when
  109. compiling consumers). If not set, the default is the previous
  110. behavior: on for imported targets and off for other targets.
  111. * The :prop_dir:`SYSTEM` directory property was added to initialize the
  112. :prop_tgt:`SYSTEM` target property for targets created in that directory.
  113. Modules
  114. -------
  115. * The :module:`FetchContent` module :command:`FetchContent_Declare`
  116. command gained a ``SYSTEM`` option to enable the :prop_dir:`SYSTEM`
  117. directory property in the subdirectory.
  118. * The :module:`FindCUDAToolkit` module now provides a target for
  119. :ref:`nvtx3 <cuda_toolkit_nvtx3>` for CUDA 10.0+, which supersedes
  120. :ref:`nvToolsExt <cuda_toolkit_nvToolsExt>`. A deprecation warning
  121. is emitted when using ``nvToolsExt`` if the project requires CMake
  122. 3.25 and CUDA 10.0+ is used.
  123. * The :module:`FindDoxygen` module's version handling has been improved:
  124. * Multiple candidate installations will now be considered, if needed,
  125. to satisfy version constraints. Previously, only the first one
  126. encountered would be considered.
  127. * Version ranges are supported.
  128. * Variations in the version format reported by Doxygen are now
  129. tolerated (e.g. a trailing git commit hash).
  130. * The :module:`FindOpenAL` module now provides an imported target.
  131. * The :module:`FindOpenSP` module was added to find the OpenSP library.
  132. * The :module:`FindVulkan` module gained support for new components:
  133. ``dxc``
  134. DirectX Shader Compiler.
  135. ``volk``
  136. Volk open-source vulkan meta-loader.
  137. CPack
  138. -----
  139. * The :cpack_gen:`CPack Archive Generator` gained a new
  140. :variable:`CPACK_ARCHIVE_FILE_EXTENSION` variable to control
  141. the package file name extension.
  142. * The :cpack_gen:`CPack NSIS Generator` gained two new variables
  143. :variable:`CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS` and
  144. :variable:`CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS`
  145. to provide arguments to the nsis executable invocation.
  146. * The :module:`CPack` module gained the :variable:`CPACK_READELF_EXECUTABLE`,
  147. :variable:`CPACK_OBJCOPY_EXECUTABLE`, and
  148. :variable:`CPACK_OBJDUMP_EXECUTABLE` variables to control the locations
  149. of binutils used by :manual:`cpack(1)`.
  150. Deprecated and Removed Features
  151. ===============================
  152. * The :prop_tgt:`IMPORTED_NO_SYSTEM` target property has been deprecated
  153. in favor of :prop_tgt:`SYSTEM` and :prop_tgt:`EXPORT_NO_SYSTEM`.
  154. * The :generator:`Visual Studio 10 2010` generator has been removed.
  155. * The :generator:`Visual Studio 11 2012` generator is now deprecated
  156. and will be removed in a future version of CMake.
  157. Other Changes
  158. =============
  159. * On Windows, when targeting the MSVC ABI, the :command:`find_library` command
  160. now accepts ``.a`` file names after first considering ``.lib``. This is
  161. symmetric with existing behavior when targeting the GNU ABI, in which the
  162. command accepts ``.lib`` file names after first considering ``.a``.
  163. * The :envvar:`SSL_CERT_FILE` and :envvar:`SSL_CERT_DIR` environment
  164. variables can now be used to override where to find certificate
  165. authorities for TLS/SSL operations.
  166. * If :prop_tgt:`<LANG>_CLANG_TIDY` includes a ``-p`` argument, the
  167. full compiler command line is no longer appended after ``--``.
  168. * The :generator:`Xcode` generator no longer adds the per-config suffix
  169. ``$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)`` to library search paths.
  170. See policy :policy:`CMP0142`.