3.6.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. CMake 3.6 Release Notes
  2. ***********************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.5 include the following.
  6. New Features
  7. ============
  8. Generators
  9. ----------
  10. * The :generator:`Ninja` generator learned to produce phony targets
  11. of the form ``sub/dir/all`` to drive the build of a subdirectory.
  12. This is equivalent to ``cd sub/dir; make all`` with
  13. :ref:`Makefile Generators`.
  14. * The :generator:`Ninja` generator now includes system header files in build
  15. dependencies to ensure correct re-builds when system packages are updated.
  16. * The :generator:`Visual Studio 14 2015` generator learned to support the
  17. Clang/C2 toolsets, e.g. with the ``-T v140_clang_3_7`` option.
  18. This feature is experimental.
  19. Commands
  20. --------
  21. * The :command:`add_custom_command` and :command:`add_custom_target` commands
  22. learned how to use the :prop_tgt:`CROSSCOMPILING_EMULATOR` executable
  23. target property.
  24. * The :command:`install` command learned a new ``EXCLUDE_FROM_ALL`` option
  25. to leave installation rules out of the default installation.
  26. * The :command:`list` command gained a ``FILTER`` sub-command to filter
  27. list elements by regular expression.
  28. * The :command:`string(TIMESTAMP)` and :command:`file(TIMESTAMP)`
  29. commands gained support for the ``%s`` placeholder. This is
  30. the number of seconds since the UNIX Epoch.
  31. Variables
  32. ---------
  33. * A :variable:`CMAKE_DEPENDS_IN_PROJECT_ONLY` variable was introduced
  34. to tell :ref:`Makefile Generators` to limit dependency scanning only
  35. to files in the project source and build trees.
  36. * A new :variable:`CMAKE_HOST_SOLARIS` variable was introduced to
  37. indicate when CMake is running on an Oracle Solaris host.
  38. * A :variable:`CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` variable was
  39. added for use by toolchain files to specify system include directories
  40. to be appended to all compiler command lines.
  41. * The :variable:`CMAKE_<LANG>_STANDARD_LIBRARIES` variable is now documented.
  42. It is intended for use by toolchain files to specify system libraries to be
  43. added to all linker command lines.
  44. * A :variable:`CMAKE_NINJA_OUTPUT_PATH_PREFIX` variable was introduced
  45. to tell the :generator:`Ninja` generator to configure the generated
  46. ``build.ninja`` file for use as a ``subninja``.
  47. * A :variable:`CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` variable was
  48. added for use by toolchain files to specify platform-specific
  49. variables that must be propagated by the :command:`try_compile`
  50. command into test projects.
  51. * A :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable was added
  52. to optionally tell the :command:`try_compile` command to build
  53. a static library instead of an executable. This is useful for
  54. cross-compiling toolchains that cannot link binaries without
  55. custom flags or scripts.
  56. Properties
  57. ----------
  58. * A :prop_tgt:`DEPLOYMENT_REMOTE_DIRECTORY` target property was introduced
  59. to tell the :generator:`Visual Studio 9 2008` and
  60. :generator:`Visual Studio 8 2005` generators to generate the "remote
  61. directory" for WinCE project deployment and debugger settings.
  62. * A :prop_tgt:`<LANG>_CLANG_TIDY` target property and supporting
  63. :variable:`CMAKE_<LANG>_CLANG_TIDY` variable were introduced to tell the
  64. :ref:`Makefile Generators` and the :generator:`Ninja` generator to run
  65. ``clang-tidy`` along with the compiler for ``C`` and ``CXX`` languages.
  66. * A :prop_test:`TIMEOUT_AFTER_MATCH` test property was introduced to
  67. optionally tell CTest to enforce a secondary timeout after matching
  68. certain output from a test.
  69. * A :prop_tgt:`VS_CONFIGURATION_TYPE` target property was introduced
  70. to specify a custom project file type for :ref:`Visual Studio Generators`
  71. supporting VS 2010 and above.
  72. * A :prop_dir:`VS_STARTUP_PROJECT` directory property was introduced
  73. to specify for :ref:`Visual Studio Generators` the default startup
  74. project for generated solutions (``.sln`` files).
  75. Modules
  76. -------
  77. * The :module:`CMakePushCheckState` module now pushes/pops/resets the variable
  78. ``CMAKE_EXTRA_INCLUDE_FILE`` used in :module:`CheckTypeSize`.
  79. * The :module:`ExternalProject` module leared the ``GIT_SHALLOW 1``
  80. option to perform a shallow clone of a Git repository.
  81. * The :module:`ExternalProject` module learned to initialize Git submodules
  82. recursively and also to initialize new submodules on updates. Use the
  83. ``GIT_SUBMODULES`` option to restrict which submodules are initialized and
  84. updated.
  85. * The :module:`ExternalProject` module leared the ``DOWNLOAD_NO_EXTRACT 1``
  86. argument to skip extracting the file that is downloaded (e.g., for
  87. self-extracting shell installers or ``.msi`` files).
  88. * The :module:`ExternalProject` module now uses ``TLS_VERIFY`` when fetching
  89. from git repositories.
  90. * The :module:`FindBLAS` and :module:`FindLAPACK` modules learned to
  91. support `OpenBLAS <http://www.openblas.net>`__.
  92. * The :module:`FindCUDA` module learned to find the ``cublas_device`` library.
  93. * The :module:`FindGTest` module ``gtest_add_tests`` function now causes
  94. CMake to automatically re-run when test sources change so that they
  95. can be re-scanned.
  96. * The :module:`FindLTTngUST` module was introduced to find the LTTng-UST
  97. library.
  98. * The :module:`FindPkgConfig` module learned to optionally create imported
  99. targets for the libraries it has found.
  100. * The :module:`FindProtobuf` module learned to provide a ``Protobuf_VERSION``
  101. variable and check the version number requested in a :command:`find_package`
  102. call.
  103. * The :module:`InstallRequiredSystemLibraries` module learned a new
  104. ``CMAKE_INSTALL_UCRT_LIBRARIES`` option to enable app-local deployment
  105. of the Windows Universal CRT libraries with Visual Studio 2015.
  106. Platforms
  107. ---------
  108. * The Clang compiler is now supported on CYGWIN.
  109. * Support was added for the Bruce C Compiler with compiler id ``Bruce``.
  110. CTest
  111. -----
  112. * The :command:`ctest_update` command now looks at the
  113. :variable:`CTEST_GIT_INIT_SUBMODULES` variable to determine whether
  114. submodules should be updated or not before updating.
  115. * The :command:`ctest_update` command will now synchronize submodules on an
  116. update. Updates which add submodules or change a submodule's URL will now be
  117. pulled properly.
  118. CPack
  119. -----
  120. * The :module:`CPackDeb` module learned how to handle ``$ORIGIN``
  121. in ``CMAKE_INSTALL_RPATH`` when :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS`
  122. is used for dependency auto detection.
  123. * The :module:`CPackDeb` module learned how to generate ``DEBIAN/shlibs``
  124. contorl file when package contains shared libraries.
  125. * The :module:`CPackDeb` module learned how to generate ``DEBIAN/postinst`` and
  126. ``DEBIAN/postrm`` files if the package installs libraries in
  127. ldconfig-controlled locations (e.g. ``/lib/``, ``/usr/lib/``).
  128. * The :module:`CPackDeb` module learned how to generate dependencies between
  129. Debian packages if multi-component setup is used and
  130. :variable:`CPACK_COMPONENT_<compName>_DEPENDS` variables are set.
  131. For backward compatibility this feature is disabled by default.
  132. See :variable:`CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS`.
  133. * The :module:`CPackDeb` module learned how to set custom package file names
  134. including how to generate properly-named Debian packages::
  135. <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
  136. For backward compatibility this feature is disabled by default. See
  137. :variable:`CPACK_DEBIAN_FILE_NAME` and
  138. :variable:`CPACK_DEBIAN_<COMPONENT>_FILE_NAME`.
  139. * The :module:`CPackDeb` module learned how to set the package release number
  140. (``DebianRevisionNumber`` in package file name when used in combination with
  141. ``DEB-DEFAULT`` value set by :variable:`CPACK_DEBIAN_FILE_NAME`). See
  142. :variable:`CPACK_DEBIAN_PACKAGE_RELEASE`.
  143. * The :module:`CPackDeb` module learned how to set the package architecture
  144. per-component. See :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE`.
  145. * The :module:`CPackDMG` module learned a new option to tell the CPack
  146. ``DragNDrop`` generaor to skip the ``/Applications`` symlink.
  147. See the :variable:`CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK` variable.
  148. * The :module:`CPackIFW` module gained a new
  149. :command:`cpack_ifw_update_repository` command to update a QtIFW-specific
  150. repository from a remote repository.
  151. * The :module:`CPackRPM` module learned how to set RPM ``dist`` tag as part of
  152. RPM ``Release:`` tag when enabled (mandatory on some Linux distributions for
  153. e.g. on Fedora).
  154. See :variable:`CPACK_RPM_PACKAGE_RELEASE_DIST`.
  155. * The :module:`CPackRPM` module learned how to set default values for owning
  156. user/group and file/directory permissions of package content.
  157. See :variable:`CPACK_RPM_DEFAULT_USER`, :variable:`CPACK_RPM_DEFAULT_GROUP`,
  158. :variable:`CPACK_RPM_DEFAULT_FILE_PERMISSIONS`,
  159. :variable:`CPACK_RPM_DEFAULT_DIR_PERMISSIONS` and their per component
  160. counterparts.
  161. * The :module:`CPackRPM` module learned how to set user defined package file
  162. names, how to specify that rpmbuild should decide on file name format as
  163. well as handling of multiple rpm packages generated by a single user defined
  164. spec file.
  165. See :variable:`CPACK_RPM_PACKAGE_NAME` and
  166. :variable:`CPACK_RPM_<component>_PACKAGE_NAME`.
  167. * The :module:`CPackRPM` module learned how to correctly handle symlinks
  168. that are pointing outside generated packages.
  169. Other
  170. -----
  171. * The :manual:`Compile Features <cmake-compile-features(7)>` functionality
  172. is now aware of features supported by Intel C++ compilers versions 12.1
  173. through 16.0 on UNIX platforms.
  174. Deprecated and Removed Features
  175. ===============================
  176. * The :module:`CMakeForceCompiler` module and its macros are now deprecated.
  177. See module documentation for an explanation.
  178. * The :command:`find_library`, :command:`find_path`, and :command:`find_file`
  179. commands no longer search in installation prefixes derived from the ``PATH``
  180. environment variable on non-Windows platforms. This behavior was added in
  181. CMake 3.3 to support Windows hosts but has proven problematic on UNIX hosts.
  182. Users that keep some ``<prefix>/bin`` directories in the ``PATH`` just for
  183. their tools do not necessarily want any supporting ``<prefix>/lib``
  184. directories searched. One may set the ``CMAKE_PREFIX_PATH`` environment
  185. variable with a :ref:`;-list <CMake Language Lists>` of prefixes that are
  186. to be searched.
  187. * The :generator:`Visual Studio 7 .NET 2003` generator is now
  188. deprecated and will be removed in a future version of CMake.
  189. * The :generator:`Visual Studio 7` generator (for VS .NET 2002) has been
  190. removed. It had been deprecated since CMake 3.3.
  191. * The :generator:`Visual Studio 6` generator has been removed.
  192. It had been deprecated since CMake 3.3.
  193. Other Changes
  194. =============
  195. * The precompiled OS X binary provided on ``cmake.org`` now requires
  196. OS X 10.7 or newer.
  197. * On Linux and FreeBSD platforms, when building CMake itself from source and
  198. not using a system-provided libcurl, OpenSSL is now used by default if it is
  199. found on the system. This enables SSL/TLS support for commands supporting
  200. network communication via ``https``, such as :command:`file(DOWNLOAD)`,
  201. :command:`file(UPLOAD)`, and :command:`ctest_submit`.
  202. * The :manual:`cmake(1)` ``--build`` command-line tool now rejects multiple
  203. ``--target`` options with an error instead of silently ignoring all but the
  204. last one.
  205. * :prop_tgt:`AUTOMOC` now diagnoses name collisions when multiple source
  206. files in different directories use ``#include <moc_foo.cpp>`` with the
  207. same name (because the generated ``moc_foo.cpp`` files would collide).
  208. * The :module:`FindBISON` module ``BISON_TARGET`` macro now supports
  209. special characters by passing the ``VERBATIM`` option to internal
  210. :command:`add_custom_command` calls. This may break clients that
  211. added escaping manually to work around the bug.
  212. * The :module:`FindFLEX` module ``FLEX_TARGET`` macro now supports
  213. special characters by passing the ``VERBATIM`` option to internal
  214. :command:`add_custom_command` calls. This may break clients that
  215. added escaping manually to work around the bug.
  216. * The :module:`FindProtobuf` module input and output variables were all renamed
  217. from ``PROTOBUF_`` to ``Protobuf_`` for consistency with other find modules.
  218. Input variables of the old case will be honored if provided, and output
  219. variables of the old case are always provided.
  220. * The :module:`CPackRPM` module now supports upper cased component
  221. names in per component CPackRPM specific variables.
  222. E.g. component named ``foo`` now expects component specific
  223. variable to be ``CPACK_RPM_FOO_PACKAGE_NAME`` while before
  224. it expected ``CPACK_RPM_foo_PACKAGE_NAME``.
  225. Upper cased component name part in variables is compatible
  226. with convention used for other CPack variables.
  227. For back compatibility old format of variables is still valid
  228. and preferred if both versions of variable are set, but the
  229. preferred future use is upper cased component names in variables.
  230. New variables that will be added to CPackRPM in later versions
  231. will only support upper cased component variable format.
  232. * The CPack NSIS generator's configuration file template was fixed to
  233. quote the path to the uninstaller tool used by the
  234. :variable:`CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL` option.
  235. This avoids depending on an insecure Windows feature to run an
  236. uninstaller tool with a space in the path.