3.29.rst 7.8 KB

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