You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

269 lines
10 KiB

  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:`INTERFACE_LINK_LIBRARIES_DIRECT` and
  97. :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE` target properties
  98. were added to express usage requirements affecting a consumer's
  99. direct link dependencies.
  100. * The :prop_tgt:`XCODE_EMBED_PLUGINS <XCODE_EMBED_<type>>` target property
  101. was added to tell the :generator:`Xcode` generator what targets to put in
  102. the ``Embed PlugIns`` build phase.
  103. * The :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE` target property
  104. and supporting :variable:`CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE`
  105. variable were added to tell the :generator:`Xcode` generator to enable
  106. specifying the Xcode scheme option property ``GPU Frame Capture``.
  107. Modules
  108. -------
  109. * The :module:`CheckPIESupported` module now supports the ``OBJC``,
  110. ``OBJCXX``, ``CUDA``, and ``HIP`` languages. It also now honors
  111. :variable:`CMAKE_SYSROOT` and :variable:`CMAKE_OSX_SYSROOT`.
  112. * The :module:`ExternalProject` module's :command:`ExternalProject_Add`
  113. command gained support for a ``USES_TERMINAL_PATCH`` option to give
  114. the patch step exclusive terminal access.
  115. * The :module:`FindCUDAToolkit` module now provides a target for
  116. ``libcufft_static_nocallback``, if found.
  117. * The :module:`FindGLUT` module now provides the ``GLUT_INCLUDE_DIRS``
  118. result variable to conform with naming conventions documented in the
  119. :manual:`cmake-developer(7)` manual. This supersedes the legacy
  120. ``GLUT_INCLUDE_DIR`` variable.
  121. * The :module:`FindGTest` module now provides a target for GMock, if found.
  122. * The :module:`FindVulkan` module now provides a ``Vulkan_VERSION`` result
  123. variable reporting the version number.
  124. CTest
  125. -----
  126. * :manual:`ctest(1)` gained a new :variable:`CTEST_SUBMIT_INACTIVITY_TIMEOUT`
  127. variable, which can be used to specify a timeout for submission inactivity.
  128. CPack
  129. -----
  130. * The :cpack_gen:`CPack productbuild Generator` gained the new
  131. :variable:`CPACK_PRODUCTBUILD_DOMAINS`,
  132. :variable:`CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE`,
  133. :variable:`CPACK_PRODUCTBUILD_DOMAINS_USER`, and
  134. :variable:`CPACK_PRODUCTBUILD_DOMAINS_ROOT` variables for
  135. adding the domains element to the Distribution XML.
  136. * The :cpack_gen:`CPack productbuild Generator` gained a new variable,
  137. :variable:`CPACK_PRODUCTBUILD_IDENTIFIER`, used to customize the unique
  138. product identifier associated with the product.
  139. * The :cpack_gen:`CPack IFW Generator` gained the new
  140. :variable:`CPACK_IFW_ARCHIVE_FORMAT` and
  141. :variable:`CPACK_IFW_ARCHIVE_COMPRESSION` variables for setting the
  142. format used when packaging new component data archives, and choosing
  143. the compression level used.
  144. These features are available for QtIFW 4.2 and newer.
  145. * The :cpack_gen:`CPack IFW Generator` gained new
  146. :variable:`CPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE` variable to
  147. prevent the user from passing any consumer command to the installer, like
  148. ``install``, ``update``, and ``remove``.
  149. This feature is available for QtIFW 4.0 and newer.
  150. * The :cpack_gen:`CPack IFW Generator` gained the new
  151. :variable:`CPACK_IFW_PACKAGE_PRODUCT_IMAGES` variable for adding a
  152. list of images to be shown on the ``PerformInstallationPage``.
  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_RUN_PROGRAM`,
  156. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS`, and
  157. :variable:`CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION` variables for
  158. executing a command after the installer is done if the user accepts
  159. the action. This feature is available for QtIFW 4.0 and newer.
  160. * The :cpack_gen:`CPack IFW Generator` gained the new
  161. :variable:`CPACK_IFW_PACKAGE_SIGNING_IDENTITY` variable for specifying a
  162. code signing identity to be used for signing the generated app bundle.
  163. This feature is available on macOS only, and for QtIFW 3.0 and newer.
  164. * The :cpack_gen:`CPack WIX Generator` gained a new variable,
  165. :variable:`CPACK_WIX_SKIP_WIX_UI_EXTENSION`, to skip the inclusion
  166. of WixUIExtensions.
  167. Deprecated and Removed Features
  168. ===============================
  169. * :manual:`cmake(1)` now warns when multiple source paths are specified,
  170. as in ``cmake -S src1 src2``. This has never been officially documented
  171. or supported, but older versions accidentally accepted multiple source
  172. paths and used the last path specified. Update scripts to avoid
  173. passing multiple source path arguments.
  174. * The :manual:`cpack(1)` undocumented ``OSXX11`` generator has been removed.
  175. Other Changes
  176. =============
  177. * The :cpack_gen:`CPack DragNDrop Generator` no longer attaches
  178. :variable:`CPACK_RESOURCE_FILE_LICENSE` as the license agreement in
  179. the generated ``.dmg`` unless explicitly activated by a
  180. :variable:`CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE` option.
  181. In CMake projects, the :module:`CPack` module enables the option
  182. by default for compatibility.
  183. * ``CUDA`` targets may now enable both :prop_tgt:`CUDA_SEPARABLE_COMPILATION`
  184. and :prop_tgt:`CUDA_PTX_COMPILATION`.
  185. * ``CUDA`` compiler detection now:
  186. * issues an error in all cases when it's unable to compute the default
  187. architecture(s) if required (see :policy:`CMP0104`),
  188. * handles ``OFF`` for :variable:`CMAKE_CUDA_ARCHITECTURES` on Clang,
  189. * supports the theoretical case of multiple default architectures, and
  190. * tries to detect invalid architectures and issue an error.
  191. * ``CUDA`` with Clang now implements policy :policy:`CMP0105` and
  192. the ``$<DEVICE_LINK:...>`` and ``$<HOST_LINK:...>``
  193. :manual:`generator expressions <cmake-generator-expressions(7)>`.
  194. * The :command:`define_property` command's ``BRIEF_DOCS`` and ``FULL_DOCS``
  195. arguments are now optional.
  196. * :manual:`ccmake(1)` may now be enabled on Windows when building
  197. CMake from source. This is experimental, and so is not included
  198. in official distributions.