3.30.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. CMake 3.30 Release Notes
  2. ************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.29 include the following.
  6. New Features
  7. ============
  8. Presets
  9. -------
  10. * :manual:`cmake-presets(7)` files now support schema version ``9``.
  11. ``include`` fields now expand all macros except ``$env{}`` and
  12. preset-specific macros, i.e., those derived from the fields
  13. inside a preset's definition.
  14. File-Based API
  15. --------------
  16. * The :manual:`cmake-file-api(7)` "cmakeFiles" version 1 object's ``version``
  17. field has been updated to 1.1. It gained a ``globsDependent`` field to
  18. report :command:`file(GLOB)` calls using ``CONFIGURE_DEPENDS``.
  19. Generators
  20. ----------
  21. * :ref:`Visual Studio Generators` now add ``UseDebugLibraries`` indicators to
  22. ``.vcxproj`` files to denote which configurations are debug configurations.
  23. See policy :policy:`CMP0162`.
  24. Languages
  25. ---------
  26. * The :manual:`Compile Features <cmake-compile-features(7)>` functionality
  27. now implements support for the ``cxx_std_26`` and ``cuda_std_26``
  28. meta-features to indicate that the compiler mode must be at least C++26.
  29. These meta-features were first documented by CMake 3.25, but were not fully
  30. implemented.
  31. Commands
  32. --------
  33. * The :command:`add_library` command, on platforms that do not support shared
  34. libraries, now rejects creation of shared libraries instead of automatically
  35. converting them to static libraries. See policy :policy:`CMP0164`.
  36. * The :command:`enable_language` command now fails with an error
  37. if it is called before the first :command:`project` call.
  38. See policy :policy:`CMP0165`.
  39. * The :command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands
  40. gained a ``TLS_VERSION <min>`` option to specify the minimum TLS
  41. version for connections to ``https://`` URLs.
  42. Variables
  43. ---------
  44. * The :variable:`CMAKE_<LANG>_STANDARD_LATEST` variable was added to
  45. describe the latest ``<LANG>`` language standard CMake supports for
  46. the selected compiler.
  47. * The :envvar:`CMAKE_TLS_VERIFY` environment variable was added as a fallback
  48. to the existing :variable:`CMAKE_TLS_VERIFY` variable. It specifies
  49. whether to verify the server certificate for ``https://`` URLs by default.
  50. * The :variable:`CMAKE_TLS_VERSION` variable and :envvar:`CMAKE_TLS_VERSION`
  51. environment variable were added to specify a default minimum TLS version
  52. for connections to ``https://`` URLs by the :command:`file(DOWNLOAD)`
  53. and :command:`file(UPLOAD)` commands.
  54. * The :variable:`CMAKE_VS_USE_DEBUG_LIBRARIES` variable and corresponding
  55. :prop_tgt:`VS_USE_DEBUG_LIBRARIES` target property were added to explicitly
  56. control ``UseDebugLibraries`` indicators in ``.vcxproj`` files.
  57. Properties
  58. ----------
  59. * The :prop_sf:`GENERATED` source file property is now visible in all
  60. directories. See policy :policy:`CMP0163`. Policy :policy:`CMP0118`'s
  61. documentation has been revised to describe its actual effects.
  62. * The :prop_gbl:`PROPAGATE_TOP_LEVEL_INCLUDES_TO_TRY_COMPILE` global property
  63. can be used to propagate :variable:`CMAKE_PROJECT_TOP_LEVEL_INCLUDES` into
  64. :command:`try_compile` calls that use the
  65. :ref:`whole-project signature <Try Compiling Whole Projects>`.
  66. This is primarily intended as a way for dependency providers to be enabled
  67. in such :command:`try_compile` calls.
  68. * A :prop_tgt:`VS_FILTER_PROPS` target property was added to tell
  69. :ref:`Visual Studio Generators` to use a custom MSBuild filter
  70. ``.props`` file.
  71. Modules
  72. -------
  73. * The :module:`ExternalProject` module's :command:`ExternalProject_Add`
  74. command gained a ``TLS_VERSION <min>`` option, and support for the
  75. :variable:`CMAKE_TLS_VERSION` variable and :envvar:`CMAKE_TLS_VERSION`
  76. environment variable, to specify the minimum TLS version for connections
  77. to ``https://`` URLs.
  78. * The :module:`FindBacktrace` module now provides an imported target.
  79. * The :module:`FindBLAS` and :module:`FindLAPACK` modules gained
  80. support for ``libblastrampoline``.
  81. * The :module:`FindCUDAToolkit` module now provides a target for
  82. ``libnvfatbin`` and ``libnvfatbin_static``, if found.
  83. * The :module:`FindCUDAToolkit` module now searches the
  84. :variable:`CMAKE_CUDA_COMPILER <CMAKE_<LANG>_COMPILER>`
  85. variable and the :envvar:`CUDACXX` environment variable
  86. even when the ``CUDA`` language isn't enabled.
  87. * The :module:`FindOpenMP` module gained an ``OpenMP_RUNTIME_MSVC``
  88. option to control the OpenMP runtime used with MSVC.
  89. * The :module:`FindPython` and :module:`FindPython3` modules gained
  90. support for the free threaded Python version.
  91. * The :module:`FindPython`, :module:`FindPython2`, and :module:`FindPython3`
  92. modules, on Windows, now offer better support for the Python debug variant:
  93. * new variables:
  94. * ``Python_EXECUTABLE_DEBUG``
  95. * ``Python_INTERPRETER``
  96. * ``Python_DEBUG_POSTFIX``
  97. * new targets:
  98. * ``Python::InterpreterDebug``
  99. * ``Python::InterpreterMultiConfig``
  100. The ``python_add_library()`` command now manages the
  101. :prop_tgt:`DEBUG_POSTFIX` target property based on the value
  102. of the ``Python_DEBUG_POSTFIX`` variable.
  103. Generator Expressions
  104. ---------------------
  105. * The :genex:`<LANG>_COMPILER_FRONTEND_VARIANT <C_COMPILER_FRONTEND_VARIANT>`
  106. family of generator expressions were added to access the value of the
  107. associated :variable:`CMAKE_<LANG>_COMPILER_FRONTEND_VARIANT` variables.
  108. * Link features, as used with the :genex:`LINK_LIBRARY` generator expression,
  109. gained the ability to have attributes that describe their behavior by
  110. specifying the :variable:`CMAKE_LINK_LIBRARY_<FEATURE>_ATTRIBUTES` or
  111. :variable:`CMAKE_<LANG>_LINK_LIBRARY_<FEATURE>_ATTRIBUTES` variables.
  112. * The :genex:`QUOTE` generator expression was added to evaluate to ``"``.
  113. * The :genex:`TARGET_PROPERTY` generator expression learned to evaluate
  114. :ref:`custom transitive properties <Custom Transitive Properties>`
  115. defined by new :prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES` and
  116. :prop_tgt:`TRANSITIVE_LINK_PROPERTIES` target properties.
  117. * The :genex:`TARGET_PROPERTY` generator expression now evaluates target
  118. properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
  119. :prop_tgt:`INTERFACE_LINK_DIRECTORIES`, and
  120. :prop_tgt:`INTERFACE_LINK_DEPENDS` correctly by following private
  121. dependencies of static libraries. See policy :policy:`CMP0166`.
  122. CTest
  123. -----
  124. * The :command:`ctest_submit` command and :option:`ctest -T Submit <ctest -T>`
  125. step gained ``TLSVersion`` and ``TLSVerify`` options to control negotiation
  126. with ``https://`` URLs. See the :variable:`CTEST_TLS_VERSION` and
  127. :variable:`CTEST_TLS_VERIFY` variables.
  128. CPack
  129. -----
  130. * The :cpack_gen:`CPack Inno Setup Generator` is now available
  131. on non-Windows hosts.
  132. * The :cpack_gen:`CPack NuGet Generator` gained the
  133. :variable:`CPACK_NUGET_PACKAGE_README`,
  134. :variable:`CPACK_NUGET_PACKAGE_REPOSITORY_URL`,
  135. :variable:`CPACK_NUGET_PACKAGE_REPOSITORY_TYPE`,
  136. :variable:`CPACK_NUGET_PACKAGE_REPOSITORY_BRANCH`, and
  137. :variable:`CPACK_NUGET_PACKAGE_REPOSITORY_COMMIT` variables.
  138. * The :cpack_gen:`CPack NuGet Generator` can now generate dependency groups
  139. for framework-specific dependencies. The :variable:`CPACK_NUGET_PACKAGE_TFMS`
  140. variable was added to specify a list of target framework monikers (TFMs)
  141. for which groups should be generated.
  142. * The :cpack_gen:`CPack WIX Generator` gained support for WiX Toolset v4.
  143. See the :variable:`CPACK_WIX_VERSION` variable.
  144. Deprecated and Removed Features
  145. ===============================
  146. * The :module:`FindBoost` module has been removed by policy :policy:`CMP0167`.
  147. Port projects to upstream Boost's ``BoostConfig.cmake`` package
  148. configuration file, for which ``find_package(Boost)`` now searches.
  149. * Calling :command:`FetchContent_Populate` with just the name of a
  150. dependency is now deprecated. Projects should call
  151. :command:`FetchContent_MakeAvailable` instead. See policy :policy:`CMP0169`.
  152. Calling :command:`FetchContent_Populate` with full population details
  153. rather than just a dependency name remains fully supported.
  154. * The :generator:`Visual Studio 9 2008` generator has been removed.
  155. Other Changes
  156. =============
  157. * The precompiled Windows ``.msi`` installers provided on
  158. `cmake.org <https://cmake.org/download/>`_, when performing a fresh
  159. installation, now modify the system-wide ``PATH`` by default.
  160. When replacing an existing installation of 3.30 or later, the ``PATH``
  161. modification preference is preserved by default.
  162. * The official ``.zip`` source archive provided on
  163. `cmake.org <https://cmake.org/download/>`_ now uses LF newlines,
  164. instead of CRLF newlines, for consistency with modern conventions.
  165. * The durations printed after "Configuring done" and "Generating done"
  166. messages now reflect time spent in generator-specific steps, and
  167. in a code model evaluation step at the beginning of generation that
  168. was not previously captured. Printed durations may appear longer
  169. than in previous versions of CMake, but are more accurate.
  170. * :module:`FetchContent` now prefers to populate content directly rather
  171. than using a separate sub-build. This may significantly improve configure
  172. times on some systems (Windows especially, but also on macOS when using
  173. the Xcode generator). :option:`cmake --fresh` also forces the download,
  174. update, and patch steps of directly populated dependencies to be re-executed.
  175. Policy :policy:`CMP0168` provides backward compatibility for those projects
  176. that still rely on using a sub-build for content population.
  177. * When :variable:`FETCHCONTENT_FULLY_DISCONNECTED` is set to true,
  178. :command:`FetchContent_MakeAvailable` and the single-argument form of
  179. :command:`FetchContent_Populate` require that the dependency's source
  180. directory has already been populated. CMake 3.29 and earlier did not
  181. check this requirement, but it is now enforced, subject to policy
  182. :policy:`CMP0170`.
  183. Updates
  184. =======
  185. Changes made since CMake 3.30.0 include the following.
  186. 3.30.1, 3.30.2
  187. --------------
  188. * These versions made no changes to documented features or interfaces.
  189. Some implementation updates were made to support ecosystem changes
  190. and/or fix regressions.
  191. .. 3.30.3 (unreleased)
  192. * The :module:`FindPython` and :module:`FindPython3` modules now define,
  193. respectively, the ``Python_DEFINITIONS`` and ``Python3_DEFINITIONS``
  194. variables on Windows to support development with the free threaded
  195. version of Python. The :prop_tgt:`INTERFACE_COMPILE_DEFINITIONS` target
  196. property is also defined for the various targets provided by these modules.