3.23.rst 13 KB

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