3.1.0.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. CMake 3.1.0 Release Notes
  2. *************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.0.0 include the following.
  6. Documentation Changes
  7. =====================
  8. * A new :manual:`cmake-compile-features(7)` manual was added.
  9. New Features
  10. ============
  11. Generators
  12. ----------
  13. * The :generator:`Visual Studio 14 2015` generator was added.
  14. Windows Phone and Windows Store
  15. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  16. * Generators for Visual Studio 11 (2012) and above learned to generate
  17. projects for Windows Phone and Windows Store. One may set the
  18. :variable:`CMAKE_SYSTEM_NAME` variable to ``WindowsPhone``
  19. or ``WindowsStore`` on the :manual:`cmake(1)` command-line
  20. or in a :variable:`CMAKE_TOOLCHAIN_FILE` to activate these platforms.
  21. Also set :variable:`CMAKE_SYSTEM_VERSION` to ``8.0`` or ``8.1`` to
  22. specify the version of Windows to be targeted.
  23. NVIDIA Nsight Tegra
  24. ^^^^^^^^^^^^^^^^^^^
  25. * Generators for Visual Studio 10 (2010) and above learned to generate
  26. projects for NVIDIA Nsight Tegra Visual Studio Edition. One may set
  27. the :variable:`CMAKE_SYSTEM_NAME` variable to ``Android`` on the
  28. :manual:`cmake(1)` command-line or in a :variable:`CMAKE_TOOLCHAIN_FILE`
  29. to activate this platform.
  30. Syntax
  31. ------
  32. * The :manual:`cmake-language(7)` syntax for :ref:`Variable References` and
  33. :ref:`Escape Sequences` was simplified in order to allow a much faster
  34. implementation. See policy :policy:`CMP0053`.
  35. * The :command:`if` command no longer automatically dereferences
  36. variables named in quoted or bracket arguments. See policy
  37. :policy:`CMP0054`.
  38. Commands
  39. --------
  40. * The :command:`add_custom_command` command learned to interpret
  41. :manual:`cmake-generator-expressions(7)` in arguments to ``DEPENDS``.
  42. * The :command:`export(PACKAGE)` command learned to check the
  43. :variable:`CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable to skip
  44. exporting the package.
  45. * The :command:`file(STRINGS)` command gained a new ``ENCODING``
  46. option to enable extraction of ``UTF-8`` strings.
  47. * The :command:`find_package` command learned to check the
  48. :variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` and
  49. :variable:`CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY`
  50. variables to skip searching the package registries.
  51. * The :command:`install` command learned a ``MESSAGE_NEVER`` option
  52. to avoid output during installation.
  53. * The :command:`string` command learned a new ``GENEX_STRIP`` subcommand
  54. which removes
  55. :manual:`generator expression <cmake-generator-expressions(7)>`.
  56. * The :command:`string` command learned a new ``UUID`` subcommand
  57. to generate a univerally unique identifier.
  58. * New :command:`target_compile_features` command allows populating the
  59. :prop_tgt:`COMPILE_FEATURES` target property, just like any other
  60. build variable.
  61. * The :command:`target_sources` command was added to add to the
  62. :prop_tgt:`SOURCES` target property.
  63. Variables
  64. ---------
  65. * The Visual Studio generators for versions 8 (2005) and above
  66. learned to read the target platform name from a new
  67. :variable:`CMAKE_GENERATOR_PLATFORM` variable when it is
  68. not specified as part of the generator name. The platform
  69. name may be specified on the :manual:`cmake(1)` command line
  70. with the ``-A`` option, e.g. ``-G "Visual Studio 12 2013" -A x64``.
  71. * The :variable:`CMAKE_GENERATOR_TOOLSET` variable may now be
  72. initialized in a toolchain file specified by the
  73. :variable:`CMAKE_TOOLCHAIN_FILE` variable. This is useful
  74. when cross-compiling with the Xcode or Visual Studio
  75. generators.
  76. * The :variable:`CMAKE_INSTALL_MESSAGE` variable was introduced to
  77. optionally reduce output installation.
  78. Properties
  79. ----------
  80. * New :prop_tgt:`CXX_STANDARD` and :prop_tgt:`CXX_EXTENSIONS` target
  81. properties may specify values which CMake uses to compute required
  82. compile options such as ``-std=c++11`` or ``-std=gnu++11``. The
  83. :variable:`CMAKE_CXX_STANDARD` and :variable:`CMAKE_CXX_EXTENSIONS`
  84. variables may be set to initialize the target properties.
  85. * New :prop_tgt:`C_STANDARD` and :prop_tgt:`C_EXTENSIONS` target
  86. properties may specify values which CMake uses to compute required
  87. compile options such as ``-std=c11`` or ``-std=gnu11``. The
  88. :variable:`CMAKE_C_STANDARD` and :variable:`CMAKE_C_EXTENSIONS`
  89. variables may be set to initialize the target properties.
  90. * New :prop_tgt:`COMPILE_FEATURES` target property may contain a list
  91. of features required to compile a target. CMake uses this
  92. information to ensure that the compiler in use is capable of building
  93. the target, and to add any necessary compile flags to support language
  94. features.
  95. * New :prop_tgt:`COMPILE_PDB_NAME` and
  96. :prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY` target properties
  97. were introduced to specify the MSVC compiler program database
  98. file location (``cl /Fd``). This complements the existing
  99. :prop_tgt:`PDB_NAME` and :prop_tgt:`PDB_OUTPUT_DIRECTORY`
  100. target properties that specify the linker program database
  101. file location (``link /pdb``).
  102. * The :prop_tgt:`INTERFACE_LINK_LIBRARIES` target property now supports
  103. a ``$<LINK_ONLY:...>``
  104. :manual:`generator expression <cmake-generator-expressions(7)>`.
  105. * A new :prop_tgt:`INTERFACE_SOURCES` target property was introduced. This is
  106. consumed by dependent targets, which compile and link the listed sources.
  107. * The :prop_tgt:`SOURCES` target property now contains
  108. :manual:`generator expression <cmake-generator-expressions(7)>`
  109. such as ``TARGET_OBJECTS`` when read at configure time, if
  110. policy :policy:`CMP0051` is ``NEW``.
  111. * The :prop_tgt:`SOURCES` target property now generally supports
  112. :manual:`generator expression <cmake-generator-expressions(7)>`. The
  113. generator expressions may be used in the :command:`add_library` and
  114. :command:`add_executable` commands.
  115. * It is now possible to write and append to the :prop_tgt:`SOURCES` target
  116. property. The :variable:`CMAKE_DEBUG_TARGET_PROPERTIES` variable may be
  117. used to trace the origin of sources.
  118. * A :prop_sf:`VS_DEPLOYMENT_CONTENT` source file property was added
  119. to tell the Visual Studio generators to mark content for deployment
  120. in Windows Phone and Windows Store projects.
  121. * The :prop_tgt:`VS_WINRT_COMPONENT` target property was created to
  122. tell Visual Studio generators to compile a shared library as a
  123. Windows Runtime (WinRT) component.
  124. * The :generator:`Xcode` generator learned to check source
  125. file properties :prop_sf:`XCODE_EXPLICIT_FILE_TYPE` and
  126. :prop_sf:`XCODE_LAST_KNOWN_FILE_TYPE` for a custom Xcode
  127. file reference type.
  128. Modules
  129. -------
  130. * The :module:`BundleUtilities` module learned to resolve and replace
  131. ``@rpath`` placeholders on OS X to correctly bundle applications
  132. using them.
  133. * The :module:`CMakePackageConfigHelpers` module
  134. :command:`configure_package_config_file` command learned a new
  135. ``INSTALL_PREFIX`` option to generate package configuration files
  136. meant for a prefix other than :variable:`CMAKE_INSTALL_PREFIX`.
  137. * The :module:`CheckFortranSourceCompiles` module was added to
  138. provide a ``CHECK_Fortran_SOURCE_COMPILES`` macro.
  139. * The :module:`ExternalData` module learned to tolerate a ``DATA{}``
  140. reference to a missing source file with a warning instead of
  141. rejecting it with an error. This helps developers write new
  142. ``DATA{}`` references to test reference outputs that have not
  143. yet been created.
  144. * The :module:`ExternalProject` module learned to support lzma-compressed
  145. source tarballs with ``.7z``, ``.tar.xz``, and ``.txz`` extensions.
  146. * The :module:`ExternalProject` module ``ExternalProject_Add`` command
  147. learned a new ``BUILD_ALWAYS`` option to cause the external project
  148. build step to run every time the host project is built.
  149. * The :module:`ExternalProject` module ``ExternalProject_Add`` command
  150. learned a new ``EXCLUDE_FROM_ALL`` option to cause the external
  151. project target to have the :prop_tgt:`EXCLUDE_FROM_ALL` target
  152. property set.
  153. * The :module:`ExternalProject` module ``ExternalProject_Add_Step`` command
  154. learned a new ``EXCLUDE_FROM_MAIN`` option to cause the step to not be
  155. a direct dependency of the main external project target.
  156. * The :module:`ExternalProject` module ``ExternalProject_Add`` command
  157. learned a new ``DOWNLOAD_NO_PROGRESS`` option to disable progress
  158. output while downloading the source tarball.
  159. * The :module:`FeatureSummary` module ``feature_summary`` API
  160. learned to accept multiple values for the ``WHAT`` option and
  161. combine them appropriately.
  162. * The :module:`FindCUDA` module learned to support ``fatbin`` and ``cubin``
  163. modules.
  164. * The :module:`FindGTest` module ``gtest_add_tests`` macro learned
  165. a new ``AUTO`` option to automatically read the :prop_tgt:`SOURCES`
  166. target property of the test executable and scan the source files
  167. for tests to be added.
  168. * The :module:`FindGLEW` module now provides imported targets.
  169. * The :module:`FindGLUT` module now provides imported targets.
  170. * The :module:`FindHg` module gained a new ``Hg_WC_INFO`` macro to
  171. help run ``hg`` to extract information about a Mercurial work copy.
  172. * The :module:`FindOpenCL` module was introduced.
  173. * The :module:`FindOpenGL` module now provides imported targets
  174. ``OpenGL::GL`` and ``OpenGL::GLU`` when the libraries are found.
  175. * The :module:`FindOpenMP` module learned to support Fortran.
  176. * The :module:`FindPkgConfig` module learned to use the ``PKG_CONFIG``
  177. environment variable value as the ``pkg-config`` executable, if set.
  178. * The :module:`FindZLIB` module now provides imported targets.
  179. * The :module:`GenerateExportHeader` module ``generate_export_header``
  180. function learned to allow use with :ref:`Object Libraries`.
  181. * The :module:`InstallRequiredSystemLibraries` module gained a new
  182. ``CMAKE_INSTALL_OPENMP_LIBRARIES`` option to install MSVC OpenMP
  183. runtime libraries.
  184. * The :module:`UseSWIG` module learned to detect the module name
  185. from ``.i`` source files if possible to avoid the need to set
  186. the ``SWIG_MODULE_NAME`` source file property explicitly.
  187. * The :module:`WriteCompilerDetectionHeader` module was added to allow
  188. creation of a portable header file for compiler optional feature detection.
  189. Generator Expressions
  190. ---------------------
  191. * New ``COMPILE_FEATURES``
  192. :manual:`generator expression <cmake-generator-expressions(7)>` allows
  193. setting build properties based on available compiler features.
  194. CTest
  195. -----
  196. * The :command:`ctest_coverage` command learned to read variable
  197. ``CTEST_COVERAGE_EXTRA_FLAGS`` to set ``CoverageExtraFlags``.
  198. * The :command:`ctest_coverage` command learned to support
  199. Intel coverage files with the ``codecov`` tool.
  200. * The :command:`ctest_memcheck` command learned to support sanitizer
  201. modes, including ``AddressSanitizer``, ``MemorySanitizer``,
  202. ``ThreadSanitizer``, and ``UndefinedBehaviorSanitizer``.
  203. Options may be set using the new
  204. :variable:`CTEST_MEMORYCHECK_SANITIZER_OPTIONS` variable.
  205. CPack
  206. -----
  207. * :manual:`cpack(1)` gained an ``IFW`` generator to package using
  208. Qt Framework Installer tools. See the :module:`CPackIFW` module.
  209. * :manual:`cpack(1)` gained ``7Z`` and ``TXZ`` generators supporting
  210. lzma-compressed archives.
  211. * The :module:`CPackDeb` module learned a new
  212. :variable:`CPACK_DEBIAN_COMPRESSION_TYPE` variable to set the
  213. tarball compression type.
  214. * The :manual:`cpack(1)` ``WiX`` generator learned to support
  215. a :prop_inst:`CPACK_WIX_ACL` installed file property to
  216. specify an Access Control List.
  217. Other
  218. -----
  219. * The :manual:`cmake(1)` ``-E`` option learned a new ``env`` command.
  220. * The :manual:`cmake(1)` ``-E tar`` command learned to support
  221. lzma-compressed files.
  222. * :ref:`Object Libraries` may now have extra sources that do not
  223. compile to object files so long as they would not affect linking
  224. of a normal library (e.g. ``.dat`` is okay but not ``.def``).
  225. * Visual Studio generators for VS 8 and later learned to support
  226. the ``ASM_MASM`` language.
  227. * The Visual Studio generators learned to treat ``.hlsl`` source
  228. files as High Level Shading Language sources (using ``FXCompile``
  229. in ``.vcxproj`` files). A :prop_sf:`VS_SHADER_TYPE` source file
  230. property was added to specify the Shader Type.
  231. New Diagnostics
  232. ===============
  233. * Policy :policy:`CMP0052` introduced to control directories in the
  234. :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` of exported targets.
  235. Deprecated and Removed Features
  236. ===============================
  237. * In CMake 3.0 the :command:`target_link_libraries` command
  238. accidentally began allowing unquoted arguments to use
  239. :manual:`generator expressions <cmake-generator-expressions(7)>`
  240. containing a (``;`` separated) list within them. For example::
  241. set(libs B C)
  242. target_link_libraries(A PUBLIC $<BUILD_INTERFACE:${libs}>)
  243. This is equivalent to writing::
  244. target_link_libraries(A PUBLIC $<BUILD_INTERFACE:B C>)
  245. and was never intended to work. It did not work in CMake 2.8.12.
  246. Such generator expressions should be in quoted arguments::
  247. set(libs B C)
  248. target_link_libraries(A PUBLIC "$<BUILD_INTERFACE:${libs}>")
  249. CMake 3.1 again requires the quotes for this to work correctly.
  250. * Callbacks established by the :command:`variable_watch` command will no
  251. longer receive the ``ALLOWED_UNKNOWN_READ_ACCESS`` access type when
  252. the undocumented ``CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS`` variable is
  253. set. Uninitialized variable accesses will always be reported as
  254. ``UNKNOWN_READ_ACCESS``.
  255. * The :module:`CMakeDetermineVSServicePack` module now warns that
  256. it is deprecated and should not longer be used. Use the
  257. :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable instead.
  258. * The :module:`FindITK` module has been removed altogether.
  259. It was a thin-wrapper around ``find_package(ITK ... NO_MODULE)``.
  260. This produces much clearer error messages when ITK is not found.
  261. * The :module:`FindVTK` module has been removed altogether.
  262. It was a thin-wrapper around ``find_package(VTK ... NO_MODULE)``.
  263. This produces much clearer error messages when VTK is not found.
  264. The module also provided compatibility support for finding VTK 4.0.
  265. This capability has been dropped.
  266. Other Changes
  267. =============
  268. * The :manual:`cmake-gui(1)` learned to capture output from child
  269. processes started by the :command:`execute_process` command
  270. and display it in the output window.
  271. * The :manual:`cmake-language(7)` internal implementation of generator
  272. expression and list expansion parsers have been optimized and shows
  273. non-trivial speedup on large projects.
  274. * The Makefile generators learned to use response files with GNU tools
  275. on Windows to pass library directories and names to the linker.
  276. * When generating linker command-lines, CMake now avoids repeating
  277. items corresponding to SHARED library targets.
  278. * Support for the Open Watcom compiler has been overhauled.
  279. The :variable:`CMAKE_<LANG>_COMPILER_ID` is now ``OpenWatcom``,
  280. and the :variable:`CMAKE_<LANG>_COMPILER_VERSION` now uses
  281. the Open Watcom external version numbering. The external
  282. version numbers are lower than the internal version number
  283. by 11.
  284. * The ``cmake-mode.el`` major Emacs editing mode no longer
  285. treats ``_`` as part of words, making it more consistent
  286. with other major modes.