3.10.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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. Note that a breaking change was made in CMake 3.10.3 to address
  103. an ambiguity of the ``TIMEOUT`` keyword (see :ref:`Release Notes 3.10.3`).
  104. * The :module:`InstallRequiredSystemLibraries` module gained support
  105. for installing Intel compiler runtimes.
  106. Autogen
  107. -------
  108. * When using :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` with a
  109. multi configuration generator (e.g. :generator:`Xcode`),
  110. included ``*.moc``, ``moc_*.cpp`` and ``ui_*.h`` files are generated in
  111. ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>`` instead of
  112. ``<AUTOGEN_BUILD_DIR>/include``.
  113. * When using :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC`,
  114. source files that are :prop_sf:`GENERATED` will be processed as well.
  115. They were ignored by :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`
  116. in earlier releases.
  117. See policy :policy:`CMP0071`.
  118. * When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``,
  119. ``Q_GADGET`` or ``Q_NAMESPACE`` in a source file to determine if it needs
  120. to be ``moc`` processed. The new :variable:`CMAKE_AUTOMOC_MACRO_NAMES`
  121. variable and :prop_tgt:`AUTOMOC_MACRO_NAMES` target property may be set
  122. to register additional strings (macro names) to search for.
  123. * When using :prop_tgt:`AUTOMOC`, the new
  124. :variable:`CMAKE_AUTOMOC_COMPILER_PREDEFINES` variable and
  125. :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES` target property specify whether
  126. to enable or disable the generation of the compiler pre definitions file
  127. ``moc_predefs.h``.
  128. CTest
  129. -----
  130. * A :variable:`CTEST_LABELS_FOR_SUBPROJECTS` CTest module variable and CTest
  131. script variable were added to specify a list of labels that should be
  132. treated as subprojects by CDash. To use this value in both the CTest module
  133. and the ctest command line :ref:`Dashboard Client` mode (e.g. ``ctest -S``)
  134. set it in the ``CTestConfig.cmake`` config file.
  135. CPack
  136. -----
  137. * CPack gained a ``FREEBSD`` generator for FreeBSD ``pkg(8)``, configured
  138. by the :module:`CPackFreeBSD` module.
  139. * The CPack ``DEB`` generator, configured by the :module:`CPackDeb` module,
  140. was enabled on Windows. While not fully featured (due to the lack of
  141. external UNIX tools) this will allow building basic cross-platform Debian
  142. packages.
  143. * The :module:`CPackDeb` module learned to set package release version in
  144. ``Version`` info property.
  145. See the :variable:`CPACK_DEBIAN_PACKAGE_RELEASE` variable.
  146. * The :module:`CPackDeb` module learned more strict package version checking
  147. that complies with Debian rules.
  148. * The :module:`CPackIFW` module :command:`cpack_ifw_configure_component` and
  149. :command:`cpack_ifw_configure_component_group` commands gained a new
  150. ``REPLACES`` and ``CHECKABLE`` options.
  151. * The :module:`CPackIFW` module gained new
  152. :variable:`CPACK_IFW_PACKAGE_FILE_EXTENSION` variable to customize
  153. target binary format.
  154. * The :module:`CPackIFW` module gained new
  155. :variable:`CPACK_IFW_REPOSITORIES_DIRECTORIES` variable to specify
  156. additional repositories dirs that will be used to resolve and
  157. repack dependent components. This feature is only available when
  158. using QtIFW 3.1 or later.
  159. * Modules :module:`CPackRPM` and :module:`CPackDeb` learned to set package epoch
  160. version.
  161. See :variable:`CPACK_RPM_PACKAGE_EPOCH` and
  162. :variable:`CPACK_DEBIAN_PACKAGE_EPOCH` variables.
  163. Other
  164. -----
  165. * The :manual:`cmake(1)` ``-E`` mode gained support for ``sha1sum``,
  166. ``sha224sum``, ``sha256sum``, ``sha384sum``, and ``sha512sum``.
  167. * The graphviz output now distinguishes among the different dependency types
  168. ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` and represents them in the output
  169. graph as solid, dashed and dotted edges.
  170. Deprecated and Removed Features
  171. ===============================
  172. * Support for building CMake itself with C++98 compilers was dropped.
  173. CMake is now implemented using C++11.
  174. * Support for building CMake on HP-UX has been dropped pending better
  175. support for C++11 and a port of libuv. See `CMake Issue 17137`_.
  176. Use CMake 3.9 or lower instead for HP-UX support.
  177. .. _`CMake Issue 17137`: https://gitlab.kitware.com/cmake/cmake/issues/17137
  178. Other Changes
  179. =============
  180. * On FreeBSD the C++ compiler named ``c++`` is now the preferred default.
  181. * The :command:`file(GENERATE)` command now interprets relative paths
  182. given to its ``OUTPUT`` and ``INPUT`` arguments with respect to the
  183. caller's current binary and source directories, respectively.
  184. See policy :policy:`CMP0070`.
  185. * The :command:`get_filename_component` ``PROGRAM`` mode semantics
  186. have been revised to not tolerate unquoted spaces in the path
  187. to the program while also accepting arguments. While technically
  188. incompatible with the old behavior, it is expected that behavior
  189. under typical use cases with properly-quoted command-lines has
  190. not changed.
  191. Updates
  192. =======
  193. Changes made since CMake 3.10.0 include the following.
  194. 3.10.1
  195. ------
  196. * The :manual:`cmake-server(7)` ``codemodel`` response ``crossReferences``
  197. field added by 3.10.0 has been dropped due to excessive memory usage.
  198. Another approach will be needed to provide backtrace information.
  199. .. _`Release Notes 3.10.3`:
  200. 3.10.3
  201. ------
  202. * CMake 3.10.1 added a ``TIMEOUT`` option to :command:`gtest_discover_tests`
  203. from the :module:`GoogleTest` module. That keyword clashed with the
  204. ``TIMEOUT`` test property, which is one of the common properties that
  205. would be set with the command's ``PROPERTIES`` keyword, usually leading
  206. to legal but unintended behavior. The keyword was changed to
  207. ``DISCOVERY_TIMEOUT`` in CMake 3.10.3 to address this problem. The
  208. ambiguous behavior of the :command:`gtest_discover_tests` command's
  209. ``TIMEOUT`` keyword in 3.10.1 and 3.10.2 has not been preserved.