3.23.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. CMake 3.23 Release Notes
  2. ************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.22 include the following.
  6. New Features
  7. ============
  8. Presets
  9. -------
  10. * :manual:`cmake-presets(7)` files now support schema version ``4``.
  11. * :manual:`cmake-presets(7)` files now have an optional ``include`` field,
  12. which allows the files to include other files.
  13. * :manual:`cmake-presets(7)` files now support a ``${fileDir}`` macro, which
  14. contains the directory containing the preset file.
  15. * :manual:`cmake-presets(7)` gained support for specifying the
  16. ``resolvePackageReferences`` command line option in a build preset to control
  17. restoration behavior of package references from external package managers.
  18. Currently this is only supported by the Visual Studio generator to support
  19. restoring packages from NuGet. Other generators ignore this option.
  20. Generators
  21. ----------
  22. * The :ref:`Visual Studio Generators` for VS 2019 and above learned to
  23. support .NET SDK-style project files (``.csproj``) for C# projects.
  24. See the :prop_tgt:`DOTNET_SDK` target property and corresponding
  25. :variable:`CMAKE_DOTNET_SDK` variable. :command:`add_custom_command`
  26. is not yet supported in .NET SDK-style projects.
  27. * The :ref:`Visual Studio Generators` for VS 2017 and above learned to
  28. use portable instances of Visual Studio not known to the VS installer.
  29. See the :variable:`CMAKE_GENERATOR_INSTANCE` variable.
  30. Command-Line
  31. ------------
  32. * The :manual:`cmake(1)` :option:`--build <cmake --build>` command, when used with
  33. :ref:`Visual Studio Generators` on projects that set the
  34. :prop_tgt:`VS_PACKAGE_REFERENCES` target property, now automatically
  35. restores package references from NuGet. The cache variable
  36. :variable:`CMAKE_VS_NUGET_PACKAGE_RESTORE` may be set to toggle this behavior
  37. in a build tree. Use the
  38. :option:`--resolve-package-references <cmake--build --resolve-package-references>`
  39. command-line option to control the behavior on one invocation.
  40. * The :manual:`cmake(1)` command line tool gained a
  41. :option:`--debug-find-pkg <cmake --debug-find-pkg>`
  42. option to enable debug messages under specific :command:`find_package`
  43. calls.
  44. * The :manual:`cmake(1)` command line tool gained a
  45. :option:`--debug-find-var <cmake --debug-find-var>`
  46. option to enable debug messages for ``find_*`` calls that use specific
  47. result variables.
  48. Compilers
  49. ---------
  50. * The IBM Open XL C/C++ compiler, based on LLVM, is now supported with
  51. compiler id ``IBMClang``.
  52. * The MCST LCC compiler is now supported with compiler id ``LCC``.
  53. See policy :policy:`CMP0129`.
  54. File-Based API
  55. --------------
  56. * The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field
  57. has been updated to ``2.4``.
  58. * The :manual:`cmake-file-api(7)` "codemodel" version 2 ``directory``
  59. object ``installers`` field gained a new ``fileSet`` installer type
  60. and associated ``fileSetName``, ``fileSetType``, ``fileSetDirectories``,
  61. and ``fileSetTarget`` fields.
  62. Commands
  63. --------
  64. * The :command:`define_property` command gained a new
  65. ``INITIALIZE_FROM_VARIABLE`` option to cause a target property to be
  66. initialized from a variable when a target is created.
  67. * The :command:`install(TARGETS)` command gained a new ``FILE_SET`` argument,
  68. which can be used to install header file sets associated with a target.
  69. * The :command:`string(TIMESTAMP)` and :command:`file(TIMESTAMP)` commands now
  70. support the ``%f`` specifier for microseconds.
  71. * The :command:`target_sources` command gained a new ``FILE_SET`` mode, which
  72. can be used to add headers as header-only source files of a target.
  73. Variables
  74. ---------
  75. * The :variable:`CMAKE_CUDA_ARCHITECTURES` variable and associated
  76. :prop_tgt:`CUDA_ARCHITECTURES` target property now support the
  77. ``all``, and ``all-major`` values for CUDA toolkit 7.0+.
  78. * The :variable:`CMAKE_IGNORE_PREFIX_PATH` and
  79. :variable:`CMAKE_SYSTEM_IGNORE_PREFIX_PATH` variables were added
  80. to tell the :command:`find_package`, :command:`find_program`,
  81. :command:`find_library`, :command:`find_path`, and :command:`find_file`
  82. commands to ignore specified prefixes.
  83. * The :variable:`CMAKE_LINK_LIBRARIES_ONLY_TARGETS` variable and
  84. corresponding :prop_tgt:`LINK_LIBRARIES_ONLY_TARGETS` target
  85. property were added to optionally require that all link items
  86. that can be target names are actually names of existing targets.
  87. Properties
  88. ----------
  89. * The :prop_tgt:`HEADER_SETS` and :prop_tgt:`INTERFACE_HEADER_SETS` read-only
  90. target properties were added to list header sets associated with a target.
  91. * The :prop_tgt:`HEADER_SET` and :prop_tgt:`HEADER_SET_<NAME>` target
  92. properties were added to list files in the default header set
  93. and named header sets, respectively.
  94. * The :prop_tgt:`HEADER_DIRS` and :prop_tgt:`HEADER_DIRS_<NAME>` target
  95. properties were added to specify the base directories of the default
  96. header set and named header sets, respectively.
  97. * The :prop_tgt:`IMPORTED_NO_SYSTEM` target property was added to
  98. specify that an :ref:`Imported Target <Imported Targets>` should
  99. not be treated as a system library (i.e. its include directories
  100. are not automatically ``SYSTEM``).
  101. * The :prop_tgt:`XCODE_EMBED_PLUGINS <XCODE_EMBED_<type>>` target property
  102. was added to tell the :generator:`Xcode` generator what targets to put in
  103. the ``Embed PlugIns`` build phase.
  104. * The :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE` target property
  105. and supporting :variable:`CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE`
  106. variable were added to tell the :generator:`Xcode` generator to enable
  107. specifying the Xcode scheme option property ``GPU Frame Capture``.
  108. Modules
  109. -------
  110. * The :module:`CheckPIESupported` module now supports the ``OBJC``,
  111. ``OBJCXX``, ``CUDA``, and ``HIP`` languages. It also now honors
  112. :variable:`CMAKE_SYSROOT` and :variable:`CMAKE_OSX_SYSROOT`.
  113. * The :module:`ExternalProject` module's :command:`ExternalProject_Add`
  114. command gained support for a ``USES_TERMINAL_PATCH`` option to give
  115. the patch step exclusive terminal access.
  116. * The :module:`FindCUDAToolkit` module now provides a target for
  117. ``libcufft_static_nocallback``, if found.
  118. * The :module:`FindGLUT` module now provides the ``GLUT_INCLUDE_DIRS``
  119. result variable to conform with naming conventions documented in the
  120. :manual:`cmake-developer(7)` manual. This supersedes the legacy
  121. ``GLUT_INCLUDE_DIR`` variable.
  122. * The :module:`FindGTest` module now provides a target for GMock, if found.
  123. * The :module:`FindVulkan` module now provides a ``Vulkan_VERSION`` result
  124. variable reporting the version number.
  125. CTest
  126. -----
  127. * :manual:`ctest(1)` gained a new :variable:`CTEST_SUBMIT_INACTIVITY_TIMEOUT`
  128. variable, which can be used to specify a timeout for submission inactivity.
  129. CPack
  130. -----
  131. * The :cpack_gen:`CPack productbuild Generator` gained the new
  132. :variable:`CPACK_PRODUCTBUILD_DOMAINS`,
  133. :variable:`CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE`,
  134. :variable:`CPACK_PRODUCTBUILD_DOMAINS_USER`, and
  135. :variable:`CPACK_PRODUCTBUILD_DOMAINS_ROOT` variables for
  136. adding the domains element to the Distribution XML. With these variables,
  137. it is now possible to install products to the user's home directory
  138. without requiring administrative privileges.
  139. * The :cpack_gen:`CPack productbuild Generator` gained a new variable,
  140. :variable:`CPACK_PRODUCTBUILD_IDENTIFIER`, used to customize the unique
  141. product identifier associated with the product.
  142. * The ``CPack.distribution.dist.in`` template used by the
  143. :cpack_gen:`CPack productbuild Generator` and
  144. CPack ``PackageMaker`` generator was updated to use a new
  145. ``CPACK_APPLE_PKG_INSTALLER_CONTENT`` variable for its main content.
  146. This replaced the previously undocumented and now deprecated
  147. ``CPACK_PACKAGEMAKER_CHOICES`` variable.
  148. * The :cpack_gen:`CPack IFW Generator` gained the new
  149. :variable:`CPACK_IFW_ARCHIVE_FORMAT` and
  150. :variable:`CPACK_IFW_ARCHIVE_COMPRESSION` variables for setting the
  151. format used when packaging new component data archives, and choosing
  152. the compression level used.
  153. These features are available for QtIFW 4.2 and newer.
  154. * The :cpack_gen:`CPack IFW Generator` gained new
  155. :variable:`CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE` variable to
  156. prevent the user from passing any consumer command to the installer, like
  157. ``install``, ``update``, and ``remove``.
  158. This feature is available for QtIFW 4.0 and newer.
  159. * The :cpack_gen:`CPack IFW Generator` gained the new
  160. :variable:`CPACK_IFW_PACKAGE_PRODUCT_IMAGES` variable for adding a
  161. list of images to be shown on the ``PerformInstallationPage``.
  162. This feature is available for QtIFW 4.0 and newer.
  163. * The :cpack_gen:`CPack IFW Generator` gained the new
  164. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM`,
  165. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS`, and
  166. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION` variables for
  167. executing a command after the installer is done if the user accepts
  168. the action. This feature is available for QtIFW 4.0 and newer.
  169. * The :cpack_gen:`CPack IFW Generator` gained the new
  170. :variable:`CPACK_IFW_PACKAGE_SIGNING_IDENTITY` variable for specifying a
  171. code signing identity to be used for signing the generated app bundle.
  172. This feature is available on macOS only, and for QtIFW 3.0 and newer.
  173. * The :cpack_gen:`CPack WIX Generator` gained a new variable,
  174. :variable:`CPACK_WIX_SKIP_WIX_UI_EXTENSION`, to skip the inclusion
  175. of WixUIExtensions.
  176. Deprecated and Removed Features
  177. ===============================
  178. * :manual:`cmake(1)` now warns when multiple source paths are specified,
  179. as in ``cmake -S src1 src2``. This has never been officially documented
  180. or supported, but older versions accidentally accepted multiple source
  181. paths and used the last path specified. Update scripts to avoid
  182. passing multiple source path arguments.
  183. * The :manual:`cpack(1)` undocumented ``OSXX11`` generator has been removed.
  184. * The previously undocumented ``CPACK_PACKAGEMAKER_CHOICES`` variable used in
  185. the ``CPack.distribution.dist.in`` template has been replaced by a new
  186. ``CPACK_APPLE_PKG_INSTALLER_CONTENT`` variable. This only affects projects
  187. that were providing their own custom ``CPack.distribution.dist.in`` template
  188. file, but still relied on ``CPACK_PACKAGEMAKER_CHOICES`` being set. Those
  189. custom template files should be updated to use
  190. ``CPACK_APPLE_PKG_INSTALLER_CONTENT`` instead, or to fully define all the
  191. template file's contents without relying on substitution of either variable.
  192. Other Changes
  193. =============
  194. * The :cpack_gen:`CPack DragNDrop Generator` no longer attaches
  195. :variable:`CPACK_RESOURCE_FILE_LICENSE` as the license agreement in
  196. the generated ``.dmg`` unless explicitly activated by a
  197. :variable:`CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE` option.
  198. In CMake projects, the :module:`CPack` module enables the option
  199. by default for compatibility.
  200. * ``CUDA`` targets may now enable both :prop_tgt:`CUDA_SEPARABLE_COMPILATION`
  201. and :prop_tgt:`CUDA_PTX_COMPILATION`.
  202. * ``CUDA`` compiler detection now:
  203. * issues an error in all cases when it's unable to compute the default
  204. architecture(s) if required (see :policy:`CMP0104`),
  205. * handles ``OFF`` for :variable:`CMAKE_CUDA_ARCHITECTURES` on Clang,
  206. * supports the theoretical case of multiple default architectures, and
  207. * tries to detect invalid architectures and issue an error.
  208. * ``CUDA`` with Clang now implements policy :policy:`CMP0105` and
  209. the :genex:`$<DEVICE_LINK:...>` and :genex:`$<HOST_LINK:...>`
  210. generator expressions.
  211. * The :command:`define_property` command's ``BRIEF_DOCS`` and ``FULL_DOCS``
  212. arguments are now optional.
  213. * :manual:`ccmake(1)` may now be enabled on Windows when building
  214. CMake from source. This is experimental, and so is not included
  215. in official distributions.
  216. Updates
  217. =======
  218. Changes made since CMake 3.23.0 include the following.
  219. 3.23.1
  220. ------
  221. * The :command:`target_sources` ``FILE_SET`` feature added in CMake 3.23.0
  222. does not yet place header files properly in Apple :prop_tgt:`FRAMEWORK`
  223. targets. Pending further work in a future version of CMake, it is now
  224. an error to add a ``FILE_SET`` of type ``HEADERS`` to such targets on
  225. Apple platforms.
  226. * The :prop_tgt:`HEADER_SETS` and :prop_tgt:`INTERFACE_HEADER_SETS` target
  227. properties added in CMake 3.23.0 are now read-only records of the header
  228. sets created by the :command:`target_sources` command.
  229. 3.23.2
  230. ------
  231. * The ``CPACK_PACKAGEMAKER_CHOICES`` variable used in the
  232. ``CPack.distribution.dist.in`` template file was replaced by a new
  233. ``CPACK_APPLE_PKG_INSTALLER_CONTENT`` variable in CMake 3.23.0.
  234. This broke projects that provided their own template file but still
  235. expected the ``CPACK_PACKAGEMAKER_CHOICES`` variable to be defined.
  236. The old ``CPACK_PACKAGEMAKER_CHOICES`` variable is now also set to the
  237. same content as it was before, but it is formally deprecated.
  238. 3.23.3, 3.23.4, 3.23.5
  239. ----------------------
  240. * These versions made no changes to documented features or interfaces.
  241. Some implementation updates were made to support ecosystem changes
  242. and/or fix regressions.