3.17.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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` command learned a new ``ZIP_LISTS`` option 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. * The :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 was added
  87. to initialize the :prop_tgt:`XCODE_SCHEME_ENVIRONMENT` target property.
  88. * The :variable:`CMAKE_XCODE_SCHEME_WORKING_DIRECTORY` variable and
  89. associated :prop_tgt:`XCODE_SCHEME_WORKING_DIRECTORY` target property
  90. were added to tell the :generator:`Xcode` generator to set the value of
  91. the ``Custom Working Directory`` schema option.
  92. Properties
  93. ----------
  94. * The :prop_tgt:`AIX_EXPORT_ALL_SYMBOLS` target property and associated
  95. :variable:`CMAKE_AIX_EXPORT_ALL_SYMBOLS` variable were created to
  96. optionally explicitly disable automatic export of symbols from shared
  97. libraries on AIX.
  98. * The :prop_tgt:`DEPRECATION` target property was added to mark
  99. a target as deprecated. If a linked target is marked as
  100. deprecated, a warning with the deprecation message is issued
  101. at generate time.
  102. * The :prop_tgt:`INSTALL_NAME_DIR` target property now supports
  103. :manual:`generator expressions <cmake-generator-expressions(7)>`.
  104. In particular, the ``$<INSTALL_PREFIX>`` generator expression can
  105. be used to set the directory relative to the install-time prefix.
  106. * Target properties :prop_tgt:`MACHO_COMPATIBILITY_VERSION` and
  107. :prop_tgt:`MACHO_CURRENT_VERSION` were added to set the
  108. ``compatibility_version`` and ``curent_version``, respectively,
  109. for Mach-O binaries. For backwards compatibility, if these properties
  110. are not set, :prop_tgt:`SOVERSION` and :prop_tgt:`VERSION`
  111. are used respectively as fallbacks.
  112. * The :prop_tgt:`VS_DOTNET_DOCUMENTATION_FILE` target property was added
  113. to tell :ref:`Visual Studio Generators` to generate a ``DocumentationFile``
  114. reference in ``.csproj`` files.
  115. Modules
  116. -------
  117. * The :module:`ExternalProject` module :command:`ExternalProject_Add`
  118. command gained a ``GIT_SUBMODULES_RECURSE`` option to specify whether
  119. Git submodules should be updated recursively. The default is on to
  120. preserve existing behavior.
  121. * The :module:`FindCUDAToolkit` module was added to find the
  122. CUDA Toolkit without enabling CUDA as a language.
  123. * The :module:`FindCURL` module learned to find CURL using
  124. the ``CURLConfig.cmake`` package configuration file generated by
  125. CURL's cmake buildsystem. It also gained a new ``CURL_NO_CURL_CMAKE``
  126. option to disable this behavior.
  127. * The :module:`FindFLEX` module's ``FLEX_TARGET`` command now runs ``flex``
  128. with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory.
  129. See policy :policy:`CMP0098`.
  130. * The :module:`FindLibArchive` module now provides an imported target
  131. for libarchive.
  132. * The :module:`FindPython` module has learned to find Python components
  133. in active virtual environments managed by ``conda``.
  134. * The :module:`FindPython3` and :module:`FindPython` modules gained,
  135. respectively, variable ``Python3_SOABI`` and ``Python_SOABI`` giving
  136. the standard extension suffix for modules. Moreover, commands
  137. ``Python3_add_library()`` and ``Python_add_library()`` gained the option
  138. ``WITH_SOABI`` to prefix the library suffix with the value of ``SOABI``.
  139. * The :module:`FindLibXml2` module now provides an imported target for the
  140. ``xmllint`` executable.
  141. Autogen
  142. -------
  143. * :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` learned to process headers
  144. with a ``.hh`` extension. See policy :policy:`CMP0100`.
  145. CTest
  146. -----
  147. * The :variable:`CTEST_CONFIGURATION_TYPE` variable is now set from the
  148. command line when :manual:`ctest(1)` is invoked with ``-C <cfg>``.
  149. * The :manual:`ctest(1)` tool gained support for Dr. Memory to run
  150. memcheck runs.
  151. * The :manual:`ctest(1)` tool gained a ``--no-tests=<[error|ignore]>`` option
  152. to explicitly set and unify the behavior between direct invocation and
  153. script mode if no tests were found.
  154. * The :manual:`ctest(1)` tool gained a ``--repeat <mode>:<n>`` option
  155. to specify conditions in which to repeat tests. This generalizes
  156. the existing ``--repeat-until-fail <n>`` option to add modes for
  157. ``until-pass`` and ``after-timeout``.
  158. * The :command:`ctest_test` command gained a ``REPEAT <mode>:<n>`` option
  159. to specify conditions in which to repeat tests.
  160. CPack
  161. -----
  162. * The :cpack_gen:`CPack DragNDrop Generator` learned to use
  163. the :variable:`CPACK_DMG_<component>_FILE_NAME` variable
  164. to set a custom filename when packaging components into
  165. their own DMGs.
  166. * The :cpack_gen:`CPack DragNDrop Generator` learned to handle
  167. RTF formatted license files. When :variable:`CPACK_DMG_SLA_DIR`
  168. variable is set, ``<language>.license.rtf`` is considered, but
  169. only as a fallback when the plaintext (``.txt``) file is not found
  170. in order to maintain backwards compatibility.
  171. * The :cpack_gen:`CPack NSIS Generator` gained a new variable
  172. :variable:`CPACK_NSIS_MUI_HEADERIMAGE` to set the header image.
  173. To not break existing setups, it still defaults to
  174. :variable:`CPACK_PACKAGE_ICON` if the new variable is not set.
  175. * The :cpack_gen:`CPack NSIS Generator` now supports
  176. :variable:`CPACK_NSIS_UNINSTALL_NAME`.
  177. This can be used to specify the name of the Uninstall program.
  178. * The :cpack_gen:`CPack NSIS Generator` now supports
  179. :variable:`CPACK_NSIS_WELCOME_TITLE` and
  180. :variable:`CPACK_NSIS_WELCOME_TITLE_3LINES`.
  181. These can be used to specify the welcome page title and display it in 3 lines.
  182. * The :cpack_gen:`CPack NSIS Generator` now supports
  183. :variable:`CPACK_NSIS_FINISH_TITLE` and
  184. :variable:`CPACK_NSIS_FINISH_TITLE_3LINES`.
  185. These can be used to specify the finish page title and display it in 3 lines.
  186. * The :cpack_gen:`CPack productbuild Generator` gained support for a
  187. :variable:`CPACK_PRODUCTBUILD_BACKGROUND` variable to specify a background
  188. image for the macOS installer.
  189. Other
  190. -----
  191. * :manual:`ccmake(1)` now displays cache values using colors
  192. based on the entry type if the terminal supports color.
  193. * :manual:`ccmake(1)` now displays messages and a progress bar during
  194. configure and generate. It will keep the output displayed if any
  195. errors or warnings occurred.
  196. Deprecated and Removed Features
  197. ===============================
  198. * An explicit deprecation diagnostic was added for policy ``CMP0068``
  199. and policy ``CMP0069`` (``CMP0067`` and below were already deprecated).
  200. The :manual:`cmake-policies(7)` manual explains that the OLD behaviors
  201. of all policies are deprecated and that projects should port to the
  202. NEW behaviors.
  203. * The :cpack_gen:`CPack PackageMaker Generator` generator has been
  204. deprecated because Xcode no longer distributes the PackageMaker tools.
  205. The undocumented ``OSXX11`` generator has also been deprecated.
  206. * The :manual:`cmake(1)` command-line ``-E remove`` and ``-E remove_directory``
  207. tools are deprecated in favor of the new ``-E rm`` tool. The older tools
  208. always returned 0 if a named path did not exist even without the force
  209. option and cannot be fixed without breaking compatibility, and so have
  210. been superseded.
  211. * The :cpack_gen:`CPack NSIS Generator` now requires NSIS 3.0 or later.
  212. Other Changes
  213. =============
  214. * The :manual:`file API <cmake-file-api(7)>` index file now emits a
  215. ``multiConfig`` flag specifying whether or not the generator supports
  216. multiple output configurations.
  217. * Target link properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
  218. :prop_tgt:`INTERFACE_LINK_DIRECTORIES` and
  219. :prop_tgt:`INTERFACE_LINK_DEPENDS` are now transitive over private
  220. dependencies on static libraries.
  221. See policy :policy:`CMP0099`.
  222. * When using MinGW tools, the :command:`find_library` command no longer
  223. finds ``.dll`` files by default. Instead, it expects ``.dll.a`` import
  224. libraries to be available.
  225. * The :generator:`MinGW Makefiles` generator no longer issues an error if
  226. ``sh.exe`` is present in the environment's ``PATH``.
  227. * The :generator:`Ninja` generator now prefers the first ninja build
  228. tool to appear in the ``PATH`` no matter whether it is called
  229. ``ninja-build``, ``ninja``, or ``samu``. Previously the first
  230. of those names to appear anywhere in the ``PATH`` would be preferred.
  231. * With SDCC the ``sdar`` tool is now preferred over ``sdcclib`` as librarian.
  232. The latter was deprecated by SDCC 3.2.0 and removed in SDCC 3.8.6.
  233. * With SDCC the default flags no longer include any target-specific flags.
  234. Previously the default flags were hard-coded for 8051.
  235. * The :variable:`CMAKE_VS_GLOBALS` variable value now applies during
  236. compiler identification and in targets created by the
  237. :command:`add_custom_target` command.
  238. * The :generator:`Xcode` generator no longer hard-codes ``-Wmost``,
  239. ``-Wno-four-char-constants``, and ``-Wno-unknown-pragmas`` warning flags.
  240. Updates
  241. =======
  242. Changes made since CMake 3.17.0 include the following.
  243. 3.17.1
  244. ------
  245. * CMake 3.17.0 updated the :cpack_gen:`CPack NSIS Generator` with changes
  246. that require NSIS 3.0 or later. CMake 3.17.1 now enforces the use
  247. of a sufficiently new version.
  248. 3.17.3
  249. ------
  250. * Selection of the Objective C or C++ compiler now considers the
  251. :envvar:`CC` or :envvar:`CXX` environment variable if the
  252. :envvar:`OBJC` or :envvar:`OBJCXX` environment variable is not set.
  253. * The :module:`FindPkgConfig` module now extracts include directories
  254. prefixed with ``-isystem`` into the ``*_INCLUDE_DIRS`` variables and
  255. :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target properties.
  256. Previously they would be places in ``*_CFLAGS_OTHER`` variables and
  257. :prop_tgt:`INTERFACE_COMPILE_OPTIONS` target properties.