3.28.rst 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. CMake 3.28 Release Notes
  2. ************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.27 include the following.
  6. New Features
  7. ============
  8. Languages
  9. ---------
  10. * C++ 20 named modules are now supported by :ref:`Ninja Generators`
  11. and :ref:`Visual Studio Generators` for VS 2022 and newer, in combination
  12. with the MSVC 14.34 toolset (provided with VS 17.4) and newer, LLVM/Clang
  13. 16.0 and newer, and GCC 14 (after the 2023-09-20 daily bump) and newer.
  14. See :manual:`cmake-cxxmodules(7)` for details.
  15. * ``HIP`` language code may now be compiled for NVIDIA GPUs
  16. using the NVIDIA CUDA Compiler (NVCC).
  17. See the :variable:`CMAKE_HIP_PLATFORM` variable.
  18. Platforms
  19. ---------
  20. * On Apple platforms, ``.xcframework`` folders are now supported:
  21. * The :command:`find_library` command now finds ``.xcframework`` folders.
  22. * The :command:`target_link_libraries` command now supports
  23. linking against a ``.xcframework`` folder.
  24. * The :prop_tgt:`IMPORTED_LOCATION` target property of an imported
  25. library target may now be the path to a ``.xcframework`` folder.
  26. * Apple visionOS and its ``xros`` and ``xrsimulator`` SDKs are now supported.
  27. Compiling for Apple visionOS can be requested by setting
  28. :variable:`CMAKE_SYSTEM_NAME` to ``visionOS``.
  29. See :ref:`Cross Compiling for iOS, tvOS, visionOS, or watchOS`
  30. for more information.
  31. Presets
  32. -------
  33. * :manual:`cmake-presets(7)` files now support schema version ``8``.
  34. It adds support for a ``$schema`` field.
  35. Compilers
  36. ---------
  37. * Cray Clang-based compilers are now supported with
  38. :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` ``CrayClang``.
  39. * The OrangeC compiler is now supported with
  40. :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` ``OrangeC``.
  41. Commands
  42. --------
  43. * The :command:`add_custom_command` and :command:`add_custom_target`
  44. commands gained a ``JOB_SERVER_AWARE`` option.
  45. * The :command:`cmake_host_system_information` command gained a
  46. ``MSYSTEM_PREFIX`` query for the installation prefix of a MSYS
  47. or MinGW development environment on Windows hosts.
  48. * The :command:`set_property` command ``TEST`` mode gained a ``DIRECTORY``
  49. option to set properties on tests in other directories.
  50. * The :command:`set_tests_properties` command gained a ``DIRECTORY``
  51. option to set properties on tests in other directories.
  52. * The :command:`get_property` command ``TEST`` mode gained a ``DIRECTORY``
  53. option to get properties on tests in other directories.
  54. * The :command:`get_test_property` command gained a ``DIRECTORY``
  55. option to get properties on tests in other directories.
  56. Variables
  57. ---------
  58. * The :envvar:`CMAKE_CROSSCOMPILING_EMULATOR` environment variable
  59. was added to initialize the :variable:`CMAKE_CROSSCOMPILING_EMULATOR`
  60. cache variable.
  61. * The :variable:`CMAKE_HIP_PLATFORM` variable was added to specify
  62. the GPU platform for which HIP language sources are to be compiled
  63. (``amd`` or ``nvidia``).
  64. Properties
  65. ----------
  66. * On imported shared libraries, the :prop_tgt:`IMPORTED_IMPLIB` target
  67. property may now be used without :prop_tgt:`IMPORTED_LOCATION`.
  68. This can be used to represent a stub library whose location should not
  69. be added as a runtime search path to dependents that link it.
  70. * The :prop_tgt:`IMPORTED_LOCATION` property of a macOS framework
  71. may now be a path to the ``.framework`` folder itself.
  72. * The :prop_tgt:`XCODE_EMBED_RESOURCES <XCODE_EMBED_<type>>` target property
  73. was added to tell the :generator:`Xcode` generator what targets to put in
  74. the ``Embed Resources`` build phase.
  75. Modules
  76. -------
  77. * The :module:`ExternalProject` module now includes the
  78. ``BUILD_JOB_SERVER_AWARE`` option for the
  79. :command:`ExternalProject_Add` command. This option enables
  80. the integration of the GNU Make job server when using an
  81. explicit ``BUILD_COMMAND`` with certain :ref:`Makefile Generators`.
  82. Additionally, the :command:`ExternalProject_Add_Step` command
  83. has been updated to support the new ``JOB_SERVER_AWARE`` option.
  84. * The :module:`FetchContent` module's :command:`FetchContent_Declare` command
  85. gained an ``EXCLUDE_FROM_ALL`` option, which propagates through to the
  86. :command:`add_subdirectory` call made by
  87. :command:`FetchContent_MakeAvailable` for the dependency.
  88. * The :module:`FindCURL` module gained a ``CURL_USE_STATIC_LIBS`` hint
  89. to select static libraries.
  90. * The :module:`FindEXPAT` module gained an ``EXPAT_USE_STATIC_LIBS`` hint
  91. to select static libraries.
  92. * The :module:`FindPkgConfig` module :command:`pkg_get_variable` command
  93. gained a ``DEFINE_VARIABLES`` option to pass variables to ``pkg-config``.
  94. Generator Expressions
  95. ---------------------
  96. * The :manual:`generator expressions <cmake-generator-expressions(7)>`
  97. :genex:`$<IF:...>`, :genex:`$<AND:...>`, and :genex:`$<OR:...>`
  98. short-circuit to avoid unnecessary evaluation of parameters.
  99. CTest
  100. -----
  101. * CTest may now take a :ref:`dynamically-generated resource spec file
  102. <ctest-resource-dynamically-generated-spec-file>`, which can be specified by the
  103. :prop_test:`GENERATED_RESOURCE_SPEC_FILE` test property.
  104. Deprecated and Removed Features
  105. ===============================
  106. * The :command:`exec_program` command, which has been deprecated
  107. since CMake 3.0, has been removed by policy :policy:`CMP0153`.
  108. Use the :command:`execute_process` command instead.
  109. * The :generator:`Visual Studio 11 2012` generator has been removed.
  110. * The :generator:`Visual Studio 12 2013` generator is now deprecated
  111. and will be removed in a future version of CMake.
  112. * The :prop_tgt:`IOS_INSTALL_COMBINED` target property and corresponding
  113. :variable:`CMAKE_IOS_INSTALL_COMBINED` variable have been deprecated.
  114. Their functionality does not make sense on Apple Silicon hosts.
  115. * The :generator:`Xcode` generator will now issue a fatal error if
  116. the Legacy Build System has been selected for Xcode 14 and
  117. newer. Those Xcode versions dropped support for the Legacy Build
  118. System and expect the project to be set-up for their current
  119. Build System.
  120. Other Changes
  121. =============
  122. * Generated files, in targets using :ref:`file sets`, are now considered
  123. private by default. Generated public headers must be specified using
  124. file sets. This allows :ref:`Ninja Generators` to produce more
  125. efficient build graphs. See policy :policy:`CMP0154`.
  126. * The :command:`find_library`, :command:`find_path`, and :command:`find_file`
  127. commands no longer search in installation prefixes derived from the ``PATH``
  128. environment variable. This behavior was added in CMake 3.3 to support
  129. MSYS and MinGW (``MSYSTEM``) development environments on Windows, but
  130. it can search undesired prefixes that happen to be in the ``PATH`` for
  131. unrelated reasons. Users who keep some ``<prefix>/bin`` directories in
  132. the ``PATH`` just for their tools do not necessarily want any corresponding
  133. ``<prefix>/lib`` or ``<prefix>/include`` directories searched.
  134. The behavior was reverted for non-Windows platforms by CMake 3.6.
  135. Now it has been reverted on Windows platforms too.
  136. One may set the ``CMAKE_PREFIX_PATH`` environment variable with a
  137. :ref:`semicolon-separated list <CMake Language Lists>` of prefixes
  138. that are to be searched.
  139. * When using MinGW tools in a ``MSYSTEM`` environment on Windows,
  140. the ``$MSYSTEM_PREFIX/local`` and ``$MSYSTEM_PREFIX`` prefixes are
  141. now added to :variable:`CMAKE_SYSTEM_PREFIX_PATH`.
  142. * The precompiled Linux ``x86_64`` binaries provided on
  143. `cmake.org <https://cmake.org/download/>`_ now require GLIBC 2.17 or higher.
  144. Updates
  145. =======
  146. Changes made since CMake 3.28.0 include the following.
  147. 3.28.1, 3.28.2
  148. --------------
  149. * These versions made no changes to documented features or interfaces.
  150. Some implementation updates were made to support ecosystem changes
  151. and/or fix regressions.