3.17.rst 13 KB

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