3.29.rst 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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 ``TARGET`` option's ``XCFRAMEWORK_LOCATION`` setting specifies the
  42. location of a ``.xcframework`` that can be substituted for an installed
  43. target.
  44. * The :command:`if` command gained new tests ``IS_READABLE``, ``IS_WRITABLE``
  45. and ``IS_EXECUTABLE`` to check file or directory permissions.
  46. Variables
  47. ---------
  48. * The :envvar:`CMAKE_INSTALL_PREFIX` environment variable was added to
  49. provide a default value for the :variable:`CMAKE_INSTALL_PREFIX` variable.
  50. * The :variable:`CMAKE_LINKER_TYPE` variable and corresponding
  51. :prop_tgt:`LINKER_TYPE` target property were added to specify
  52. what linker to use with some toolchains.
  53. * The :variable:`CMAKE_<LANG>_COMPILER_LINKER`,
  54. :variable:`CMAKE_<LANG>_COMPILER_LINKER_ID`,
  55. :variable:`CMAKE_<LANG>_COMPILER_LINKER_VERSION` and
  56. :variable:`CMAKE_<LANG>_COMPILER_LINKER_FRONTEND_VARIANT` variables
  57. were added to describe the linker used by the language's link step.
  58. * The :variable:`CMAKE_PROJECT_INCLUDE`,
  59. :variable:`CMAKE_PROJECT_INCLUDE_BEFORE`,
  60. :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`, and
  61. :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE` variables learned
  62. to support a :ref:`semicolon-separated list <CMake Language Lists>` of
  63. CMake language files to be included sequentially. These variables can also
  64. reference module names to be found in :variable:`CMAKE_MODULE_PATH` or
  65. builtin to CMake.
  66. * The :variable:`CMAKE_SKIP_TEST_ALL_DEPENDENCY` variable was added
  67. to control whether the ``test`` (or ``RUN_TESTS``) buildsystem
  68. target depends on the ``all`` (or ``ALL_BUILD``) target.
  69. * A :variable:`CMAKE_TEST_LAUNCHER` variable and corresponding
  70. :prop_tgt:`TEST_LAUNCHER` target property were added to specify
  71. a launcher to be used by executable targets when invoked by
  72. tests added by the :command:`add_test` command.
  73. Properties
  74. ----------
  75. * The :prop_tgt:`CROSSCOMPILING_EMULATOR` target property now
  76. supports :manual:`generator expressions <cmake-generator-expressions(7)>`.
  77. * The :prop_tgt:`UNITY_BUILD` target property now supports the
  78. Objective C (``OBJC``) and Objective C++ (``OBJCXX``) languages.
  79. * The :prop_tgt:`XCODE_EMBED_XPC_SERVICES <XCODE_EMBED_<type>>` target property
  80. was added to tell the :generator:`Xcode` generator what targets to put in
  81. the ``Embed XPC Resources`` build phase.
  82. Modules
  83. -------
  84. * The :module:`CMakePackageConfigHelpers` module gained new
  85. :command:`generate_apple_platform_selection_file` and
  86. :command:`generate_apple_architecture_selection_file` functions, which can
  87. be used to generate a file that includes another Apple-platform-specific
  88. file or the includes an architecture-specific implementation of a package
  89. for an Apple platform, respectively.
  90. * The :module:`FindOpenGL` module learned to find a GLU include
  91. directory different than the GL include directory. A new
  92. ``OPENGL_INCLUDE_DIRS`` result variable provides all include
  93. directories.
  94. CTest
  95. -----
  96. * :manual:`ctest(1)` gained a :option:`--http-header <ctest --http-header>`
  97. option to add custom headers on submission to CDash.
  98. * :manual:`ctest(1)` gained the :option:`--tests-from-file <ctest
  99. --tests-from-file>` and :option:`--exclude-from-file <ctest
  100. --exclude-from-file>` options to run or exclude tests named in a file.
  101. * :manual:`ctest(1)` now supports :ref:`job server integration
  102. <ctest-job-server-integration>` on POSIX systems.
  103. * The :option:`ctest -j` option may now be given without a value to let
  104. ctest choose a default level of parallelism, or with ``0`` to let ctest
  105. use unbounded parallelism. The corresponding :envvar:`CTEST_PARALLEL_LEVEL`
  106. environment variable, if set to the empty string, is now equivalent to
  107. passing ``-j`` with no value.
  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. * On Windows, when targeting the MSVC ABI, the :command:`find_library` command
  130. now accepts ``.a`` file names after first considering ``.lib``. This is
  131. symmetric with existing behavior when targeting the GNU ABI, in which the
  132. command accepts ``.lib`` file names after first considering ``.a``.
  133. * On Windows, when targeting the MSVC ABI, the :command:`find_library` command
  134. now considers ``.dll.lib`` file names before ``.lib``. This is the default
  135. suffix for DLL import libraries created by Rust toolchains for the MSVC ABI.
  136. * The :generator:`Ninja` and :generator:`NMake Makefiles` generators now use
  137. the ``-external:I`` flag for system includes when using IntelLLVM as of
  138. version 2021.4. The ``-external:W0`` flag is also used as of version 2022.2.
  139. * The :command:`create_test_sourcelist` command now provides a full path to
  140. the generated driver source file.
  141. * The :variable:`CPACK_PRODUCTBUILD_DOMAINS` variable now defaults to true.
  142. See policy :policy:`CMP0161`.
  143. * The :cpack_gen:`CPack WIX Generator` now produces WiX MSI installers
  144. that create start menu and uninstall entries for all users by default,
  145. as documented by the :variable:`CPACK_WIX_INSTALL_SCOPE` variable
  146. ``perMachine`` value. Previously, without a custom WiX template,
  147. it produced installers that would only create start menu and uninstall
  148. entries for the current user, even though they install for all users.