3.30.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. * :manual:`ctest(1)` now rejects unknown command-line arguments with an error.
  158. Previously they were silently ignored.
  159. * The precompiled Windows ``.msi`` installers provided on
  160. `cmake.org <https://cmake.org/download/>`_, when performing a fresh
  161. installation, now modify the system-wide ``PATH`` by default.
  162. When replacing an existing installation of 3.30 or later, the ``PATH``
  163. modification preference is preserved by default.
  164. * The official ``.zip`` source archive provided on
  165. `cmake.org <https://cmake.org/download/>`_ now uses LF newlines,
  166. instead of CRLF newlines, for consistency with modern conventions.
  167. * The durations printed after "Configuring done" and "Generating done"
  168. messages now reflect time spent in generator-specific steps, and
  169. in a code model evaluation step at the beginning of generation that
  170. was not previously captured. Printed durations may appear longer
  171. than in previous versions of CMake, but are more accurate.
  172. * :module:`FetchContent` now prefers to populate content directly rather
  173. than using a separate sub-build. This may significantly improve configure
  174. times on some systems (Windows especially, but also on macOS when using
  175. the Xcode generator). :option:`cmake --fresh` also forces the download,
  176. update, and patch steps of directly populated dependencies to be re-executed.
  177. Policy :policy:`CMP0168` provides backward compatibility for those projects
  178. that still rely on using a sub-build for content population.
  179. * When :variable:`FETCHCONTENT_FULLY_DISCONNECTED` is set to true,
  180. :command:`FetchContent_MakeAvailable` and the single-argument form of
  181. :command:`FetchContent_Populate` require that the dependency's source
  182. directory has already been populated. CMake 3.29 and earlier did not
  183. check this requirement, but it is now enforced, subject to policy
  184. :policy:`CMP0170`.
  185. Updates
  186. =======
  187. Changes made since CMake 3.30.0 include the following.
  188. 3.30.1, 3.30.2
  189. --------------
  190. * These versions made no changes to documented features or interfaces.
  191. Some implementation updates were made to support ecosystem changes
  192. and/or fix regressions.
  193. 3.30.3
  194. ------
  195. * The :command:`project(<PROJECT-NAME>)` command now sets
  196. :variable:`<PROJECT-NAME>_SOURCE_DIR`, :variable:`<PROJECT-NAME>_BINARY_DIR`,
  197. and :variable:`<PROJECT-NAME>_IS_TOP_LEVEL` as normal variables in addition
  198. to setting them as cache entries. This is needed to preserve support for
  199. some :module:`FetchContent` use cases under policy :policy:`CMP0169`'s
  200. NEW behavior.
  201. * The :module:`FindPython` and :module:`FindPython3` modules now define,
  202. respectively, the ``Python_DEFINITIONS`` and ``Python3_DEFINITIONS``
  203. variables on Windows to support development with the free threaded
  204. version of Python. The :prop_tgt:`INTERFACE_COMPILE_DEFINITIONS` target
  205. property is also defined for the various targets provided by these modules.
  206. 3.30.4
  207. ------
  208. * The :command:`project(<PROJECT-NAME>)` command now sets
  209. :variable:`<PROJECT-NAME>_SOURCE_DIR`, :variable:`<PROJECT-NAME>_BINARY_DIR`,
  210. and :variable:`<PROJECT-NAME>_IS_TOP_LEVEL` as normal variables only if they
  211. are already set as cache or non-cache variables when :command:`project` is
  212. invoked. Cache entries by the same names are always set as before.
  213. This refines 3.30.3's behavior change to restore behavior of nested
  214. directories that call :command:`project` with the same project name,
  215. but the implementation in this release is flawed (this release note has
  216. been retroactively updated). It can result in different behavior between
  217. the first and subsequent runs. Do not use CMake 3.30.4 if your project
  218. contains nested calls to :command:`project` with the same project name
  219. and you use these variables.
  220. 3.30.5
  221. ------
  222. * The :command:`project(<PROJECT-NAME>)` command now sets
  223. :variable:`<PROJECT-NAME>_SOURCE_DIR`, :variable:`<PROJECT-NAME>_BINARY_DIR`,
  224. and :variable:`<PROJECT-NAME>_IS_TOP_LEVEL` as non-cache variables only if
  225. they are already set as non-cache variables when :command:`project` is
  226. invoked. Cache entries by the same names are always set as before.
  227. This refines 3.30.3's behavior change to restore behavior of nested
  228. directories that call :command:`project` with the same project name,
  229. and it addresses the bug in the implementation introduced in 3.30.4.
  230. 3.30.6
  231. ------
  232. * This version made no changes to documented features or interfaces.
  233. Some implementation updates were made to support ecosystem changes
  234. and/or fix regressions.