3.3.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. CMake 3.3 Release Notes
  2. ***********************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.2 include the following.
  6. New Features
  7. ============
  8. Generators
  9. ----------
  10. * The :ref:`Makefile Generators` now add ``.DELETE_ON_ERROR`` to the
  11. makefiles that contain the actual build rules for files on disk.
  12. This tells GNU make to remove rule outputs when their recipe
  13. modifies an output but fails.
  14. * The :ref:`Visual Studio Generators` learned to support ``.xaml``
  15. source files and automatically associate them with corresponding
  16. ``.h`` and ``.cpp`` sources.
  17. * A new experimental :generator:`Green Hills MULTI` generator was
  18. added on Windows. `Green Hills MULTI`_ is an IDE for embedded
  19. real-time systems.
  20. .. _`Green Hills MULTI`: http://www.ghs.com/products/MULTI_IDE.html
  21. Commands
  22. --------
  23. * The :command:`add_dependencies` command learned to allow dependencies
  24. to be added to :ref:`interface libraries <Interface Libraries>`.
  25. Dependencies added to an interface library are followed transitively
  26. in its place since the target itself does not build.
  27. * The :command:`execute_process` command learned to support specifying
  28. the same file for ``OUTPUT_FILE`` and ``ERROR_FILE``.
  29. * The :command:`file(GLOB)` and :command:`file(GLOB_RECURSE)` commands
  30. learned a new ``LIST_DIRECTORIES <bool>`` option to specify whether
  31. the glob result should include directories.
  32. * The :command:`find_library`, :command:`find_path`, and :command:`find_file`
  33. commands now search in installation prefixes derived from the ``PATH``
  34. environment variable.
  35. * The :command:`if` command learned a new ``IN_LIST`` operator that
  36. evaluates to true if a given element is contained in a named list.
  37. * The :command:`install(EXPORT)` and :command:`export()` commands
  38. learned to export targets that populate the :prop_tgt:`INTERFACE_SOURCES`
  39. target property.
  40. * The :command:`install(TARGETS)` command learned to support
  41. generator expressions in the ``DESTINATION`` value.
  42. Variables
  43. ---------
  44. * The version of some Fortran compilers is now detected and stored in the
  45. :variable:`CMAKE_Fortran_COMPILER_VERSION <CMAKE_<LANG>_COMPILER_VERSION>`
  46. variable.
  47. * The :ref:`Visual Studio Generators` learned a new
  48. :variable:`CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD` option
  49. to put the ``INSTALL`` target in the default build of a
  50. solution (``.sln``) file.
  51. Properties
  52. ----------
  53. * A :prop_tgt:`CROSSCOMPILING_EMULATOR` target property and supporting
  54. :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable were introduced
  55. to allow target platform binaries to run on the host during cross
  56. compiling.
  57. * A :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE` target property and supporting
  58. :variable:`CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE` variable were introduced
  59. to tell the :ref:`Makefile Generators` and the :generator:`Ninja` generator
  60. to run ``include-what-you-use`` along with the compiler for ``C`` and
  61. ``CXX`` languages.
  62. * The :prop_tgt:`<LANG>_VISIBILITY_PRESET` and
  63. :prop_tgt:`VISIBILITY_INLINES_HIDDEN` target properties now
  64. affect compilation in sources of all target types. See
  65. policy :policy:`CMP0063`.
  66. * The :prop_tgt:`XCODE_ATTRIBUTE_<an-attribute>` target property learned
  67. to support generator expressions.
  68. Modules
  69. -------
  70. * The :module:`CheckFortranCompilerFlag` module was introduced
  71. to check ``Fortran`` compiler flags, much like the
  72. :module:`CheckCCompilerFlag` module already does for ``C``.
  73. * The :module:`ExternalData` module learned a new
  74. :variable:`ExternalData_NO_SYMLINKS` option to disable use of
  75. symbolic links to populate the real data files and use copies
  76. instead.
  77. * The :module:`ExternalData` module learned a new ``RECURSE:``
  78. option in ``DATA{}`` references specifying directories.
  79. This allows an entire directory tree of associated files
  80. to be matched.
  81. * The :module:`ExternalData` module learned a new URL template
  82. placeholder ``%(algo:<key>)`` to allow custom mapping from
  83. algorithm name to URL component through configuration of new
  84. :variable:`ExternalData_URL_ALGO_<algo>_<key>` variables.
  85. This allows more flexibility in remote URLs.
  86. * The :module:`ExternalProject` module learned to replace tokens
  87. like ``<BINARY_DIR>`` in the ``BYPRODUCTS`` of each step.
  88. * The :module:`ExternalProject` module APIs learned to support
  89. :manual:`generator expressions <cmake-generator-expressions(7)>`
  90. when using ``LOG_*`` options and in CMake initial cache options.
  91. * The :module:`FindBoost` module now tracks the directories containing
  92. libraries separately for RELEASE and DEBUG configurations.
  93. * The :module:`FindCUDA` module now defaults to using the static
  94. CUDA runtime library if it is available. A new
  95. ``CUDA_USE_STATIC_CUDA_RUNTIME`` option is offered to control
  96. this behavior.
  97. * The :module:`FindMatlab` module was completely rewritten. It learned
  98. about versions and components and to find Matlab in a more precise and
  99. multiplatform way. The module now offers APIs to create mex extensions,
  100. documentation, and unit tests.
  101. * The :module:`FindPackageHandleStandardArgs` module
  102. ``FIND_PACKAGE_HANDLE_STANDARD_ARGS`` function now
  103. always populates both the ``<PackageName>_FOUND``
  104. and ``<UPPERCASE_NAME>_FOUND`` variables (the latter
  105. for backwards compatibility). The ``FOUND_VAR``
  106. option is now ignored except to enforce its allowed
  107. values.
  108. * The :module:`InstallRequiredSystemLibraries` module learned a new
  109. ``CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT`` option to specify the
  110. installation component.
  111. Generator Expressions
  112. ---------------------
  113. * A new ``COMPILE_LANGUAGE`` generator expression was introduced to
  114. allow specification of compile options for target files based on the
  115. :prop_sf:`LANGUAGE` of each source file. Due to limitations of the
  116. underlying native build tools, this feature has varying support across
  117. generators. See the :manual:`cmake-generator-expressions(7)` manual
  118. for details.
  119. CTest
  120. -----
  121. * The :manual:`ctest(1)` tool learned a new ``--repeat-until-fail <n>``
  122. option to help find sporadic test failures.
  123. * The :module:`CTestCoverageCollectGCOV` module learned to support
  124. the same ``CTEST_CUSTOM_COVERAGE_EXCLUDE`` option as the
  125. :command:`ctest_coverage` command.
  126. CPack
  127. -----
  128. * The :manual:`cpack(1)` ``IFW`` generator and the :module:`CPackIFW`
  129. module learned to support Qt Framework Installer 2.0 tools.
  130. * The :module:`CPackDeb` module learned a new
  131. :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS`
  132. variable to specify per-component use of ``dpkg-shlibdeps``.
  133. * The :module:`CPackDeb` module learned a new
  134. :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS`
  135. option to specify per-component dependencies.
  136. * The :module:`CPackRPM` module learned to package symbolic links
  137. more cleanly and now supports directory symlinks with recent
  138. ``rpmbuild`` versions.
  139. * The :module:`CPackRPM` module learned a new
  140. :variable:`CPACK_RPM_ADDITIONAL_MAN_DIRS` variable to specify
  141. directories containing man pages for the brp-compress RPM macro.
  142. * The :module:`CPackRPM` module learned a new
  143. :variable:`CPACK_RPM_<component>_PACKAGE_ARCHITECTURE` variable
  144. to specify a component-specific package architecture.
  145. * The CPack WIX generator learned the new
  146. :prop_inst:`CPACK_START_MENU_SHORTCUTS`,
  147. :prop_inst:`CPACK_DESKTOP_SHORTCUTS` and
  148. :prop_inst:`CPACK_STARTUP_SHORTCUTS` installed file properties which can
  149. be used to install shorcuts in the Start Menu, on the Desktop and
  150. in the Startup Folder respectively.
  151. Other
  152. -----
  153. * The :manual:`Compile Features <cmake-compile-features(7)>` functionality
  154. is now aware of features supported by GNU compilers on Windows, versions
  155. 4.4 through 5.0.
  156. * The :manual:`cmake(1)` ``-E tar`` command learned a new
  157. ``--format<format>`` option to specify the archive format to
  158. be written.
  159. * On OS X, CMake learned to create XCTest bundles to test Frameworks
  160. and App Bundles within Xcode. The :module:`FindXCTest` module
  161. provides convenience functions to handle :prop_tgt:`XCTEST` bundles.
  162. Deprecated and Removed Features
  163. ===============================
  164. * On OS X the :manual:`cmake-gui(1)` no longer has the
  165. ``Install For Command Line Use`` menu item. Instead there
  166. is a ``How to Install For Command Line Use`` menu item
  167. that shows an informational dialog box explaining how to
  168. make the command line tools available. For example::
  169. /Applications/CMake.app/Contents/bin/cmake-gui --install
  170. * The :command:`ctest_build` and :command:`build_command` commands
  171. no longer tell ``make`` tools to ignore errors with the ``-i`` option.
  172. Previously this was done for :ref:`Makefile Generators` but not others.
  173. See policy :policy:`CMP0061`.
  174. * The :generator:`Visual Studio 10 2010` generator no longer checks
  175. for running VS IDEs with the project open or asks them to reload.
  176. This was originally done for VS 10 because it had been done for
  177. VS 7 through 9 to avoid prompting for every project in a solution.
  178. Since VS >= 10 allow the whole solution to reload at once they
  179. do not need CMake to help them.
  180. * The :generator:`Visual Studio 7` generator (.NET 2002) is now
  181. deprecated and will be removed in a future version of CMake.
  182. * The :generator:`Visual Studio 6` generator is now deprecated
  183. and will be removed in a future version of CMake.
  184. * The :command:`find_package` command no longer considers project
  185. build trees recently configured in a :manual:`cmake-gui(1)`.
  186. This was previously done only on Windows and is now never done.
  187. The ``NO_CMAKE_BUILDS_PATH`` option is now ignored if given
  188. and effectively always on.
  189. Projects may populate the :ref:`User Package Registry` to aid
  190. users building multiple dependent projects one after another.
  191. * The :command:`add_definitions()` command no longer causes a
  192. :prop_dir:`DEFINITIONS` directory property to be populated. See policy
  193. :policy:`CMP0059`.
  194. * With Visual Studio 7, 8, and 9 generators the value of the ``$(OutDir)``
  195. placeholder no longer evaluates to the configuration name. Projects
  196. should use ``$(ConfigurationName)`` for that instead.
  197. * Using the output of :command:`export()` with the :command:`install(FILES)`
  198. command is no longer allowed. See policy :policy:`CMP0062` for details.
  199. Other Changes
  200. =============
  201. * The :generator:`Ninja` generator now requires that calls to the
  202. :command:`add_custom_command` and :command:`add_custom_target`
  203. commands use the ``BYPRODUCTS`` option to explicitly specify any
  204. files generated by the custom commands that are not listed as
  205. outputs (perhaps because their timestamps are allowed to be older
  206. than the inputs). See policy :policy:`CMP0058`.
  207. * Build-time progress output of :ref:`Makefile Generators` has been improved.
  208. It no longer mixes progress and build rule messages during parallel builds.
  209. The link rule messages now have progress and are displayed as bold green
  210. instead of bold red (since red is often associated with an error message).
  211. * The :variable:`CMAKE_CFG_INTDIR` variable value for Visual Studio
  212. 7, 8, and 9 is now ``$(ConfigurationName)`` instead of ``$(OutDir)``.
  213. This should have no effect on the intended use cases of the variable.
  214. * Linking to library files by a full path in an implicit linker search
  215. directory (e.g. ``/usr/lib/libfoo.a``) no longer asks the linker to
  216. search for the library (e.g. ``-lfoo``) and now links by full path.
  217. See policy :policy:`CMP0060`.