3.23.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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. Commands
  61. --------
  62. * The :command:`define_property` command gained a new
  63. ``INITIALIZE_FROM_VARIABLE`` option to cause a target property to be
  64. initialized from a variable when a target is created.
  65. * The :command:`install(TARGETS)` command gained a new ``FILE_SET`` argument,
  66. which can be used to install header file sets associated with a target.
  67. * The :command:`string(TIMESTAMP)` and :command:`file(TIMESTAMP)` commands now
  68. support the ``%f`` specifier for microseconds.
  69. * The :command:`target_sources` command gained a new ``FILE_SET`` mode, which
  70. can be used to add headers as header-only source files of a target.
  71. Variables
  72. ---------
  73. * The :variable:`CMAKE_CUDA_ARCHITECTURES` variable and associated
  74. :prop_tgt:`CUDA_ARCHITECTURES` target property now support the
  75. ``all``, and ``all-major`` values for CUDA toolkit 7.0+.
  76. * The :variable:`CMAKE_IGNORE_PREFIX_PATH` and
  77. :variable:`CMAKE_SYSTEM_IGNORE_PREFIX_PATH` variables were added
  78. to tell the :command:`find_package`, :command:`find_program`,
  79. :command:`find_library`, :command:`find_path`, and :command:`find_file`
  80. commands to ignore specified prefixes.
  81. * The :variable:`CMAKE_LINK_LIBRARIES_ONLY_TARGETS` variable and
  82. corresponding :prop_tgt:`LINK_LIBRARIES_ONLY_TARGETS` target
  83. property were added to optionally require that all link items
  84. that can be target names are actually names of existing targets.
  85. Properties
  86. ----------
  87. * The :prop_tgt:`HEADER_SETS` and :prop_tgt:`INTERFACE_HEADER_SETS` read-only
  88. target properties were added to list header sets associated with a target.
  89. * The :prop_tgt:`HEADER_SET` and :prop_tgt:`HEADER_SET_<NAME>` target
  90. properties were added to list files in the default header set
  91. and named header sets, respectively.
  92. * The :prop_tgt:`HEADER_DIRS` and :prop_tgt:`HEADER_DIRS_<NAME>` target
  93. properties were added to specify the base directories of the default
  94. header set and named header sets, respectively.
  95. * The :prop_tgt:`IMPORTED_NO_SYSTEM` target property was added to
  96. specify that an :ref:`Imported Target <Imported Targets>` should
  97. not be treated as a system library (i.e. its include directories
  98. are not automatically ``SYSTEM``).
  99. * The :prop_tgt:`XCODE_EMBED_PLUGINS <XCODE_EMBED_<type>>` target property
  100. was added to tell the :generator:`Xcode` generator what targets to put in
  101. the ``Embed PlugIns`` build phase.
  102. * The :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE` target property
  103. and supporting :variable:`CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE`
  104. variable were added to tell the :generator:`Xcode` generator to enable
  105. specifying the Xcode scheme option property ``GPU Frame Capture``.
  106. Modules
  107. -------
  108. * The :module:`CheckPIESupported` module now supports the ``OBJC``,
  109. ``OBJCXX``, ``CUDA``, and ``HIP`` languages. It also now honors
  110. :variable:`CMAKE_SYSROOT` and :variable:`CMAKE_OSX_SYSROOT`.
  111. * The :module:`ExternalProject` module's :command:`ExternalProject_Add`
  112. command gained support for a ``USES_TERMINAL_PATCH`` option to give
  113. the patch step exclusive terminal access.
  114. * The :module:`FindCUDAToolkit` module now provides a target for
  115. ``libcufft_static_nocallback``, if found.
  116. * The :module:`FindGLUT` module now provides the ``GLUT_INCLUDE_DIRS``
  117. result variable to conform with naming conventions documented in the
  118. :manual:`cmake-developer(7)` manual. This supersedes the legacy
  119. ``GLUT_INCLUDE_DIR`` variable.
  120. * The :module:`FindGTest` module now provides a target for GMock, if found.
  121. * The :module:`FindVulkan` module now provides a ``Vulkan_VERSION`` result
  122. variable reporting the version number.
  123. CTest
  124. -----
  125. * :manual:`ctest(1)` gained a new :variable:`CTEST_SUBMIT_INACTIVITY_TIMEOUT`
  126. variable, which can be used to specify a timeout for submission inactivity.
  127. CPack
  128. -----
  129. * The :cpack_gen:`CPack productbuild Generator` gained the new
  130. :variable:`CPACK_PRODUCTBUILD_DOMAINS`,
  131. :variable:`CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE`,
  132. :variable:`CPACK_PRODUCTBUILD_DOMAINS_USER`, and
  133. :variable:`CPACK_PRODUCTBUILD_DOMAINS_ROOT` variables for
  134. adding the domains element to the Distribution XML. With these variables,
  135. it is now possible to install products to the user's home directory
  136. without requiring administrative privileges.
  137. * The :cpack_gen:`CPack productbuild Generator` gained a new variable,
  138. :variable:`CPACK_PRODUCTBUILD_IDENTIFIER`, used to customize the unique
  139. product identifier associated with the product.
  140. * The ``CPack.distribution.dist.in`` template used by the
  141. :cpack_gen:`CPack productbuild Generator` and
  142. CPack ``PackageMaker`` generator was updated to use a new
  143. ``CPACK_APPLE_PKG_INSTALLER_CONTENT`` variable for its main content.
  144. This replaced the previously undocumented and now deprecated
  145. ``CPACK_PACKAGEMAKER_CHOICES`` variable.
  146. * The :cpack_gen:`CPack IFW Generator` gained the new
  147. :variable:`CPACK_IFW_ARCHIVE_FORMAT` and
  148. :variable:`CPACK_IFW_ARCHIVE_COMPRESSION` variables for setting the
  149. format used when packaging new component data archives, and choosing
  150. the compression level used.
  151. These features are available for QtIFW 4.2 and newer.
  152. * The :cpack_gen:`CPack IFW Generator` gained new
  153. :variable:`CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE` variable to
  154. prevent the user from passing any consumer command to the installer, like
  155. ``install``, ``update``, and ``remove``.
  156. This feature is available for QtIFW 4.0 and newer.
  157. * The :cpack_gen:`CPack IFW Generator` gained the new
  158. :variable:`CPACK_IFW_PACKAGE_PRODUCT_IMAGES` variable for adding a
  159. list of images to be shown on the ``PerformInstallationPage``.
  160. This feature is available for QtIFW 4.0 and newer.
  161. * The :cpack_gen:`CPack IFW Generator` gained the new
  162. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM`,
  163. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS`, and
  164. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION` variables for
  165. executing a command after the installer is done if the user accepts
  166. the action. This feature is available for QtIFW 4.0 and newer.
  167. * The :cpack_gen:`CPack IFW Generator` gained the new
  168. :variable:`CPACK_IFW_PACKAGE_SIGNING_IDENTITY` variable for specifying a
  169. code signing identity to be used for signing the generated app bundle.
  170. This feature is available on macOS only, and for QtIFW 3.0 and newer.
  171. * The :cpack_gen:`CPack WIX Generator` gained a new variable,
  172. :variable:`CPACK_WIX_SKIP_WIX_UI_EXTENSION`, to skip the inclusion
  173. of WixUIExtensions.
  174. Deprecated and Removed Features
  175. ===============================
  176. * :manual:`cmake(1)` now warns when multiple source paths are specified,
  177. as in ``cmake -S src1 src2``. This has never been officially documented
  178. or supported, but older versions accidentally accepted multiple source
  179. paths and used the last path specified. Update scripts to avoid
  180. passing multiple source path arguments.
  181. * The :manual:`cpack(1)` undocumented ``OSXX11`` generator has been removed.
  182. * The previously undocumented ``CPACK_PACKAGEMAKER_CHOICES`` variable used in
  183. the ``CPack.distribution.dist.in`` template has been replaced by a new
  184. ``CPACK_APPLE_PKG_INSTALLER_CONTENT`` variable. This only affects projects
  185. that were providing their own custom ``CPack.distribution.dist.in`` template
  186. file, but still relied on ``CPACK_PACKAGEMAKER_CHOICES`` being set. Those
  187. custom template files should be updated to use
  188. ``CPACK_APPLE_PKG_INSTALLER_CONTENT`` instead, or to fully define all the
  189. template file's contents without relying on substitution of either variable.
  190. Other Changes
  191. =============
  192. * The :cpack_gen:`CPack DragNDrop Generator` no longer attaches
  193. :variable:`CPACK_RESOURCE_FILE_LICENSE` as the license agreement in
  194. the generated ``.dmg`` unless explicitly activated by a
  195. :variable:`CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE` option.
  196. In CMake projects, the :module:`CPack` module enables the option
  197. by default for compatibility.
  198. * ``CUDA`` targets may now enable both :prop_tgt:`CUDA_SEPARABLE_COMPILATION`
  199. and :prop_tgt:`CUDA_PTX_COMPILATION`.
  200. * ``CUDA`` compiler detection now:
  201. * issues an error in all cases when it's unable to compute the default
  202. architecture(s) if required (see :policy:`CMP0104`),
  203. * handles ``OFF`` for :variable:`CMAKE_CUDA_ARCHITECTURES` on Clang,
  204. * supports the theoretical case of multiple default architectures, and
  205. * tries to detect invalid architectures and issue an error.
  206. * ``CUDA`` with Clang now implements policy :policy:`CMP0105` and
  207. the :genex:`$<DEVICE_LINK:...>` and :genex:`$<HOST_LINK:...>`
  208. generator expressions.
  209. * The :command:`define_property` command's ``BRIEF_DOCS`` and ``FULL_DOCS``
  210. arguments are now optional.
  211. * :manual:`ccmake(1)` may now be enabled on Windows when building
  212. CMake from source. This is experimental, and so is not included
  213. in official distributions.
  214. Updates
  215. =======
  216. Changes made since CMake 3.23.0 include the following.
  217. 3.23.1
  218. ------
  219. * The :command:`target_sources` ``FILE_SET`` feature added in CMake 3.23.0
  220. does not yet place header files properly in Apple :prop_tgt:`FRAMEWORK`
  221. targets. Pending further work in a future version of CMake, it is now
  222. an error to add a ``FILE_SET`` of type ``HEADERS`` to such targets on
  223. Apple platforms.
  224. * The :prop_tgt:`HEADER_SETS` and :prop_tgt:`INTERFACE_HEADER_SETS` target
  225. properties added in CMake 3.23.0 are now read-only records of the header
  226. sets created by the :command:`target_sources` command.
  227. 3.23.2
  228. ------
  229. * The ``CPACK_PACKAGEMAKER_CHOICES`` variable used in the
  230. ``CPack.distribution.dist.in`` template file was replaced by a new
  231. ``CPACK_APPLE_PKG_INSTALLER_CONTENT`` variable in CMake 3.23.0.
  232. This broke projects that provided their own template file but still
  233. expected the ``CPACK_PACKAGEMAKER_CHOICES`` variable to be defined.
  234. The old ``CPACK_PACKAGEMAKER_CHOICES`` variable is now also set to the
  235. same content as it was before, but it is formally deprecated.
  236. 3.23.3, 3.23.4, 3.23.5
  237. ----------------------
  238. * These versions made no changes to documented features or interfaces.
  239. Some implementation updates were made to support ecosystem changes
  240. and/or fix regressions.