3.10.rst 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. CMake 3.10 Release Notes
  2. ************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.9 include the following.
  6. New Features
  7. ============
  8. Platforms
  9. ---------
  10. * The `flang`_ Fortran compiler is now supported, with compiler id ``Flang``.
  11. * A new minimal platform file for ``Midipix`` was added.
  12. * Support for the MSVC ARM64 architecture was added.
  13. Visual Studio 2017 Update 4 and above offer an ARM64 toolchain.
  14. * Support for the IAR ARM Compiler was improved.
  15. .. _`flang`: https://github.com/flang-compiler/flang
  16. Generators
  17. ----------
  18. * The :ref:`Makefile Generators` and the :generator:`Ninja` generator learned
  19. to add compiler launcher tools like ccache along with the compiler for the
  20. ``CUDA`` language (``C`` and ``CXX`` were supported previously). See the
  21. :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable and
  22. :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property for details.
  23. * The :generator:`CodeBlocks` extra generator learned to optionally exclude
  24. files from outside the project root directory from the generated project.
  25. See the :variable:`CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES` variable.
  26. Commands
  27. --------
  28. * The :command:`cmake_host_system_information` command learned more keys
  29. to get information about the processor capabilities and the host OS
  30. version.
  31. * The :command:`configure_file` command learned to support indented
  32. ``# cmakedefine`` and ``# cmakedefine01``. Spaces and/or tabs between
  33. the ``#`` character and the ``cmakedefine``/``cmakedefine01`` words
  34. are now understood and preserved in the output.
  35. * The :command:`execute_process` command gained a ``RESULTS_VARIABLE``
  36. option to collect a list of results from all children in a pipeline
  37. of processes when multiple ``COMMAND`` arguments are given.
  38. * The :command:`include_guard` command was introduced to allow guarding
  39. CMake scripts from being included more than once. The command supports
  40. ``DIRECTORY`` and ``GLOBAL`` options to adjust the corresponding include guard
  41. scope. If no options given, include guard is similar to basic variable-based
  42. check.
  43. * The :command:`string` command learned a new ``PREPEND`` subcommand.
  44. * The :command:`string(TIMESTAMP)` command now supports ``%A``
  45. for full weekday name and ``%B`` for full month name.
  46. Variables
  47. ---------
  48. * A :variable:`CMAKE_DIRECTORY_LABELS` variable was added to specify
  49. labels for all tests in a directory.
  50. Properties
  51. ----------
  52. * A :prop_tgt:`<LANG>_CPPCHECK` target property and supporting
  53. :variable:`CMAKE_<LANG>_CPPCHECK` variable were introduced to tell
  54. the :ref:`Makefile Generators` and the :generator:`Ninja` generator to
  55. run ``cppcheck`` with the compiler for ``C`` and ``CXX`` languages.
  56. * A :prop_dir:`LABELS` directory property was added to specify labels
  57. for all targets and tests in a directory.
  58. * A :prop_dir:`TEST_INCLUDE_FILES` directory property was added to
  59. list any number of files to be included when running tests with
  60. :manual:`ctest(1)`. This generalizes the :prop_dir:`TEST_INCLUDE_FILE`
  61. property.
  62. * The :prop_tgt:`VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname>`
  63. target property was added to support custom XML tags for reference
  64. assemblies in C# targets.
  65. * Source file properties :prop_sf:`VS_SHADER_OUTPUT_HEADER_FILE` and
  66. :prop_sf:`VS_SHADER_VARIABLE_NAME` have been added to specify more
  67. details of ``.hlsl`` sources with :ref:`Visual Studio Generators`.
  68. Modules
  69. -------
  70. * The :module:`FindCurses` module gained a ``CURSES_NEED_WIDE`` option
  71. to request the wide-character variant.
  72. * The :module:`FindEXPAT` module now provides imported targets.
  73. * The :module:`FindFreetype` module now provides imported targets.
  74. * :module:`FindMPI` gained a number of new features, including:
  75. * Language-specific components have been added to the module.
  76. * Many more MPI environments are now supported.
  77. * The environmental support for Fortran has been improved.
  78. * A user now has fine-grained control over the MPI selection process,
  79. including passing custom parameters to the MPI compiler.
  80. * The version of the implemented MPI standard is now being exposed.
  81. * MPI-2 C++ bindings can now be detected and also suppressed if so desired.
  82. * The available Fortran bindings are now being detected and verified.
  83. * Various MPI-3 information can be requested, including the library version
  84. and Fortran capabilities of the individual bindings.
  85. * Statically linked MPI implementations are supported.
  86. * A :module:`FindOpenACC` module was added to detect compiler support
  87. for OpenACC. Currently only supports PGI, GNU and Cray compilers.
  88. * The :module:`FindOpenGL` module gained support for GLVND on Linux.
  89. * The :module:`FindOpenMP` module gained support for
  90. language-specific components.
  91. * A :module:`FindPatch` module was added to find the ``patch``
  92. command-line executable.
  93. * The :module:`FindProtobuf` module :command:`protobuf_generate_cpp` command
  94. gained a ``DESCRIPTORS`` option to generate descriptor files.
  95. * The :module:`GoogleTest` module gained a new command
  96. :command:`gtest_discover_tests` implementing dynamic (build-time) test
  97. discovery. Unlike the source parsing approach, dynamic discovery executes
  98. the test (in 'list available tests' mode) at build time to discover tests.
  99. This is robust against unusual ways of labeling tests, provides much better
  100. support for advanced features such as parameterized tests, and does not
  101. require re-running CMake to discover added or removed tests within a test
  102. executable.
  103. * The :module:`InstallRequiredSystemLibraries` module gained support
  104. for installing Intel compiler runtimes.
  105. Autogen
  106. -------
  107. * When using :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` with a
  108. multi configuration generator (e.g. :generator:`Xcode`),
  109. included ``*.moc``, ``moc_*.cpp`` and ``ui_*.h`` files are generated in
  110. ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>`` instead of
  111. ``<AUTOGEN_BUILD_DIR>/include``.
  112. * When using :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC`,
  113. source files that are :prop_sf:`GENERATED` will be processed as well.
  114. They were ignored by :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`
  115. in earlier releases.
  116. See policy :policy:`CMP0071`.
  117. * When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``,
  118. ``Q_GADGET`` or ``Q_NAMESPACE`` in a source file to determine if it needs
  119. to be ``moc`` processed. The new :variable:`CMAKE_AUTOMOC_MACRO_NAMES`
  120. variable and :prop_tgt:`AUTOMOC_MACRO_NAMES` target property may be set
  121. to register additional strings (macro names) to search for.
  122. * When using :prop_tgt:`AUTOMOC`, the new
  123. :variable:`CMAKE_AUTOMOC_COMPILER_PREDEFINES` variable and
  124. :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES` target property specify whether
  125. to enable or disable the generation of the compiler pre definitions file
  126. ``moc_predefs.h``.
  127. CTest
  128. -----
  129. * A :variable:`CTEST_LABELS_FOR_SUBPROJECTS` CTest module variable and CTest
  130. script variable were added to specify a list of labels that should be
  131. treated as subprojects by CDash. To use this value in both the CTest module
  132. and the ctest command line :ref:`Dashboard Client` mode (e.g. ``ctest -S``)
  133. set it in the ``CTestConfig.cmake`` config file.
  134. CPack
  135. -----
  136. * CPack gained a ``FREEBSD`` generator for FreeBSD ``pkg(8)``, configured
  137. by the :module:`CPackFreeBSD` module.
  138. * The CPack ``DEB`` generator, configured by the :module:`CPackDeb` module,
  139. was enabled on Windows. While not fully featured (due to the lack of
  140. external UNIX tools) this will allow building basic cross-platform Debian
  141. packages.
  142. * The :module:`CPackDeb` module learned to set package release version in
  143. ``Version`` info property.
  144. See the :variable:`CPACK_DEBIAN_PACKAGE_RELEASE` variable.
  145. * The :module:`CPackDeb` module learned more strict package version checking
  146. that complies with Debian rules.
  147. * The :module:`CPackIFW` module :command:`cpack_ifw_configure_component` and
  148. :command:`cpack_ifw_configure_component_group` commands gained a new
  149. ``REPLACES`` and ``CHECKABLE`` options.
  150. * The :module:`CPackIFW` module gained new
  151. :variable:`CPACK_IFW_PACKAGE_FILE_EXTENSION` variable to customize
  152. target binary format.
  153. * The :module:`CPackIFW` module gained new
  154. :variable:`CPACK_IFW_REPOSITORIES_DIRECTORIES` variable to specify
  155. additional repositories dirs that will be used to resolve and
  156. repack dependent components. This feature is only available when
  157. using QtIFW 3.1 or later.
  158. * Modules :module:`CPackRPM` and :module:`CPackDeb` learned to set package epoch
  159. version.
  160. See :variable:`CPACK_RPM_PACKAGE_EPOCH` and
  161. :variable:`CPACK_DEBIAN_PACKAGE_EPOCH` variables.
  162. Other
  163. -----
  164. * The :manual:`cmake(1)` ``-E`` mode gained support for ``sha1sum``,
  165. ``sha224sum``, ``sha256sum``, ``sha384sum``, and ``sha512sum``.
  166. * The graphviz output now distinguishes among the different dependency types
  167. ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` and represents them in the output
  168. graph as solid, dashed and dotted edges.
  169. Deprecated and Removed Features
  170. ===============================
  171. * Support for building CMake itself with C++98 compilers was dropped.
  172. CMake is now implemented using C++11.
  173. * Support for building CMake on HP-UX has been dropped pending better
  174. support for C++11 and a port of libuv. See `CMake Issue 17137`_.
  175. Use CMake 3.9 or lower instead for HP-UX support.
  176. .. _`CMake Issue 17137`: https://gitlab.kitware.com/cmake/cmake/issues/17137
  177. Other Changes
  178. =============
  179. * On FreeBSD the C++ compiler named ``c++`` is now the preferred default.
  180. * The :command:`file(GENERATE)` command now interprets relative paths
  181. given to its ``OUTPUT`` and ``INPUT`` arguments with respect to the
  182. caller's current binary and source directories, respectively.
  183. See policy :policy:`CMP0070`.
  184. * The :command:`get_filename_component` ``PROGRAM`` mode semantics
  185. have been revised to not tolerate unquoted spaces in the path
  186. to the program while also accepting arguments. While technically
  187. incompatible with the old behavior, it is expected that behavior
  188. under typical use cases with properly-quoted command-lines has
  189. not changed.