3.2.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. CMake 3.2 Release Notes
  2. ***********************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.1 include the following.
  6. New Features
  7. ============
  8. Syntax
  9. ------
  10. * CMake learned to support unicode characters
  11. :ref:`encoded as UTF-8 <CMake Language Encoding>`
  12. on Windows. This was already supported on platforms whose
  13. system APIs accept UTF-8 encoded strings.
  14. Unicode characters may now be used in CMake code, paths to
  15. source files, configured files such as ``.h.in`` files, and
  16. other files read and written by CMake. Note that because CMake
  17. interoperates with many other tools, there may still be some
  18. limitations when using certain unicode characters.
  19. Commands
  20. --------
  21. * The :command:`add_custom_command` and :command:`add_custom_target`
  22. commands learned a new ``BYPRODUCTS`` option to specify files
  23. produced as side effects of the custom commands. These are not
  24. outputs because they do not always have to be newer than inputs.
  25. * The :command:`add_custom_command` and :command:`add_custom_target`
  26. commands learned a new ``USES_TERMINAL`` option to request that
  27. the command be given direct access to the terminal if possible.
  28. The :generator:`Ninja` generator will places such commands in the
  29. ``console`` :prop_gbl:`pool <JOB_POOLS>`. Build targets provided by CMake
  30. that are meant for individual interactive use, such as ``install``, are now
  31. placed in this pool.
  32. * A new :command:`continue` command was added that can be called inside loop
  33. contexts to end the current iteration and start the next one at the top of
  34. the loop block.
  35. * The :command:`file(LOCK)` subcommand was created to allow CMake
  36. processes to synchronize through file and directory locks.
  37. * The :command:`file(STRINGS)` now supports UTF-16LE, UTF-16BE,
  38. UTF-32LE, UTF-32BE as ``ENCODING`` options.
  39. * The :command:`install(EXPORT)` command now works with an absolute
  40. ``DESTINATION`` even if targets in the export set are installed
  41. with a destination or :ref:`usage requirements <Target Usage Requirements>`
  42. specified relative to the install prefix. The value of the
  43. :variable:`CMAKE_INSTALL_PREFIX` variable is hard-coded into the installed
  44. export file as the base for relative references.
  45. * The :command:`try_compile` command source file signature now honors
  46. link flags (e.g. :variable:`CMAKE_EXE_LINKER_FLAGS`) in the generated
  47. test project. See policy :policy:`CMP0056`.
  48. * The :command:`try_run` command learned to honor the ``LINK_LIBRARIES``
  49. option just as :command:`try_compile` already does.
  50. * The :command:`file(GENERATE)` command now generates the output file with
  51. the same permissions as the input file if set.
  52. * The :command:`file(GENERATE)` command can now generate files which are
  53. used as source files for buildsystem targets. Generated files
  54. automatically get their :prop_sf:`GENERATED` property set to ``TRUE``.
  55. Variables
  56. ---------
  57. * The :variable:`CMAKE_MATCH_COUNT` variable was introduced to record the
  58. number of matches made in the last regular expression matched in an
  59. :command:`if` command or a :command:`string` command.
  60. Properties
  61. ----------
  62. * An :prop_tgt:`ANDROID_API_MIN` target property was introduced to
  63. specify the minimum version to be targeted by the toolchain.
  64. * A :prop_sf:`VS_SHADER_FLAGS` source file property was added to specify
  65. additional shader flags to ``.hlsl`` files, for the Visual Studio
  66. generators.
  67. Modules
  68. -------
  69. * The :module:`ExternalData` module learned to support
  70. :ref:`Custom Fetch Scripts <ExternalData Custom Fetch Scripts>`.
  71. This allows projects to specify custom ``.cmake`` scripts for
  72. fetching data objects during the build.
  73. * The :module:`ExternalProject` module learned options to create
  74. independent external project step targets that do not depend
  75. on the builtin steps.
  76. * The :module:`ExternalProject` module :command:`ExternalProject_Add`
  77. command learned a new ``CMAKE_CACHE_DEFAULT_ARGS`` option to
  78. initialize cache values in the external project without setting
  79. them on future builds.
  80. * The :module:`ExternalProject` module :command:`ExternalProject_Add`
  81. command learned a new ``TEST_EXCLUDE_FROM_MAIN`` option to exclude
  82. tests from the main build.
  83. * The :module:`ExternalProject` module :command:`ExternalProject_Add`
  84. command learned a new ``UPDATE_DISCONNECTED`` option to avoid
  85. automatically updating the source tree checkout from version control.
  86. * The :module:`FindCUDA` module learned about the ``cusolver``
  87. library in CUDA 7.0.
  88. * The :module:`FindGit` module learned to find the ``git`` command-line tool
  89. that comes with GitHub for Windows installed in user home directories.
  90. * A :module:`FindGSL` module was introduced to find the
  91. GNU Scientific Library.
  92. * A :module:`FindIntl` module was introduced to find the
  93. Gettext ``libintl`` library.
  94. * The :module:`FindLATEX` module learned to support components.
  95. * The :module:`FindMPI` module learned to find MS-MPI on Windows.
  96. * The :module:`FindOpenSSL` module now reports ``crypto`` and ``ssl``
  97. libraries separately in ``OPENSSL_CRYPTO_LIBRARY`` and
  98. ``OPENSSL_SSL_LIBRARY``, respectively, to allow applications to
  99. link to one without the other.
  100. * The :module:`WriteCompilerDetectionHeader` module learned to
  101. create a define for portability of the ``cxx_thread_local`` feature.
  102. The define expands to either the C++11 ``thread_local`` keyword, or a
  103. pre-standardization compiler-specific equivalent, as appropriate.
  104. * The :module:`WriteCompilerDetectionHeader` module learned to create
  105. multiple output files per compiler and per language, instead of creating
  106. one large file.
  107. CTest
  108. -----
  109. * The :command:`ctest_coverage` command learned to support Delphi coverage.
  110. * The :command:`ctest_coverage` command learned to support Javascript coverage.
  111. * The :module:`CTestCoverageCollectGCOV` module was introduced as an
  112. alternative to the :command:`ctest_coverage` command for collecting
  113. ``gcov`` results for submission to CDash.
  114. CPack
  115. -----
  116. * The :module:`CPackRPM` module learned options to set per-component
  117. descriptions and summaries. See the
  118. :variable:`CPACK_RPM_<component>_PACKAGE_DESCRIPTION` and
  119. :variable:`CPACK_RPM_<component>_PACKAGE_SUMMARY` variables.
  120. * The :module:`CPackRPM` module learned options to specify
  121. requirements for pre- and post-install scripts. See the
  122. :variable:`CPACK_RPM_PACKAGE_REQUIRES_PRE` and
  123. :variable:`CPACK_RPM_PACKAGE_REQUIRES_POST` variables.
  124. * The :module:`CPackRPM` module learned options to specify
  125. requirements for pre- and post-uninstall scripts. See the
  126. :variable:`CPACK_RPM_PACKAGE_REQUIRES_PREUN` and
  127. :variable:`CPACK_RPM_PACKAGE_REQUIRES_POSTUN` variables.
  128. * The :module:`CPackRPM` module learned a new
  129. :variable:`CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX` variable to
  130. specify a component-specific value to use instead of
  131. :variable:`CPACK_PACKAGING_INSTALL_PREFIX`.
  132. * The :module:`CPackRPM` module learned a new
  133. :variable:`CPACK_RPM_RELOCATION_PATHS` variable to
  134. specify multiple relocation prefixes for a single rpm package.
  135. Other
  136. -----
  137. * The :manual:`cmake(1)` ``-E tar`` command now supports creating
  138. ``.xz``-compressed archives with the ``J`` flag.
  139. * The :manual:`cmake(1)` ``-E tar`` command learned a new
  140. ``--files-from=<file>`` option to specify file names using
  141. lines in a file to overcome command-line length limits.
  142. * The :manual:`cmake(1)` ``-E tar`` command learned a new
  143. ``--mtime=<date>`` option to specify the modification time
  144. recorded in tarball entries.
  145. * The :manual:`Compile Features <cmake-compile-features(7)>` functionality
  146. is now aware of features supported by more compilers, including:
  147. * Apple Clang (``AppleClang``) for Xcode versions 4.4 though 6.1.
  148. * GNU compiler versions 4.4 through 5.0 on UNIX and Apple (``GNU``).
  149. * Microsoft Visual Studio (``MSVC``) for versions 2010 through 2015.
  150. * Oracle SolarisStudio (``SunPro``) version 12.4.
  151. * The :ref:`Qt AUTORCC` feature now tracks files listed in ``.qrc`` files
  152. as dependencies. If an input file to the ``rcc`` tool is changed, the tool
  153. is automatically re-run.
  154. New Diagnostics
  155. ===============
  156. * The :command:`break` command now rejects calls outside of a loop
  157. context or that pass arguments to the command.
  158. See policy :policy:`CMP0055`.
  159. Deprecated and Removed Features
  160. ===============================
  161. * Files written in the :manual:`cmake-language(7)`, such as
  162. ``CMakeLists.txt`` or ``*.cmake`` files, are now expected to be
  163. encoded as UTF-8. If files are already ASCII, they will be
  164. compatible. If files were in a different encoding, including
  165. Latin 1, they will need to be converted.
  166. * The :module:`FindOpenGL` module no longer explicitly searches
  167. for any dependency on X11 libraries with the :module:`FindX11`
  168. module. Such dependencies should not need to be explicit.
  169. Applications using X11 APIs themselves should find and link
  170. to X11 libraries explicitly.
  171. * The implementation of CMake now relies on some C++ compiler features which
  172. are not supported by some older compilers. As a result, those old compilers
  173. can no longer be used to build CMake itself. CMake continues to be able to
  174. generate Makefiles and project files for users of those old compilers
  175. however. Compilers known to no longer be capable of building CMake are:
  176. * Visual Studio 6 and 7.0 -- superseded by VisualStudio 7.1 and newer.
  177. * GCC 2.95 -- superseded by GCC 3 and newer compilers.
  178. * Borland compilers -- superseded by other Windows compilers.
  179. * Compaq compilers -- superseded by other compilers.
  180. * SGI compilers -- IRIX was dropped as a host platform.
  181. Other Changes
  182. =============
  183. * On Windows and OS X, commands supporting network communication
  184. via ``https``, such as :command:`file(DOWNLOAD)`,
  185. :command:`file(UPLOAD)`, and :command:`ctest_submit`, now support
  186. SSL/TLS even when CMake is not built against OpenSSL.
  187. The Windows or OS X native SSL/TLS implementation is used by default.
  188. OS-configured certificate authorities will be trusted automatically.
  189. On other platforms, when CMake is built with OpenSSL, these
  190. commands now search for OS-configured certificate authorities
  191. in a few ``/etc`` paths to be trusted automatically.
  192. * On OS X with Makefile and Ninja generators, when a compiler is found
  193. in ``/usr/bin`` it is now mapped to the corresponding compiler inside
  194. the Xcode application folder, if any. This allows such build
  195. trees to continue to work with their original compiler even when
  196. ``xcode-select`` switches to a different Xcode installation.
  197. * The Visual Studio generators now write solution and project
  198. files in UTF-8 instead of Windows-1252. Windows-1252 supported
  199. Latin 1 languages such as those found in North and South America
  200. and Western Europe. With UTF-8, additional languages are now
  201. supported.
  202. * The :generator:`Xcode` generator no longer requires a value for
  203. the :variable:`CMAKE_MAKE_PROGRAM` variable to be located up front.
  204. It now locates ``xcodebuild`` when needed at build time.
  205. * When building CMake itself using SolarisStudio 12, the default ``libCStd``
  206. standard library is not sufficient to build CMake. The SolarisStudio
  207. distribution supports compiler options to use ``STLPort4`` or ``libstdc++``.
  208. An appropriate option to select the standard library is now added
  209. automatically when building CMake with SolarisStudio compilers.