3.24.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. CMake 3.24 Release Notes
  2. ************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.23 include the following.
  6. New Features
  7. ============
  8. Presets
  9. -------
  10. * :manual:`cmake-presets(7)` files now support schema version ``5``.
  11. * :manual:`cmake-presets(7)` files now support a ``${pathListSep}`` macro,
  12. which expands to ``:`` or ``;`` based on the platform.
  13. * :manual:`cmake-presets(7)` files gained support for specifying a
  14. ``testOutputTruncation`` field in test presets, which specifies the
  15. truncation mode once the maximum test output size has been reached.
  16. Generators
  17. ----------
  18. * The :generator:`Green Hills MULTI` generator now generates build
  19. rules to re-run CMake if any CMake files are updated.
  20. * The :ref:`Visual Studio Generators` now support ``SYSTEM`` headers
  21. when using VS 2019 Update 11 or later.
  22. Command-Line
  23. ------------
  24. * :manual:`cmake(1)` gained the :option:`--fresh <cmake --fresh>` command-line
  25. option to remove any existing ``CMakeCache.txt`` file and associated ``CMakeFiles/``
  26. directory, when configuring a build tree, thus starting a new configuration
  27. as if the build tree were freshly created.
  28. * :manual:`cmake(1)` gained the
  29. :option:`--compile-no-warning-as-error <cmake --compile-no-warning-as-error>`
  30. command-line option which causes the effects of the
  31. :prop_tgt:`COMPILE_WARNING_AS_ERROR` target property and
  32. :variable:`CMAKE_COMPILE_WARNING_AS_ERROR` variable to be ignored.
  33. * The :manual:`cmake(1)` :option:`--trace=json-v1 <cmake --trace>` trace
  34. format gained fields ``global_frame`` and ``line_end``.
  35. * The :manual:`cmake(1)` :option:`-E <cmake -E>` commands :option:`cat <cmake-E cat>`
  36. and :option:`env <cmake-E env>` learned to respect a double dash
  37. (:option:`-- <cmake-E_env -->`) argument that acts as a delimiter indicating
  38. the end of options. Any following arguments are treated as operands/positional
  39. arguments, even if they begin with a dash ``-`` character.
  40. * The :manual:`cmake(1)` :option:`-E tar <cmake-E tar>` command gained the
  41. :option:`--touch <cmake-E_tar --touch>` option
  42. to keep the current local timestamp instead of extracting file timestamps
  43. from the archive.
  44. Compilers
  45. ---------
  46. * LLVM's `flang`_ Fortran compiler is now supported on some platforms,
  47. with compiler id ``LLVMFlang``.
  48. .. _`flang`: https://github.com/llvm/llvm-project/tree/main/flang
  49. * ADSP compiler support (SHARC and Blackfin) now covers both CCES and
  50. VDSP++ installations, with required configuration now done in the
  51. compiler module itself rather than the ``Generic-ADSP`` platform module.
  52. Platforms
  53. ---------
  54. * A dedicated ``ADSP`` platform has been added
  55. to replace the existing ``Generic-ADSP`` implementation.
  56. This features automatic detection of the latest CCES/VDSP++ install
  57. and compiler selection (``cc21k`` vs. ``ccblkfn``)
  58. based off of the :variable:`CMAKE_SYSTEM_PROCESSOR` variable.
  59. Commands
  60. --------
  61. * The :command:`cmake_host_system_information` command, on Windows,
  62. gained a ``QUERY WINDOWS_REGISTRY`` mode.
  63. See its :ref:`Query Windows registry` section.
  64. * The :command:`cmake_language` command gained a new
  65. ``SET_DEPENDENCY_PROVIDER`` sub-command. When a dependency provider is set,
  66. calls to :command:`find_package` and :command:`FetchContent_MakeAvailable`
  67. can be redirected through a custom command, which can choose to fulfill the
  68. request directly, modify how the request is processed, or leave it to be
  69. fulfilled by the built-in implementation. See :ref:`dependency_providers`.
  70. * The :command:`file(DOWNLOAD)` command gained options ``RANGE_START`` and
  71. ``RANGE_END`` to specify a range of bytes to download. This can be
  72. useful for downloading parts of big binary files.
  73. * The :command:`find_file`, :command:`find_path`, :command:`find_library`,
  74. :command:`find_program`, and :command:`find_package` commands gained the
  75. ``NO_CMAKE_INSTALL_PREFIX`` option to control searching
  76. :variable:`CMAKE_INSTALL_PREFIX`.
  77. * The :command:`find_file`, :command:`find_path`, :command:`find_library`,
  78. :command:`find_program`, and :command:`find_package` commands gained the
  79. ability to specify which Windows Registry views must be queried.
  80. * The :command:`find_package` command gained a ``GLOBAL`` option that
  81. allows for the promotion of imported targets to global scope for the
  82. duration of the :command:`find_package` call.
  83. * The :command:`if` command gained the capability to compare paths by
  84. using the ``PATH_EQUAL`` operator. See policy :policy:`CMP0139`.
  85. Variables
  86. ---------
  87. * The :variable:`CMAKE_COLOR_DIAGNOSTICS` variable was added to control
  88. color diagnostics generated by compilers. This variable also controls
  89. color build system messages with :ref:`Makefile Generators`, replacing
  90. :variable:`CMAKE_COLOR_MAKEFILE`.
  91. The :envvar:`CMAKE_COLOR_DIAGNOSTICS` environment variable was added to set
  92. a default value for :variable:`CMAKE_COLOR_DIAGNOSTICS`.
  93. * The :variable:`CMAKE_COMPILE_WARNING_AS_ERROR` variable and corresponding
  94. :prop_tgt:`COMPILE_WARNING_AS_ERROR` target property were added to enable
  95. compilation with a compiler-specific flag to treat warnings as errors,
  96. such as ``-Werror``.
  97. * The :variable:`CMAKE_CUDA_ARCHITECTURES` variable and associated
  98. :prop_tgt:`CUDA_ARCHITECTURES` target property now support the
  99. special ``native`` value to compile for the architectures(s)
  100. of the host's GPU(s).
  101. * The :variable:`CMAKE_FIND_PACKAGE_TARGETS_GLOBAL` variable was added to
  102. toggle behavior of the :command:`find_package` command's new ``GLOBAL``
  103. option.
  104. * The :variable:`CMAKE_FIND_USE_INSTALL_PREFIX` variable was added to toggle
  105. behavior of the :command:`find_file`, :command:`find_library`,
  106. :command:`find_path`, :command:`find_package`, and :command:`find_program`
  107. commands' new ``NO_CMAKE_INSTALL_PREFIX`` option.
  108. * The :variable:`CMAKE_PROJECT_TOP_LEVEL_INCLUDES` variable was added to allow
  109. injecting custom code at the site of the first :command:`project` call,
  110. after the host and target platform details have been determined.
  111. * The :variable:`CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable
  112. was added to tell the :command:`try_compile` command not to
  113. pass any platform variables to the test project.
  114. * The :variable:`CMAKE_VERIFY_INTERFACE_HEADER_SETS` variable and
  115. corresponding :prop_tgt:`VERIFY_INTERFACE_HEADER_SETS` target property
  116. were added to enable build rules that verify all headers in header sets
  117. can be used on their own.
  118. * The :variable:`CMAKE_VS_NO_COMPILE_BATCHING` variable and corresponding
  119. :prop_tgt:`VS_NO_COMPILE_BATCHING` target property were added to
  120. tell :ref:`Visual Studio Generators` whether to disable compiler
  121. parallelism and call the compiler with one source file at a time.
  122. * The :variable:`CMAKE_WATCOM_RUNTIME_LIBRARY` variable and
  123. :prop_tgt:`WATCOM_RUNTIME_LIBRARY` target property were introduced to
  124. select the runtime library used by compilers targeting the Watcom ABI.
  125. See policy :policy:`CMP0136`.
  126. * The :variable:`CMAKE_XCODE_XCCONFIG` variable and corresponding
  127. :prop_tgt:`XCODE_XCCONFIG` target property were added to tell
  128. the :generator:`Xcode` generator to handle ``xcconfig`` files.
  129. Properties
  130. ----------
  131. * The :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` and
  132. :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE` target properties
  133. were added to express usage requirements affecting a consumer's
  134. direct link dependencies.
  135. * The :prop_tgt:`INTERFACE_HEADER_SETS_TO_VERIFY` target property was
  136. added to specify which header sets should be verified by
  137. :prop_tgt:`VERIFY_INTERFACE_HEADER_SETS`.
  138. * The :prop_tgt:`LINK_LIBRARIES` target property now supports
  139. the :genex:`$<LINK_ONLY:...>` generator expression.
  140. See policy :policy:`CMP0131`.
  141. * The :prop_tgt:`VS_DOTNET_STARTUP_OBJECT` target property was added to
  142. tell :ref:`Visual Studio Generators` which startup class shall be used
  143. when the program or project is executed. This is necessary when more
  144. than one ``static void Main(string[])`` function signature is available
  145. in a managed .NET project.
  146. Modules
  147. -------
  148. * The :module:`ExternalProject` module :command:`ExternalProject_Add`
  149. command gained a new ``DOWNLOAD_EXTRACT_TIMESTAMP`` option for
  150. controlling whether the timestamps of extracted contents are set to
  151. match those in the archive when the ``URL`` download method is used.
  152. Policy :policy:`CMP0135` was added to enable the option by default.
  153. * The :module:`FetchContent` module and the :command:`find_package` command
  154. now support integration capabilities:
  155. * :command:`FetchContent_MakeAvailable` can now try to satisfy a dependency
  156. by calling :command:`find_package` first. A new
  157. :variable:`FETCHCONTENT_TRY_FIND_PACKAGE_MODE` variable controls whether
  158. this is done by default for all dependencies, is opt-in per dependency,
  159. or is disabled entirely.
  160. * :command:`find_package` can be re-routed to call
  161. :command:`FetchContent_MakeAvailable` instead. A new read-only
  162. :variable:`CMAKE_FIND_PACKAGE_REDIRECTS_DIR` variable points to a
  163. directory where config package files can be located to facilitate these
  164. re-routed calls.
  165. * The :module:`FindJNI` module now provides imported targets.
  166. * The :module:`FindMatlab` module :command:`matlab_add_mex` function
  167. gained a ``NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES`` option to disable
  168. automatic linking of MATLAB libraries.
  169. * The :module:`FindVulkan` module now supports components to select which
  170. VulkanSDK tool and libraries to find in addition to the Vulkan SDK headers
  171. and library.
  172. * The :module:`FindZLIB` gained a new ``ZLIB_USE_STATIC_LIBS`` variable to
  173. search only for static libraries.
  174. Generator Expressions
  175. ---------------------
  176. * The :genex:`LINK_LIBRARY` generator expression was added to manage how
  177. libraries are specified during the link step.
  178. The :variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>` and
  179. :variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>` variables are used to define
  180. features usable by the :genex:`LINK_LIBRARY` generator expression.
  181. Moreover, the :prop_tgt:`LINK_LIBRARY_OVERRIDE` and
  182. :prop_tgt:`LINK_LIBRARY_OVERRIDE_<LIBRARY>` target properties are
  183. available to resolve incompatible features.
  184. The :genex:`LINK_LIBRARY` generator expression can link frameworks in
  185. various ways when targeting ``Apple`` platforms.
  186. The following features were added:
  187. * ``FRAMEWORK``
  188. * ``NEEDED_FRAMEWORK``
  189. * ``REEXPORT_FRAMEWORK``
  190. * ``WEAK_FRAMEWORK``
  191. The :genex:`LINK_LIBRARY` generator expression can link libraries in
  192. various ways when targeting ``Apple`` platforms.
  193. The following features were added:
  194. * ``NEEDED_LIBRARY``
  195. * ``REEXPORT_LIBRARY``
  196. * ``WEAK_LIBRARY``
  197. The :genex:`LINK_LIBRARY` generator expression gained the feature
  198. ``WHOLE_ARCHIVE`` to force load of all members in a static library.
  199. This feature is supported on the following target platforms:
  200. * all ``Apple`` variants
  201. * ``Linux``
  202. * all ``BSD`` variants
  203. * ``SunOS``
  204. * ``Windows``
  205. * ``CYGWIN``
  206. * ``MSYS``
  207. * The :genex:`LINK_GROUP` generator expression was added to manage the
  208. grouping of libraries during the link step. The
  209. :variable:`CMAKE_<LANG>_LINK_GROUP_USING_<FEATURE>` and
  210. :variable:`CMAKE_LINK_GROUP_USING_<FEATURE>` variables are used to define
  211. features usable with the :genex:`LINK_GROUP` generator expression.
  212. This release defines the ``RESCAN`` feature, which can be used to handle
  213. circular references among static libraries when using toolchains for
  214. Linux, BSD, SunOS and GNU toolchains for Windows.
  215. * The :genex:`PATH` generator expression was added to manage paths.
  216. * The :genex:`PATH_EQUAL` generator expression was added to manage path
  217. comparisons.
  218. * The :genex:`TARGET_BUNDLE_DIR_NAME` generator expression
  219. was added to evaluate to the name of the bundle directory
  220. for a given bundle target.
  221. CTest
  222. -----
  223. * :manual:`ctest(1)` gained a
  224. :option:`--test-output-truncation <ctest --test-output-truncation>` option
  225. (and corresponding :variable:`CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variable)
  226. to specify the truncation mode once the maximum test output size has been
  227. reached. Possible values are ``tail`` (default), ``middle`` or ``head``.
  228. CPack
  229. -----
  230. * The :cpack_gen:`CPack WIX Generator` gained a new variable,
  231. :variable:`CPACK_WIX_ARCHITECTURE`, to specify the installer architecture
  232. in order to support computers running Windows for ARM.
  233. * CPack now supports the :variable:`CPACK_THREADS` option for ``zstd``
  234. compression when compiled with libarchive 3.6 or higher. It is
  235. supported by official CMake binaries available on `cmake.org`_.
  236. Deprecated and Removed Features
  237. ===============================
  238. * The :module:`CPack` module no longer enables the SLA by default in the
  239. :cpack_gen:`CPack DragNDrop Generator`. See policy :policy:`CMP0133`
  240. and the :variable:`CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE` variable.
  241. * The deprecated :cpack_gen:`CPack PackageMaker Generator` has been removed.
  242. * The :module:`FindGLUT` module no longer provides the undocumented
  243. ``GLUT_LIBRARY`` and ``GLUT_INCLUDE_PATH`` result variables.
  244. * The :module:`FindVulkan` module no longer silently ignores unknown
  245. components requested by a ``find_package(Vulkan REQUIRED ...)`` call.
  246. With the addition of support for components, requests for unknown
  247. components now produce an error.
  248. Other Changes
  249. =============
  250. * CMake no longer sets environment variables like :envvar:`CC`, :envvar:`CXX`,
  251. etc. when enabling the corresponding language during the first CMake run in
  252. a build directory. See policy :policy:`CMP0132`.
  253. * The :module:`CheckIPOSupported` module :command:`check_ipo_supported`
  254. command now uses the caller's :variable:`CMAKE_<LANG>_FLAGS`
  255. and :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` values.
  256. See policy :policy:`CMP0138`.
  257. * The :generator:`MSYS Makefiles` and :generator:`MinGW Makefiles`
  258. generators, when a compiler is not explicitly specified, now select
  259. the first compiler (of any name) found in directories listed by the
  260. ``PATH`` environment variable.
  261. * The :command:`try_compile` command
  262. :ref:`whole-project <Try Compiling Whole Projects>` signature
  263. now propagates platform variables. See policy :policy:`CMP0137`.
  264. * The :command:`while` command now diagnoses errors during condition
  265. evaluation. See policy :policy:`CMP0130`.
  266. * The precompiled macOS binaries provided on `cmake.org`_ no longer attach a
  267. SLA to the ``.dmg`` packages. This was removed because macOS 12 deprecated
  268. the tools used to attach ``.dmg`` resources.
  269. * A precompiled Windows ``arm64`` binary is now provided on `cmake.org`_.
  270. .. _`cmake.org`: https://cmake.org/download/
  271. Updates
  272. =======
  273. Changes made since CMake 3.24.0 include the following.
  274. 3.24.1, 3.24.2
  275. --------------
  276. * These versions made no changes to documented features or interfaces.
  277. Some implementation updates were made to support ecosystem changes
  278. and/or fix regressions.
  279. 3.24.3
  280. ------
  281. * The ``LLVMFlang`` Fortran compiler support added in 3.24.0 has been extended:
  282. * It now supports mixed-language linking between Fortran and C or CXX.
  283. * It now supports the GNU ABI (MinGW) on Windows, but not yet the MSVC ABI.
  284. * Some implementation updates were made to support ecosystem changes
  285. and/or fix regressions.
  286. 3.24.4
  287. ------
  288. * This version made no changes to documented features or interfaces.
  289. Some implementation updates were made to support ecosystem changes
  290. and/or fix regressions.