3.27.rst 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. CMake 3.27 Release Notes
  2. ************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.26 include the following.
  6. New Features
  7. ============
  8. Debugger
  9. --------
  10. * :manual:`cmake(1)` now supports interactive debugging of the CMake language.
  11. See the :option:`--debugger <cmake --debugger>` option.
  12. Presets
  13. -------
  14. * :manual:`cmake-presets(7)` files now support schema version ``7``.
  15. * :manual:`cmake-presets(7)` now supports ``$penv{}`` macro expansion
  16. in ``include`` fields.
  17. Generators
  18. ----------
  19. * The :ref:`Makefile <Makefile Generators>` and :ref:`Ninja <Ninja Generators>`
  20. generators now support using the ``--dependency-file`` linker flag,
  21. added by GNU Binutils 2.35 and LLVM's LLD 12.0.0, so that files read by the
  22. linker will cause a relink if they change (typically modified timestamps).
  23. See the :variable:`CMAKE_LINK_DEPENDS_USE_LINKER` variable.
  24. * The :ref:`Visual Studio Generators` for VS 2015 and above learned to
  25. select the Windows SDK version explicitly using a ``version=`` field
  26. in the :variable:`CMAKE_GENERATOR_PLATFORM` variable.
  27. See :ref:`Visual Studio Platform Selection`.
  28. Languages
  29. ---------
  30. * The ``CXX`` language now treats source file extensions
  31. ``.ccm``, ``.cxxm``, and ``.c++m`` as C++.
  32. File-Based API
  33. --------------
  34. * The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has
  35. been updated to 2.6.
  36. * The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained
  37. a new "frameworks" field in the "compileGroups" objects.
  38. Platforms
  39. ---------
  40. * Apple text-based stubs (i.e. ``.tbd`` files) may now be created for shared
  41. libraries on macOS. See the :prop_tgt:`ENABLE_EXPORTS` property.
  42. Commands
  43. --------
  44. * The :command:`add_custom_command` command gained a new
  45. ``DEPENDS_EXPLICIT_ONLY`` option to tell the :ref:`Ninja Generators`
  46. not to add any dependencies implied by the target to which it is
  47. attached. The :variable:`CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLY`
  48. variable was added to enable ``DEPENDS_EXPLICIT_ONLY`` on all calls to
  49. :command:`add_custom_command` command.
  50. * The :command:`cmake_file_api` command was added for projects to add
  51. :manual:`CMake file API <cmake-file-api(7)>` queries for the current
  52. CMake run.
  53. * The :command:`find_package` command now searches prefixes specified by
  54. upper-case :variable:`<PACKAGENAME>_ROOT` CMake variables and upper-case
  55. :envvar:`<PACKAGENAME>_ROOT` environment variables.
  56. See policy :policy:`CMP0144`.
  57. * The :command:`install(CODE)` and :command:`install(SCRIPT)` commands
  58. now support the :genex:`$<INSTALL_PREFIX>` generator expression.
  59. Variables
  60. ---------
  61. * The :variable:`CMAKE_DLL_NAME_WITH_SOVERSION` variable and associated
  62. :prop_tgt:`DLL_NAME_WITH_SOVERSION` target property were added to
  63. optionally append the :prop_tgt:`SOVERSION` to the filename of the
  64. ``.dll`` part of a shared library on Windows.
  65. * Variables :variable:`CMAKE_VS_DEBUGGER_COMMAND`,
  66. :variable:`CMAKE_VS_DEBUGGER_COMMAND_ARGUMENTS`,
  67. :variable:`CMAKE_VS_DEBUGGER_ENVIRONMENT`, and
  68. :variable:`CMAKE_VS_DEBUGGER_WORKING_DIRECTORY` were added to initialize
  69. corresponding target properties.
  70. * The :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION` variable
  71. was added to initialize the :prop_tgt:`VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION`
  72. target property on all targets when they are created.
  73. Properties
  74. ----------
  75. * A :prop_tgt:`CUDA_CUBIN_COMPILATION` target property was added to
  76. :ref:`Object Libraries` to support compiling to ``.cubin`` files
  77. instead of host object files. Currently only supported with NVIDIA.
  78. * A :prop_tgt:`CUDA_FATBIN_COMPILATION` target property was added to
  79. :ref:`Object Libraries` to support compiling to ``.fatbin`` files
  80. instead of host object files. Currently only supported with NVIDIA.
  81. * A :prop_tgt:`CUDA_OPTIX_COMPILATION` target property was added to
  82. :ref:`Object Libraries` to support compiling to ``.optixir`` files
  83. instead of host object files. Currently only supported with NVIDIA.
  84. * The :prop_tgt:`<LANG>_CLANG_TIDY`, :prop_tgt:`<LANG>_CPPCHECK`,
  85. :prop_tgt:`<LANG>_CPPLINT`, and :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE`,
  86. target properties now support
  87. :manual:`generator expressions <cmake-generator-expressions(7)>`.
  88. * The :prop_tgt:`<LANG>_LINKER_LAUNCHER` target property now supports
  89. :manual:`generator expressions <cmake-generator-expressions(7)>`.
  90. * The :prop_sf:`SKIP_LINTING` source file property was added to suppress
  91. target-wide code checks on specific sources.
  92. Modules
  93. -------
  94. * The :module:`FindCUDAToolkit` module now provides an imported target for
  95. ``cudla``, if found.
  96. * The :module:`FindDoxygen` module's :command:`doxygen_add_docs` command gained
  97. a ``CONFIG_FILE`` option to specify a custom doxygen configuration file.
  98. * The :module:`FindOpenGL` module gained support for components
  99. ``GLES2`` and ``GLES3``.
  100. * The :module:`FindwxWidgets` module now provides an imported target.
  101. Generator Expressions
  102. ---------------------
  103. * The :genex:`COMPILE_ONLY` generator expression was added to specify
  104. compilation usage requirements without any linking requirements.
  105. * ``$<LIST:...>`` generator expressions were added for
  106. :ref:`query <GenEx List Queries>`,
  107. :ref:`transformation <GenEx List Transformations>`, and
  108. :ref:`ordering <GenEx List Ordering>` operations on
  109. :ref:`lists <CMake Language Lists>`.
  110. * ``$<PATH:...>`` generator expressions for
  111. :ref:`decomposition <GenEx Path Decomposition>` and
  112. :ref:`transformation <GenEx Path Transformations>` operations learned
  113. to process :ref:`lists <CMake Language Lists>` of paths element-wise.
  114. Autogen
  115. -------
  116. * The :variable:`CMAKE_AUTOMOC_EXECUTABLE`,
  117. :variable:`CMAKE_AUTORCC_EXECUTABLE`, and
  118. :variable:`CMAKE_AUTOUIC_EXECUTABLE` variables were added to initialize the
  119. corresponding target properties as targets are created.
  120. * The :prop_tgt:`AUTOGEN_USE_SYSTEM_INCLUDE` target property and
  121. corresponding :variable:`CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE` variable were
  122. added to explicitly control whether autogen headers are
  123. considered system headers.
  124. * The :prop_tgt:`INTERFACE_AUTOMOC_MACRO_NAMES` target property was added to
  125. specify macro names for ``moc`` as a transitive usage requirement.
  126. CTest
  127. -----
  128. * The :prop_test:`TIMEOUT_SIGNAL_NAME` and
  129. :prop_test:`TIMEOUT_SIGNAL_GRACE_PERIOD` test properties were added
  130. to specify a POSIX signal to send to a test process when its timeout
  131. is reached.
  132. CPack
  133. -----
  134. * The :cpack_gen:`CPack Inno Setup Generator` was added to package using
  135. Inno Setup.
  136. Deprecated and Removed Features
  137. ===============================
  138. * Compatibility with versions of CMake older than 3.5 is now deprecated
  139. and will be removed from a future version. Calls to
  140. :command:`cmake_minimum_required` or :command:`cmake_policy` that set
  141. the policy version to an older value now issue a deprecation diagnostic.
  142. * The :ref:`Extra Generators` have been deprecated. IDEs may use the
  143. :manual:`cmake-file-api(7)` to view CMake-generated project build trees.
  144. * The :module:`FindCUDA` module, which has been deprecated since CMake 3.10,
  145. has been removed by policy :policy:`CMP0146`. Port projects to CMake's
  146. first-class ``CUDA`` language support.
  147. * The :module:`FindPythonInterp` and :module:`FindPythonLibs` modules,
  148. which have been deprecated since CMake 3.12, have been removed by
  149. policy :policy:`CMP0148`. Port projects to :module:`FindPython3`,
  150. :module:`FindPython2`, or :module:`FindPython`.
  151. * The :module:`Dart` and :module:`FindDart` modules have been deprecated via
  152. policy :policy:`CMP0145`. Port projects to the :module:`CTest` module.
  153. * The :generator:`Visual Studio 9 2008` generator is now deprecated
  154. and will be removed in a future version of CMake.
  155. Other Changes
  156. =============
  157. * ``cmake --build $dir --verbose`` will now print the working directory and
  158. command line used to perform the build.
  159. * The :module:`ExternalProject` and :module:`FetchContent` modules
  160. now resolve relative ``GIT_REPOSITORY`` paths as relative to the
  161. parent project's remote, not as a relative local file system path.
  162. See :policy:`CMP0150`.
  163. * The :module:`ExternalProject` ``configure`` step no longer re-runs on
  164. every build when the ``UPDATE_DISCONNECTED`` option is enabled.
  165. It will only re-run if details of the ``download``, ``update``,
  166. or ``patch`` step change.
  167. * The :module:`ExternalProject` ``update`` and ``patch`` steps now always
  168. re-run if any of their details change, even if the ``UPDATE_DISCONNECTED``
  169. option is enabled. If using the ``GIT`` download method, and the ``GIT_TAG``
  170. is changed to a commit that is not already known locally, an error is now
  171. issued instead of silently using the previous ``GIT_TAG``.
  172. * The :module:`FindPython`, :module:`FindPython2` and :module:`FindPython3`
  173. modules now support the Windows ARM64 platform.
  174. * The :command:`file(GET_RUNTIME_DEPENDENCIES)` command now case-preserves
  175. DLL names reported on Windows. They are still converted to lowercase
  176. for filter matching.
  177. * The :prop_tgt:`SYSTEM` target property is now honored for Apple Frameworks.
  178. * :ref:`Visual Studio Generators`, for VS 15.8 (2017) and newer, now
  179. build custom commands in parallel. See policy :policy:`CMP0147`.