3.27.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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 14 (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``, and imported targets for CUPTI's ``nvperf`` and ``pcsampling``
  96. components.
  97. * The :module:`FindDoxygen` module's :command:`doxygen_add_docs` command gained
  98. a ``CONFIG_FILE`` option to specify a custom doxygen configuration file.
  99. * The :module:`FindOpenGL` module gained support for components
  100. ``GLES2`` and ``GLES3``.
  101. * The :module:`FindwxWidgets` module now provides an imported target.
  102. Generator Expressions
  103. ---------------------
  104. * The :genex:`COMPILE_ONLY` generator expression was added to specify
  105. compilation usage requirements without any linking requirements.
  106. * ``$<LIST:...>`` generator expressions were added for
  107. :ref:`query <GenEx List Queries>`,
  108. :ref:`transformation <GenEx List Transformations>`, and
  109. :ref:`ordering <GenEx List Ordering>` operations on
  110. :ref:`lists <CMake Language Lists>`.
  111. * ``$<PATH:...>`` generator expressions for
  112. :ref:`decomposition <GenEx Path Decomposition>` and
  113. :ref:`transformation <GenEx Path Transformations>` operations learned
  114. to process :ref:`lists <CMake Language Lists>` of paths element-wise.
  115. * The :genex:`TARGET_IMPORT_FILE`, :genex:`TARGET_IMPORT_FILE_BASE_NAME`,
  116. :genex:`TARGET_IMPORT_FILE_PREFIX`, :genex:`TARGET_IMPORT_FILE_SUFFIX`,
  117. :genex:`TARGET_IMPORT_FILE_NAME`, and :genex:`TARGET_IMPORT_FILE_DIR`
  118. generator expressions were added. These expand to details about the
  119. linker import file for a target.
  120. * The :genex:`TARGET_RUNTIME_DLL_DIRS` generator expression was added.
  121. It expands to a list of the directories containing DLLs in
  122. :genex:`TARGET_RUNTIME_DLLS`.
  123. Autogen
  124. -------
  125. * The :variable:`CMAKE_AUTOMOC_EXECUTABLE`,
  126. :variable:`CMAKE_AUTORCC_EXECUTABLE`, and
  127. :variable:`CMAKE_AUTOUIC_EXECUTABLE` variables were added to initialize the
  128. corresponding target properties as targets are created.
  129. * The :prop_tgt:`AUTOGEN_USE_SYSTEM_INCLUDE` target property and
  130. corresponding :variable:`CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE` variable were
  131. added to explicitly control whether autogen headers are
  132. considered system headers.
  133. * The :prop_tgt:`INTERFACE_AUTOMOC_MACRO_NAMES` target property was added to
  134. specify macro names for ``moc`` as a transitive usage requirement.
  135. CTest
  136. -----
  137. * The :prop_test:`TIMEOUT_SIGNAL_NAME` and
  138. :prop_test:`TIMEOUT_SIGNAL_GRACE_PERIOD` test properties were added
  139. to specify a POSIX signal to send to a test process when its timeout
  140. is reached.
  141. CPack
  142. -----
  143. * The :cpack_gen:`CPack Inno Setup Generator` was added to package using
  144. Inno Setup.
  145. Deprecated and Removed Features
  146. ===============================
  147. * Compatibility with versions of CMake older than 3.5 is now deprecated
  148. and will be removed from a future version. Calls to
  149. :command:`cmake_minimum_required` or :command:`cmake_policy` that set
  150. the policy version to an older value now issue a deprecation diagnostic.
  151. * The :ref:`Extra Generators` have been deprecated. IDEs may use the
  152. :manual:`cmake-file-api(7)` to view CMake-generated project build trees.
  153. * The :module:`FindCUDA` module, which has been deprecated since CMake 3.10,
  154. has been removed by policy :policy:`CMP0146`. Port projects to CMake's
  155. first-class ``CUDA`` language support.
  156. * The :module:`FindPythonInterp` and :module:`FindPythonLibs` modules,
  157. which have been deprecated since CMake 3.12, have been removed by
  158. policy :policy:`CMP0148`. Port projects to :module:`FindPython3`,
  159. :module:`FindPython2`, or :module:`FindPython`.
  160. * The :module:`Dart` and :module:`FindDart` modules have been deprecated via
  161. policy :policy:`CMP0145`. Port projects to the :module:`CTest` module.
  162. * The :generator:`Visual Studio 9 2008` generator is now deprecated
  163. and will be removed in a future version of CMake.
  164. Other Changes
  165. =============
  166. * ``cmake --build $dir --verbose`` will now print the working directory and
  167. command line used to perform the build.
  168. * The :module:`ExternalProject` and :module:`FetchContent` modules
  169. now resolve relative ``GIT_REPOSITORY`` paths as relative to the
  170. parent project's remote, not as a relative local file system path.
  171. See :policy:`CMP0150`.
  172. * The :module:`ExternalProject` ``configure`` step no longer re-runs on
  173. every build when the ``UPDATE_DISCONNECTED`` option is enabled.
  174. It will only re-run if details of the ``download``, ``update``,
  175. or ``patch`` step change.
  176. * The :module:`ExternalProject` ``update`` and ``patch`` steps now always
  177. re-run if any of their details change, even if the ``UPDATE_DISCONNECTED``
  178. option is enabled. If using the ``GIT`` download method, and the ``GIT_TAG``
  179. is changed to a commit that is not already known locally, an error is now
  180. issued instead of silently using the previous ``GIT_TAG``.
  181. * The :module:`FindPython`, :module:`FindPython2` and :module:`FindPython3`
  182. modules now support the Windows ARM64 platform.
  183. * The :command:`file(GET_RUNTIME_DEPENDENCIES)` command now case-preserves
  184. DLL names reported on Windows. They are still converted to lowercase
  185. for filter matching.
  186. * The :prop_tgt:`SYSTEM` target property is now honored for Apple Frameworks.
  187. * :ref:`Visual Studio Generators`, for VS 15.8 (2017) and newer, now
  188. build custom commands in parallel. See policy :policy:`CMP0147`.
  189. * :ref:`Visual Studio Generators` for VS 14 (2015) and above now prefer
  190. to select the latest Windows SDK version. See policy :policy:`CMP0149`.
  191. Updates
  192. =======
  193. Changes made since CMake 3.27.0 include the following.
  194. 3.27.1
  195. ------
  196. * This version made no changes to documented features or interfaces.
  197. Some implementation updates were made to support ecosystem changes
  198. and/or fix regressions.
  199. 3.27.2
  200. ------
  201. * :ref:`Visual Studio Generators` for VS 14 (2015) and above now prefer to
  202. select the latest Windows SDK, as documented by policy :policy:`CMP0149`,
  203. when targeting any version of Windows. In CMake 3.27.[0-1] the
  204. preference was limited to targeting Windows 10 and above.
  205. * :ref:`Visual Studio Generators` for VS 14 (2015) and above now support
  206. using ``version=8.1`` in the :variable:`CMAKE_GENERATOR_PLATFORM` variable
  207. to select the Windows 8.1 SDK. In CMake 3.27.[0-1] the ``version=`` field
  208. was limited to selecting Windows 10 SDKs.
  209. 3.27.3, 3.27.4, 3.27.5, 3.27.6, 3.27.7, 3.27.8
  210. ----------------------------------------------
  211. * These versions made no changes to documented features or interfaces.
  212. Some implementation updates were made to support ecosystem changes
  213. and/or fix regressions.
  214. 3.27.9
  215. ------
  216. * The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object
  217. ``fileSets`` field was introduced by CMake 3.26.0 with entries of its
  218. ``baseDirectories`` member incorrectly expressed as absolute paths
  219. even if they are inside the top-level source directory. This was
  220. fixed in CMake 3.26.6 and has now been fixed in 3.27.9. Clients must
  221. be updated to expect relative paths under the top-level source directory.
  222. * Fortran module dependency scanning in :ref:`Ninja Generators` was updated
  223. by CMake 3.27.0 to use exact collation dependencies. This was supposed
  224. to fix subtle rebuild failures when moving module sources among targets.
  225. Since then, several cases have been found in which exact collation
  226. dependencies were incorrectly computed when using :ref:`Object Libraries`.
  227. Some of these cases were incrementally fixed through the 3.27.x patch
  228. series, but additional more subtle cases have since been found. In order
  229. to avoid further churn in the 3.27 release series, the original change has
  230. been reverted and deferred to a future version of CMake.