3.17.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. CMake 3.17 Release Notes
  2. ************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.16 include the following.
  6. New Features
  7. ============
  8. Generators
  9. ----------
  10. * :manual:`cmake(1)` gained a :generator:`Ninja Multi-Config` generator,
  11. which is similar to the :generator:`Ninja` generator but can be used to build
  12. multiple configurations at once.
  13. * :ref:`Visual Studio Generators` learned to support per-config sources.
  14. Previously only :ref:`Command-Line Build Tool Generators` supported them.
  15. * :ref:`Visual Studio Generators` for VS 2010 and above now support
  16. specifying the ``VCTargetsPath`` value for project files in
  17. :variable:`CMAKE_GENERATOR_TOOLSET` setting.
  18. * :ref:`Visual Studio Generators` for VS 2010 and above learned to
  19. support .NET Standard and .NET Core. See the
  20. :prop_tgt:`DOTNET_TARGET_FRAMEWORK` target property and
  21. associated :variable:`CMAKE_DOTNET_TARGET_FRAMEWORK` variable.
  22. Languages
  23. ---------
  24. * The :manual:`Compile Features <cmake-compile-features(7)>` functionality
  25. now offers meta-features for the CUDA language standard levels
  26. (e.g. ``cuda_std_03``, ``cuda_std_14``). See
  27. :prop_gbl:`CMAKE_CUDA_KNOWN_FEATURES`.
  28. Compilers
  29. ---------
  30. * The IBM XL Fortran compiler is now supported by the :generator:`Ninja`
  31. generator.
  32. Command-Line
  33. ------------
  34. * :manual:`cmake(1)` gained a ``--debug-find`` command-line option to
  35. enable additional human-readable output on where find commands search.
  36. * :manual:`cmake(1)` gained a ``--trace-format`` command-line option that
  37. can be used to set the ``--trace`` output format. Currently, the old
  38. human readable and the new JSON format are supported. The new JSON format
  39. is easier to parse automatically, than the existing format.
  40. * :manual:`cmake(1)` gained a ``-E rm`` command-line tool that can be
  41. used to remove directories and files. This supersedes the existing
  42. ``-E remove`` and ``-E remove_directory`` tools and has better semantics.
  43. Commands
  44. --------
  45. * The :command:`add_custom_command` command learned to interpret paths in
  46. ``DEPENDS`` arguments that are specified relative to the current
  47. binary directory.
  48. * The :command:`foreach` learned a new option ``ZIP_LISTS`` to iterate
  49. over multiple lists simultaneously.
  50. * The :command:`load_cache(READ_WITH_PREFIX)` command mode is now allowed
  51. when using ``cmake -P`` to :ref:`Run a Script <Script Processing Mode>`.
  52. * The :command:`message` command learned to output context provided in
  53. the :variable:`CMAKE_MESSAGE_CONTEXT` variable for log levels
  54. ``NOTICE`` and below. Enable this output with the new ``--log-context``
  55. command-line option or :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` variable.
  56. * The :command:`message` command gained new keywords ``CHECK_START``,
  57. ``CHECK_PASS`` and ``CHECK_FAIL``.
  58. * :command:`target_compile_options` command now honors the ``BEFORE``
  59. keyword more consistently. See policy :policy:`CMP0101`.
  60. Variables
  61. ---------
  62. * A :variable:`CMAKE_CTEST_ARGUMENTS` variable was added to specify a list
  63. of command-line arguments passed to CTest when running through the
  64. ``test`` (or ``RUN_TESTS``) target of the generated build system.
  65. * The following variables are now defined inside a :command:`function`:
  66. - :variable:`CMAKE_CURRENT_FUNCTION`
  67. - :variable:`CMAKE_CURRENT_FUNCTION_LIST_DIR`
  68. - :variable:`CMAKE_CURRENT_FUNCTION_LIST_FILE`
  69. - :variable:`CMAKE_CURRENT_FUNCTION_LIST_LINE`
  70. * The :variable:`CMAKE_CUDA_RUNTIME_LIBRARY` variable and
  71. :prop_tgt:`CUDA_RUNTIME_LIBRARY` target property were introduced to
  72. select the CUDA runtime library used when linking targets that
  73. use CUDA.
  74. * The :variable:`CMAKE_FIND_DEBUG_MODE` variable was introduced to
  75. print extra find call information during the cmake run to standard
  76. error. Output is designed for human consumption and not for parsing.
  77. * The :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` variable now takes its
  78. initial value from the :envvar:`CMAKE_EXPORT_COMPILE_COMMANDS` environment
  79. variable if no explicit configuration is given.
  80. * The :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable, if not set
  81. explicitly, now takes its initial value from the
  82. :envvar:`CMAKE_<LANG>_COMPILER_LAUNCHER` environment variable.
  83. * The :variable:`CMAKE_MESSAGE_LOG_LEVEL` variable can now be used
  84. to persist a log level between CMake runs, unlike the ``--log-level``
  85. command line option which only applies to that particular run.
  86. * The :variable:`CMAKE_XCODE_SCHEME_ENVIRONMENT` variable and
  87. :prop_tgt:`XCODE_SCHEME_ENVIRONMENT` target property were added to
  88. tell the :generator:`Xcode` generator to set the value of the
  89. ``Custom Working Directory`` schema option.
  90. Properties
  91. ----------
  92. * The :prop_tgt:`AIX_EXPORT_ALL_SYMBOLS` target property and associated
  93. :variable:`CMAKE_AIX_EXPORT_ALL_SYMBOLS` variable were created to
  94. optionally explicitly disbale automatic export of symbols from shared
  95. libraries on AIX.
  96. * The :prop_tgt:`DEPRECATION` target property was added to mark
  97. a target as deprecated. If a linked target is marked as
  98. deprecated, a warning with the deprecation message is issued
  99. at generate time.
  100. * The :prop_tgt:`INSTALL_NAME_DIR` target property now supports
  101. :manual:`generator expressions <cmake-generator-expressions(7)>`.
  102. In particular, the ``$<INSTALL_PREFIX>`` generator expression can
  103. be used to set the directory relative to the install-time prefix.
  104. * Target properties :prop_tgt:`OSX_COMPATIBILITY_VERSION` and
  105. :prop_tgt:`OSX_CURRENT_VERSION` were added to set the
  106. ``compatibility_version`` and ``curent_version`` respectively
  107. on macOS. For backwards compatibility, if these properties
  108. are not set, :prop_tgt:`SOVERSION` and :prop_tgt:`VERSION`
  109. are used respectively as fallbacks.
  110. * The :prop_tgt:`VS_DOTNET_DOCUMENTATION_FILE` target property was added
  111. to tell :ref:`Visual Studio Generators` to generate a ``DocumentationFile``
  112. reference in ``.csproj`` files.
  113. Modules
  114. -------
  115. * The :module:`ExternalProject` module :command:`ExternalProject_Add`
  116. command gained a ``GIT_SUBMODULES_RECURSE`` option to specify whether
  117. Git submodules should be updated recursively. The default is on to
  118. preserve existing behavior.
  119. * The :module:`FindCUDAToolkit` module was added to find the
  120. CUDA Toolkit without enabling CUDA as a language.
  121. * The :module:`FindCURL` module learned to find CURL using
  122. the ``CURLConfig.cmake`` package configuration file generated by
  123. CURL's cmake buildsystem. It also gained a new ``CURL_NO_CURL_CMAKE``
  124. option to disable this behavior.
  125. * The :module:`FindFLEX` module's ``FLEX_TARGET`` command now runs ``flex``
  126. with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory.
  127. See policy :policy:`CMP0098`.
  128. * The :module:`FindLibArchive` module now provides an imported target
  129. for libarchive.
  130. * The :module:`FindPython` module has learned to find Python components
  131. in active virtual environments managed by ``conda``.
  132. * The :module:`FindPython3` and :module:`FindPython` modules gained,
  133. respectively, variable ``Python3_SOABI`` and ``Python_SOABI`` giving
  134. the standard extension suffix for modules. Moreover, commands
  135. ``Python3_add_library`` and ``Python_add_library`` gained the option
  136. ``WITH_SOABI`` to prefix the library suffix with the value of ``SOABI``.
  137. * The :module:`FindLibXml2` module now provides an imported target for the
  138. ``xmllint`` executable
  139. Autogen
  140. -------
  141. * :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` learned to process headers
  142. with a ``.hh`` extension. See policy :policy:`CMP0100`.
  143. CTest
  144. -----
  145. * The :variable:`CTEST_CONFIGURATION_TYPE` variable is now set from the
  146. command line when :manual:`ctest(1)` is invoked with ``-C <cfg>``.
  147. * The :manual:`ctest(1)` gained support for Dr. Memory to run
  148. memcheck runs.
  149. * The :manual:`ctest(1)` tool gained a ``--no-tests=<[error|ignore]>`` option
  150. to explicitly set and unify the behavior between direct invocation and
  151. script mode if no tests were found.
  152. * The :manual:`ctest(1)` tool gained a ``--repeat <mode>:<n>`` option
  153. to specify conditions in which to repeat tests. This generalizes
  154. the existing ``--repeat-until-fail <n>`` option to add modes for
  155. ``until-pass`` and ``after-timeout``.
  156. * The :command:`ctest_test` command gained a ``REPEAT <mode>:<n>`` option
  157. to specify conditions in which to repeat tests.
  158. CPack
  159. -----
  160. * The :cpack_gen:`CPack DragNDrop Generator` learned to use
  161. the :variable:`CPACK_DMG_<component>_FILE_NAME` variable
  162. to set a custom filename when packaging components into
  163. their own DMGs.
  164. * The :cpack_gen:`CPack DragNDrop Generator` learned to handle
  165. RTF formatted license files. When :variable:`CPACK_DMG_SLA_DIR`
  166. variable is set, ``<language>.license.rtf`` is considered, but
  167. only as a fallback when the plaintext (``.txt``) file is not found
  168. in order to maintain backwards compatibility.
  169. * The :cpack_gen:`CPack NSIS Generator` gained a new variable
  170. :variable:`CPACK_NSIS_MUI_HEADERIMAGE` to set the header image.
  171. To not break existing setups, it still defaults to
  172. :variable:`CPACK_PACKAGE_ICON` if the new variable is not set.
  173. * The :cpack_gen:`CPack NSIS Generator` now supports
  174. :variable:`CPACK_NSIS_UNINSTALL_NAME`.
  175. This can be used to specify the name of the Uninstall program.
  176. * The :cpack_gen:`CPack NSIS Generator` now supports
  177. :variable:`CPACK_NSIS_WELCOME_TITLE` and
  178. :variable:`CPACK_NSIS_WELCOME_TITLE_3LINES`.
  179. These can be used to specify the welcome page title and display it in 3 lines.
  180. * The :cpack_gen:`CPack NSIS Generator` now supports
  181. :variable:`CPACK_NSIS_FINISH_TITLE` and
  182. :variable:`CPACK_NSIS_FINISH_TITLE_3LINES`.
  183. These can be used to specify the finish page title and display it in 3 lines.
  184. * The :cpack_gen:`CPack productbuild Generator` gained option
  185. :variable:`CPACK_PRODUCTBUILD_BACKGROUND` to specify a background image
  186. for the macOS installer.
  187. Other
  188. -----
  189. * :manual:`ccmake(1)` now displays cache values using colors
  190. based on the entry type if the terminal supports color.
  191. * :manual:`ccmake(1)` now displays messages and a progress bar during
  192. configure and generate. It will keep the output displayed if any
  193. errors or warnings occurred.
  194. Deprecated and Removed Features
  195. ===============================
  196. * An explicit deprecation diagnostic was added for policy ``CMP0068``
  197. and policy ``CMP0069`` (``CMP0067`` and below were already deprecated).
  198. The :manual:`cmake-policies(7)` manual explains that the OLD behaviors
  199. of all policies are deprecated and that projects should port to the
  200. NEW behaviors.
  201. * The :cpack_gen:`CPack PackageMaker Generator` generator has been
  202. deprecated because Xcode no longer distributes the PackageMaker tools.
  203. The undocumented ``OSXX11`` generator has also been deprecated.
  204. * The :manual:`cmake(1)` command-line ``-E remove`` and ``-E remove_directory``
  205. tools are deprecated in favor of the new ``-E rm`` tool. The older tools
  206. always returned 0 if a named path did not exist even without the force
  207. option and cannot be fixed without breaking compatibility, and so have
  208. been superseded.
  209. Other Changes
  210. =============
  211. * The :manual:`file API <cmake-file-api(7)>` index file now emits a
  212. ``multiConfig`` flag specifying whether or not the generator supports
  213. multiple output configurations.
  214. * Target link properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
  215. :prop_tgt:`INTERFACE_LINK_DIRECTORIES` and
  216. :prop_tgt:`INTERFACE_LINK_DEPENDS` are now transitive over private
  217. dependencies on static libraries.
  218. See policy :policy:`CMP0099`.
  219. * When using MinGW tools, the :command:`find_library` command no longer
  220. finds ``.dll`` files by default. Instead it expects ``.dll.a`` import
  221. libraries to be available.
  222. * The :generator:`MinGW Makefiles` generator no longer issues an error if
  223. ``sh.exe`` is present in the environment's ``PATH``.
  224. * The :generator:`Ninja` generator now prefers the first ninja build
  225. tool to appear in the ``PATH`` no matter whether it is called
  226. ``ninja-build``, ``ninja``, or ``samu``. Previously the first
  227. of those names to appear anywhere in the ``PATH`` would be preferred.
  228. * With SDCC the ``sdar`` tool is now preferred over ``sdcclib`` as librarian.
  229. The latter was deprecated by SDCC 3.2.0 and removed in SDCC 3.8.6.
  230. * With SDCC the default flags no longer include any target-specific flags.
  231. Previously the default flags were hard-coded for 8051.
  232. * The :variable:`CMAKE_VS_GLOBALS` variable value now applies during
  233. compiler identification and in targets created by the
  234. :command:`add_custom_target` command.
  235. * The :generator:`Xcode` generator no longer hard-codes ``-Wmost``,
  236. ``-Wno-four-char-constants``, and ``-Wno-unknown-pragmas`` warning flags.