3.29.rst 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. CMake 3.29 Release Notes
  2. ************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.28 include the following.
  6. New Features
  7. ============
  8. Command-Line
  9. ------------
  10. * :manual:`cmake(1)` :option:`-E cat <cmake-E cat>` can now print the standard
  11. input by passing the ``-`` argument.
  12. Generators
  13. ----------
  14. * :ref:`Visual Studio Generators` now support selecting between the
  15. Intel oneAPI Fortran compiler (``ifx``) and the Intel classic Fortran
  16. compiler (``ifort``) using a ``fortran=`` field in
  17. :variable:`CMAKE_GENERATOR_TOOLSET`.
  18. File-Based API
  19. --------------
  20. * The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has
  21. been updated to 2.7.
  22. * The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained
  23. a new "launchers" field.
  24. Compilers
  25. ---------
  26. * The LLVM/Clang GNU-like frontend on Windows (``clang++``) may now be used
  27. to compile ``CUDA`` language sources.
  28. * Compilers targeting the GNU ABI on Windows (MinGW) may now be used to
  29. compile Objective C (``OBJC``) and Objective C++ (``OBJCXX``). These
  30. include GNU compilers (``gcc`` and ``g++``) and the LLVM/Clang GNU-like
  31. frontends (``clang`` and ``clang++``).
  32. * TI Clang-based compilers are now supported with
  33. :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` ``TIClang``.
  34. Commands
  35. --------
  36. * The :ref:`add_custom_command(TARGET) <add_custom_command(TARGET)>`
  37. signature now supports adding build events through :ref:`Alias Targets`.
  38. * The :command:`cmake_language(EXIT)` sub-command was added to terminate
  39. :option:`cmake -P` scripts with a specified exit code.
  40. * The :command:`export(SETUP)` sub-command was added to configure export sets.
  41. Its ``PACKAGE_DEPENDENCY`` option configures how :command:`find_dependency`
  42. calls are exported. Its ``TARGET`` option's ``XCFRAMEWORK_LOCATION``
  43. setting specifies the location of a ``.xcframework`` that can be
  44. substituted for an installed target.
  45. * The :command:`if` command gained new tests ``IS_READABLE``, ``IS_WRITABLE``
  46. and ``IS_EXECUTABLE`` to check file or directory permissions.
  47. * :command:`install(EXPORT)` and :command:`export(EXPORT)` learned a new
  48. ``EXPORT_PACKAGE_DEPENDENCIES`` argument, which can be used to generate
  49. :command:`find_dependency` calls based on what targets the exported targets
  50. depend on.
  51. Variables
  52. ---------
  53. * The :envvar:`CMAKE_INSTALL_PREFIX` environment variable was added to
  54. provide a default value for the :variable:`CMAKE_INSTALL_PREFIX` variable.
  55. * The :variable:`CMAKE_LINKER_TYPE` variable and corresponding
  56. :prop_tgt:`LINKER_TYPE` target property were added to specify
  57. what linker to use with some toolchains.
  58. * The :variable:`CMAKE_<LANG>_COMPILER_LINKER`,
  59. :variable:`CMAKE_<LANG>_COMPILER_LINKER_ID`,
  60. :variable:`CMAKE_<LANG>_COMPILER_LINKER_VERSION` and
  61. :variable:`CMAKE_<LANG>_COMPILER_LINKER_FRONTEND_VARIANT` variables
  62. were added to describe the linker used by the language's link step.
  63. * The :variable:`CMAKE_PROJECT_INCLUDE`,
  64. :variable:`CMAKE_PROJECT_INCLUDE_BEFORE`,
  65. :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`, and
  66. :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE` variables learned
  67. to support a :ref:`semicolon-separated list <CMake Language Lists>` of
  68. CMake language files to be included sequentially. These variables can also
  69. reference module names to be found in :variable:`CMAKE_MODULE_PATH` or
  70. builtin to CMake.
  71. * The :variable:`CMAKE_SKIP_TEST_ALL_DEPENDENCY` variable was added
  72. to control whether the ``test`` (or ``RUN_TESTS``) buildsystem
  73. target depends on the ``all`` (or ``ALL_BUILD``) target.
  74. * A :variable:`CMAKE_TEST_LAUNCHER` variable and corresponding
  75. :prop_tgt:`TEST_LAUNCHER` target property were added to specify
  76. a launcher to be used by executable targets when invoked by
  77. tests added by the :command:`add_test` command.
  78. Properties
  79. ----------
  80. * The :prop_tgt:`CROSSCOMPILING_EMULATOR` target property now
  81. supports :manual:`generator expressions <cmake-generator-expressions(7)>`.
  82. * The :prop_tgt:`EXPORT_FIND_PACKAGE_NAME` target property was added to
  83. allow targets to specify what package name to pass when exporting
  84. :command:`find_dependency` calls. This property is initialized with a new
  85. :variable:`CMAKE_EXPORT_FIND_PACKAGE_NAME` variable.
  86. * The :prop_tgt:`UNITY_BUILD` target property now supports the
  87. Objective C (``OBJC``) and Objective C++ (``OBJCXX``) languages.
  88. * The :prop_tgt:`XCODE_EMBED_XPC_SERVICES <XCODE_EMBED_<type>>` target property
  89. was added to tell the :generator:`Xcode` generator what targets to put in
  90. the ``Embed XPC Resources`` build phase.
  91. Modules
  92. -------
  93. * The :module:`CMakePackageConfigHelpers` module gained new
  94. :command:`generate_apple_platform_selection_file` and
  95. :command:`generate_apple_architecture_selection_file` functions, which can
  96. be used to generate a file that includes another Apple-platform-specific
  97. file or the includes an architecture-specific implementation of a package
  98. for an Apple platform, respectively.
  99. * The :module:`FindOpenGL` module learned to find a GLU include
  100. directory different than the GL include directory. A new
  101. ``OPENGL_INCLUDE_DIRS`` result variable provides all include
  102. directories.
  103. CTest
  104. -----
  105. * :manual:`ctest(1)` gained a :option:`--http-header <ctest --http-header>`
  106. option to add custom headers on submission to CDash.
  107. * :manual:`ctest(1)` gained the :option:`--tests-from-file <ctest
  108. --tests-from-file>` and :option:`--exclude-from-file <ctest
  109. --exclude-from-file>` options to run or exclude tests named in a file.
  110. * :manual:`ctest(1)` now supports :ref:`job server integration
  111. <ctest-job-server-integration>` on POSIX systems.
  112. * The :command:`ctest_test` command gained options
  113. ``INCLUDE_FROM_FILE`` and ``EXCLUDE_FROM_FILE`` to run or exclude
  114. tests named in a file.
  115. CPack
  116. -----
  117. * The :cpack_gen:`CPack DEB Generator` :variable:`CPACK_DEBIAN_FILE_NAME`
  118. variable may now be set without any suffix, and the ``.deb`` suffix
  119. will be added automatically.
  120. * The :cpack_gen:`CPack RPM Generator` :variable:`CPACK_RPM_FILE_NAME`
  121. variable may now be set without any suffix, and the ``.rpm`` suffix
  122. will be added automatically.
  123. * The :cpack_gen:`CPack WIX Generator` gained a new variable,
  124. :variable:`CPACK_WIX_INSTALL_SCOPE`, to control the
  125. ``InstallScope`` property of WiX MSI installers.
  126. Other Changes
  127. =============
  128. * CMake learned to de-duplicate libraries on link lines based on linker
  129. capabilities. See policy :policy:`CMP0156`.
  130. * The :command:`add_test` command now honors
  131. :variable:`CMAKE_CROSSCOMPILING_EMULATOR` only when cross-compiling.
  132. See policy :policy:`CMP0158`.
  133. * :command:`FetchContent_MakeAvailable` now sets the
  134. :variable:`CMAKE_EXPORT_FIND_PACKAGE_NAME` variable for CMake projects.
  135. * On Windows, when targeting the MSVC ABI, the :command:`find_library` command
  136. now accepts ``.a`` file names after first considering ``.lib``. This is
  137. symmetric with existing behavior when targeting the GNU ABI, in which the
  138. command accepts ``.lib`` file names after first considering ``.a``.
  139. * On Windows, when targeting the MSVC ABI, the :command:`find_library` command
  140. now considers ``.dll.lib`` file names before ``.lib``. This is the default
  141. suffix for DLL import libraries created by Rust toolchains for the MSVC ABI.
  142. * The :generator:`Ninja` and :generator:`NMake Makefiles` generators now use
  143. the ``-external:I`` flag for system includes when using IntelLLVM as of
  144. version 2021.4. The ``-external:W0`` flag is also used as of version 2022.2.
  145. * The :command:`create_test_sourcelist` command now provides a full path to
  146. the generated driver source file.
  147. * The :variable:`CPACK_PRODUCTBUILD_DOMAINS` variable now defaults to true.
  148. See policy :policy:`CMP0161`.
  149. * The :cpack_gen:`CPack WIX Generator` now produces WiX MSI installers
  150. that create start menu and uninstall entries for all users by default,
  151. as documented by the :variable:`CPACK_WIX_INSTALL_SCOPE` variable
  152. ``perMachine`` value. Previously, without a custom WiX template,
  153. it produced installers that would only create start menu and uninstall
  154. entries for the current user, even though they install for all users.