3.23.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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` target
  85. 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_gen:`CPack IFW Generator` gained the new
  138. :variable:`CPACK_IFW_ARCHIVE_FORMAT` and
  139. :variable:`CPACK_IFW_ARCHIVE_COMPRESSION` variables for setting the
  140. format used when packaging new component data archives, and choosing
  141. the compression level used.
  142. These features are available for QtIFW 4.2 and newer.
  143. * The :cpack_gen:`CPack IFW Generator` gained new
  144. :variable:`CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE` variable to
  145. prevent the user from passing any consumer command to the installer, like
  146. ``install``, ``update``, and ``remove``.
  147. This feature is available for QtIFW 4.0 and newer.
  148. * The :cpack_gen:`CPack IFW Generator` gained the new
  149. :variable:`CPACK_IFW_PACKAGE_PRODUCT_IMAGES` variable for adding a
  150. list of images to be shown on the ``PerformInstallationPage``.
  151. This feature is available for QtIFW 4.0 and newer.
  152. * The :cpack_gen:`CPack IFW Generator` gained the new
  153. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM`,
  154. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS`, and
  155. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION` variables for
  156. executing a command after the installer is done if the user accepts
  157. the action. 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_SIGNING_IDENTITY` variable for specifying a
  160. code signing identity to be used for signing the generated app bundle.
  161. This feature is available on macOS only, and for QtIFW 3.0 and newer.
  162. * The :cpack_gen:`CPack WIX Generator` gained a new variable,
  163. :variable:`CPACK_WIX_SKIP_WIX_UI_EXTENSION`, to skip the inclusion
  164. of WixUIExtensions.
  165. Deprecated and Removed Features
  166. ===============================
  167. * :manual:`cmake(1)` now warns when multiple source paths are specified,
  168. as in ``cmake -S src1 src2``. This has never been officially documented
  169. or supported, but older versions accidentally accepted multiple source
  170. paths and used the last path specified. Update scripts to avoid
  171. passing multiple source path arguments.
  172. * The :manual:`cpack(1)` undocumented ``OSXX11`` generator has been removed.
  173. Other Changes
  174. =============
  175. * The :cpack_gen:`CPack DragNDrop Generator` no longer attaches
  176. :variable:`CPACK_RESOURCE_FILE_LICENSE` as the license agreement in
  177. the generated ``.dmg`` unless explicitly activated by a
  178. :variable:`CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE` option.
  179. In CMake projects, the :module:`CPack` module enables the option
  180. by default for compatibility.
  181. * ``CUDA`` targets may now enable both :prop_tgt:`CUDA_SEPARABLE_COMPILATION`
  182. and :prop_tgt:`CUDA_PTX_COMPILATION`.
  183. * ``CUDA`` compiler detection now:
  184. * issues an error in all cases when it's unable to compute the default
  185. architecture(s) if required (see :policy:`CMP0104`),
  186. * handles ``OFF`` for :variable:`CMAKE_CUDA_ARCHITECTURES` on Clang,
  187. * supports the theoretical case of multiple default architectures, and
  188. * tries to detect invalid architectures and issue an error.
  189. * ``CUDA`` with Clang now implements policy :policy:`CMP0105` and
  190. the ``$<DEVICE_LINK:...>`` and ``$<HOST_LINK:...>``
  191. :manual:`generator expressions <cmake-generator-expressions(7)>`.
  192. * The :command:`define_property` command's ``BRIEF_DOCS`` and ``FULL_DOCS``
  193. arguments are now optional.
  194. * :manual:`ccmake(1)` may now be enabled on Windows when building
  195. CMake from source. This is experimental, and so is not included
  196. in official distributions.