3.14.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. CMake 3.14 Release Notes
  2. ************************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 3.13 include the following.
  6. New Features
  7. ============
  8. Generators
  9. ----------
  10. * The :generator:`Visual Studio 16 2019` generator was added. This is
  11. experimental and based on "Visual Studio 2019 Preview 4" because this
  12. version of VS has not been released.
  13. The VS 2019 generator differs from generators for earlier versions
  14. in that it does not provide variants that specify the target platform
  15. in the generator name. Instead :variable:`CMAKE_GENERATOR_PLATFORM`
  16. must be used, e.g. through the ``-A`` command-line option. Furthermore,
  17. the default target platform (architecture) is now based on the *host*
  18. platform. The VS host toolset selection is now based on the host
  19. architecture as well.
  20. * The :generator:`Green Hills MULTI` generator has been updated:
  21. * Now supports :ref:`Object Libraries`.
  22. * Now warns on unsupported project types such as shared libraries.
  23. * Now generates a top-level ``<PROJECT-NAME>.top.gpj`` for each directory
  24. calling the :command:`project` command. The top-level project file
  25. ``default.gpj`` is no longer created.
  26. * Now honors target renaming and destination output control properties
  27. such as :prop_tgt:`RUNTIME_OUTPUT_DIRECTORY` and :prop_tgt:`OUTPUT_NAME`.
  28. This also fixes support for installation rules generated by
  29. :command:`install`.
  30. * Now honors source file properties :prop_sf:`INCLUDE_DIRECTORIES`,
  31. :prop_sf:`COMPILE_DEFINITIONS`, and :prop_sf:`COMPILE_OPTIONS`.
  32. * Now supports Dynamic Download Integrity Applications which did not include
  33. Integrate Files via :prop_tgt:`GHS_INTEGRITY_APP` and setting a target
  34. link flag of ``-dynamic``.
  35. * The contents of project files now sorts sources groups and files by name.
  36. Set the :prop_tgt:`GHS_NO_SOURCE_GROUP_FILE` target property to ``ON`` to
  37. generate a single project file for the target instead of a project file for
  38. each source group. Set the :variable:`CMAKE_GHS_NO_SOURCE_GROUP_FILE`
  39. variable to enable this for all targets.
  40. File-Based API
  41. --------------
  42. * A file-based api for clients to get semantic buildsystem information
  43. has been added. See the :manual:`cmake-file-api(7)` manual.
  44. This is intended to replace the :manual:`cmake-server(7)` mode for IDEs.
  45. Platforms
  46. ---------
  47. * CMake now supports :ref:`Cross Compiling for iOS, tvOS, or watchOS`
  48. using simple toolchain files.
  49. Command-Line
  50. ------------
  51. * The :manual:`cmake(1)` :ref:`Build Tool Mode <Build Tool Mode>`
  52. (``cmake --build``) gained ``--verbose`` and ``-v`` options to
  53. specify verbose build output. Some generators such as Xcode don't
  54. support this option currently.
  55. * The :manual:`cmake(1)` ``-E compare_files`` command learned a new
  56. ``--ignore-eol`` option to specify that end-of-line differences
  57. (e.g. LF vs CRLF) should be ignored when comparing files.
  58. * The :manual:`cmake-gui(1)` dialog gained new ``-S`` and ``-B`` arguments to
  59. explicitly specify source and build directories.
  60. Commands
  61. --------
  62. * The :command:`file` command learned a new sub-command, ``CREATE_LINK``,
  63. which can be used to create hard or symbolic links.
  64. * The :command:`file` command learned a new sub-command, ``READ_SYMLINK``,
  65. which can be used to determine the path that a symlink points to.
  66. * The :command:`file` command gained a ``SIZE`` mode to get the size
  67. of a file on disk.
  68. * The :command:`find_package` command learned to optionally resolve
  69. symbolic links in the paths to package configuration files.
  70. See the :variable:`CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS` variable.
  71. * The :command:`get_filename_component` command gained new
  72. ``LAST_EXT`` and ``NAME_WLE`` variants to work with the
  73. extension after the last ``.`` in the name.
  74. * The :command:`if` command gained support for checking if cache variables
  75. are defined with the ``DEFINED CACHE{VAR}`` syntax.
  76. * The :command:`install(CODE)` and :command:`install(SCRIPT)` commands
  77. learned to support generator expressions. See policy :policy:`CMP0087`.
  78. * The :command:`install(TARGETS)` command learned how to install to an
  79. appropriate default directory for a given target type, based on
  80. variables from the :module:`GNUInstallDirs` module and built-in defaults,
  81. in lieu of a ``DESTINATION`` argument.
  82. * The :command:`install(FILES)` and :command:`install(DIRECTORY)` commands
  83. learned a new set of parameters for installing files as a file type,
  84. setting the destination based on the appropriate variables from
  85. :module:`GNUInstallDirs` and built-in defaults, in lieu of a
  86. ``DESTINATION`` argument.
  87. * The :command:`list` operations ``REMOVE_ITEM``, ``REMOVE_DUPLICATES``,
  88. ``SORT``, ``REVERSE``, and ``FILTER`` all now accept a non-existent variable
  89. as the list since these operations on empty lists is also the empty list.
  90. * The :command:`list` operation ``REMOVE_AT`` now indicates that the given
  91. indices are invalid for a non-existent variable or empty list.
  92. * The :command:`try_compile` and :command:`try_run` commands gained a new
  93. ``LINK_OPTIONS`` option.
  94. Variables
  95. ---------
  96. * A :variable:`CMAKE_BUILD_RPATH_USE_ORIGIN` variable and corresponding
  97. :prop_tgt:`BUILD_RPATH_USE_ORIGIN` target property were added to
  98. enable use of relative runtime paths (RPATHs). This helps achieving
  99. relocatable and reproducible builds that are invariant of the build
  100. directory.
  101. * A :variable:`CMAKE_VS_PLATFORM_NAME_DEFAULT` variable was added for
  102. :ref:`Visual Studio Generators` to report their default platform used
  103. when :variable:`CMAKE_GENERATOR_PLATFORM` is not set explicitly.
  104. Properties
  105. ----------
  106. * A :prop_gbl:`CMAKE_ROLE` global property was added to allow scripts to
  107. determine whether they're running in project mode, script mode,
  108. find-package mode, CTest, or CPack.
  109. * The :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` target property is now supported
  110. on shared library, module library, and executable targets. Previously it was
  111. only honored on static libraries.
  112. * The :prop_tgt:`EXCLUDE_FROM_ALL` target property was created to override
  113. the setting of its directory. A target will now be built as part of "all"
  114. if its :prop_tgt:`EXCLUDE_FROM_ALL` property is set to ``OFF``, even if its
  115. containing directory is marked as :prop_dir:`EXCLUDE_FROM_ALL`.
  116. * :prop_tgt:`INTERFACE_POSITION_INDEPENDENT_CODE` target property gains the
  117. support of :manual:`generator expressions <cmake-generator-expressions(7)>`.
  118. Modules
  119. -------
  120. * The family of modules to check capabilities (like
  121. :module:`CheckCSourceCompiles`) gain capability to manage ``LINK_OPTIONS``.
  122. * A :module:`CheckFortranSourceRuns` module was added to provide a
  123. :command:`check_fortran_source_runs` command to check if a Fortran
  124. source snippet compiles and runs.
  125. * The :module:`CMakePackageConfigHelpers` module's
  126. :command:`write_basic_package_version_file` command gained a new
  127. ``ARCH_INDEPENDENT`` option for supporting architecture-independent
  128. packages.
  129. * The :module:`ExternalProject` module :command:`ExternalProject_Add` command
  130. gained ``LOG_DIR`` and ``LOG_MERGED_STDOUTERR`` options to control logging.
  131. * The :module:`ExternalProject` module :command:`ExternalProject_Add` command
  132. gained ``LOG_PATCH`` to optionally log the patch step.
  133. * The :module:`ExternalProject` module :command:`ExternalProject_Add` command
  134. learned to apply ``SOURCE_SUBDIR`` when ``BUILD_IN_SOURCE`` is also used.
  135. The ``BUILD_COMMAND`` is run in the given ``SOURCE_SUBDIR`` of the
  136. ``SOURCE_DIR``.
  137. * The :module:`FetchContent` module gained a new
  138. :command:`FetchContent_MakeAvailable` command. It accepts a list of
  139. dependency names, which it then iterates over, populating and adding
  140. each one to the main build using the canonical pattern. This
  141. significantly reduces the amount of boilerplate needed in a project.
  142. * The :module:`FindBISON` module's ``BISON_TARGET`` command now runs ``bison``
  143. with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory.
  144. See policy :policy:`CMP0088`.
  145. * The :module:`FindCURL` module gained support for requesting
  146. protocols as package components.
  147. * The :module:`FindFontconfig` module was added to find `fontconfig`_.
  148. * The :module:`FindGDAL` module now provides imported targets.
  149. * The :module:`FindGIF` module now provides imported targets.
  150. * The :module:`FindGit` module now provides an imported target for the
  151. Git executable.
  152. * The :module:`FindIce` module learned to find ``slice2confluence``
  153. and ``slice2matlab``.
  154. * The :module:`FindLibinput` module was added to find `libinput`_.
  155. * The :module:`FindLibLZMA` module now provides imported targets.
  156. * The :module:`FindMatlab` module gained new options ``R2017b`` and
  157. ``R2018a`` to specify the MEX API version to use; these options
  158. mirror the new options to the ``mex`` command in MATLAB R2018a.
  159. The option ``MX_LIBRARY`` is no longer needed.
  160. * The :module:`FindPostgreSQL` module now provides imported targets.
  161. * The :module:`FindPython`, :module:`FindPython2`, and :module:`FindPython3`
  162. modules gained support for ``NumPy`` component.
  163. * The :module:`FindPython2`, :module:`FindPython3`, and :module:`FindPython`
  164. modules now support running in script mode by skipping the creation of
  165. imported targets and helper functions.
  166. * The :module:`FindSQLite3` module was added to find the SQLite v3.x library.
  167. * The :module:`FindX11` had the following variables renamed in order to match
  168. their library names rather than header names. The old variables are provided
  169. for compatibility:
  170. - ``X11_Xxf86misc_INCLUDE_PATH`` instead of ``X11_xf86misc_INCLUDE_PATH``
  171. - ``X11_Xxf86misc_LIB`` instead of ``X11_xf86misc_LIB``
  172. - ``X11_Xxf86misc_FOUND`` instead of ``X11_xf86misc_FOUND``
  173. - ``X11_Xxf86vm_INCLUDE_PATH`` instead of ``X11_xf86vmode_INCLUDE_PATH``
  174. - ``X11_Xxf86vm_LIB`` instead of ``X11_xf86vmode_LIB``
  175. - ``X11_Xxf86vm_FOUND`` instead of ``X11_xf86vmode_FOUND``
  176. - ``X11_xkbfile_INCLUDE_PATH`` instead of ``X11_Xkbfile_INCLUDE_PATH``
  177. - ``X11_xkbfile_LIB`` instead of ``X11_Xkbfile_LIB``
  178. - ``X11_xkbfile_FOUND`` instead of ``X11_Xkbfile_FOUND``
  179. - ``X11_Xtst_INCLUDE_PATH`` instead of ``X11_XTest_INCLUDE_PATH``
  180. - ``X11_Xtst_LIB`` instead of ``X11_XTest_LIB``
  181. - ``X11_Xtst_FOUND`` instead of ``X11_XTest_FOUND``
  182. - ``X11_Xss_INCLUDE_PATH`` instead of ``X11_Xscreensaver_INCLUDE_PATH``
  183. - ``X11_Xss_LIB`` instead of ``X11_Xscreensaver_LIB``
  184. - ``X11_Xss_FOUND`` instead of ``X11_Xscreensaver_FOUND``
  185. The following variables are deprecated completely since they were
  186. essentially duplicates:
  187. - ``X11_Xinput_INCLUDE_PATH`` (use ``X11_Xi_INCLUDE_PATH``)
  188. - ``X11_Xinput_LIB`` (use ``X11_Xi_LIB``)
  189. - ``X11_Xinput_FOUND`` (use ``X11_Xi_FOUND``)
  190. * The :module:`FindX11` now provides ``X11_Xext_INCLUDE_PATH``.
  191. * The :module:`FindX11` now provides imported targets.
  192. * The :module:`UseSWIG` module learned to pass ``-module <module_name>`` to
  193. the ``SWIG`` compiler if the file property ``SWIG_MODULE_NAME`` is defined.
  194. See policy :policy:`CMP0086`.
  195. * The :module:`UseSWIG` module gained an option to specify
  196. ``SWIG`` source file extensions.
  197. .. _`fontconfig`: https://www.freedesktop.org/wiki/Software/fontconfig/
  198. .. _`libinput`: https://www.freedesktop.org/wiki/Software/libinput/
  199. Generator Expressions
  200. ---------------------
  201. * The ``$<Fortran_COMPILER_ID:...>`` and ``$<Fortran_COMPILER_VERSION:...>``
  202. :manual:`generator expressions <cmake-generator-expressions(7)>` were added.
  203. * The ``$<IN_LIST:...>`` generator expression now correctly handles an
  204. empty argument. See :policy:`CMP0085` for details.
  205. Autogen
  206. -------
  207. * The :prop_tgt:`AUTOMOC_EXECUTABLE`, :prop_tgt:`AUTORCC_EXECUTABLE`, and
  208. :prop_tgt:`AUTOUIC_EXECUTABLE` target properties were added. They all
  209. take a path to an executable and force automoc/autorcc/autouic to use
  210. this executable.
  211. Setting these will also prevent the configure time testing for these
  212. executables. This is mainly useful when you build these tools yourself.
  213. * The new variables :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`,
  214. :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`,
  215. :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` and
  216. :variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME` control the generation
  217. of global ``autogen`` and ``autorcc`` targets.
  218. * A new :variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` variable and
  219. :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` target property may be set to enable or
  220. disable forwarding of the origin target dependencies to the corresponding
  221. ``_autogen`` target.
  222. CTest
  223. -----
  224. * :manual:`ctest(1)` gained a ``--show-only=json-v1`` option to show the
  225. list of tests in a machine-readable JSON format.
  226. See the :ref:`Show as JSON Object Model` section of the manual.
  227. * The :command:`ctest_submit` command learned a new ``Done`` part that can be used
  228. to inform CDash that a build is complete and that no more parts will be uploaded.
  229. * CTest learned to accept the dashboard server submission URL from a single
  230. variable. See the ``SubmitURL`` setting in :manual:`ctest(1)`,
  231. the :variable:`CTEST_SUBMIT_URL` variable, and the ``SUBMIT_URL``
  232. argument of the :command:`ctest_submit` command.
  233. Deprecated and Removed Features
  234. ===============================
  235. * An explicit deprecation diagnostic was added for policies ``CMP0064``
  236. and ``CMP0065`` (``CMP0063`` and below were already deprecated).
  237. The :manual:`cmake-policies(7)` manual explains that the OLD behaviors
  238. of all policies are deprecated and that projects should port to the
  239. NEW behaviors.
  240. * The :generator:`Xcode` generator deprecated support for Xcode
  241. versions prior to Xcode 5. Support for those will be dropped in a
  242. future version of CMake.
  243. * The :module:`FindQt` module is no longer used by the :command:`find_package`
  244. command as a find module. This allows the Qt Project upstream to optionally
  245. provide its own ``QtConfig.cmake`` package configuration file and have
  246. applications use it via ``find_package(Qt)`` rather than
  247. ``find_package(Qt CONFIG)``. See policy :policy:`CMP0084`.
  248. * Support for running CMake on Windows XP and Windows Vista has been dropped.
  249. The precompiled Windows binaries provided on ``cmake.org`` now require
  250. Windows 7 or higher.
  251. * CTest no longer supports submissions via ``ftp``, ``scp``, ``cp``, and
  252. ``xmlrpc``. CDash is the only maintained testing dashboard for CTest,
  253. and it only supports submissions over ``http`` and ``https``.
  254. Other Changes
  255. =============
  256. * Object library linking has been fixed to propagate private link libraries
  257. of object libraries to consuming targets.
  258. * Install rules under :command:`add_subdirectory` now interleave with those in
  259. the calling directory. See policy :policy:`CMP0082` for details.
  260. * CMake now imposes a maximum recursion limit to prevent a stack overflow on
  261. scripts that recurse infinitely. The limit can be adjusted at runtime with
  262. :variable:`CMAKE_MAXIMUM_RECURSION_DEPTH`.
  263. * When using cppcheck via the :variable:`CMAKE_<LANG>_CPPCHECK` variable
  264. or :prop_tgt:`<LANG>_CPPCHECK` property, the build will now fail if
  265. ``cppcheck`` returns non-zero as configured by its command-line options.
  266. * Required link options to manage Position Independent Executable are now
  267. added when :prop_tgt:`POSITION_INDEPENDENT_CODE` is set. The project is
  268. responsible for using the :module:`CheckPIESupported` module to check for
  269. ``PIE`` support to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE`
  270. target property will be honored at link time for executables. This behavior
  271. is controlled by policy :policy:`CMP0083`.
  272. * :ref:`Visual Studio Generators` for VS 2010 and above learned
  273. to support the ``VS_DEBUGGER_*`` properties on targets created
  274. via :command:`add_custom_target`.
  275. * The :module:`CPack` module no longer defaults to the ``paxr`` value in the
  276. :variable:`CPACK_DEBIAN_ARCHIVE_TYPE` variable, because ``dpkg`` has
  277. never supported the PAX tar format. The ``paxr`` value will be mapped
  278. to ``gnutar`` and a deprecation message emitted.
  279. * CMake no longer issues a warning if a target listed in an
  280. :command:`install(TARGETS)` command has its :prop_tgt:`EXCLUDE_FROM_ALL`
  281. property set to true.
  282. Updates
  283. =======
  284. Changes made since CMake 3.14.0 include the following.
  285. 3.14.1
  286. ------
  287. * The :module:`FindFontconfig` module added by 3.14.0 accidentally
  288. used uppercase ``FONTCONFIG_*`` variable names that do not match
  289. our conventions. 3.14.1 revises the module to use ``Fontconfig_*``
  290. variable names. This is incompatible with 3.14.0 but since the
  291. module is new in the 3.14 series usage should not yet be widespread.
  292. 3.14.3
  293. ------
  294. * The :variable:`CMAKE_VS_PLATFORM_NAME_DEFAULT` variable was added
  295. to help toolchain files work with the :generator:`Visual Studio 16 2019`
  296. generator where the default platform now depends on the host platform.
  297. 3.14.4
  298. ------
  299. * In CMake 3.14.0 through 3.14.3, calling :command:`target_link_libraries`
  300. to add ``PRIVATE`` dependencies to a static library created in another
  301. directory (under policy :policy:`CMP0079` ``NEW`` behavior) would
  302. incorrectly propagate usage requirements of those dependencies to
  303. dependents that link the static library. This has been fixed.
  304. The bug also existed in 3.13.0 through 3.13.4 and is fixed in 3.13.5.
  305. 3.14.5
  306. ------
  307. * Entries of the ``CPATH`` environment variable are no longer excluded
  308. from explicit use via :command:`include_directories` and
  309. :command:`target_include_directories` as they were in CMake 3.14.0
  310. through 3.14.4.
  311. 3.14.6
  312. ------
  313. * In CMake 3.14.0 through 3.14.5, the :module:`FindBISON` module
  314. policy :policy:`CMP0088` ``NEW`` behavior accidentally interpreted
  315. a relative path to the ``.y`` input as relative to the build tree
  316. directory instead of the source tree directory. This has been fixed.
  317. 3.14.7
  318. ------
  319. * In CMake 3.14.0 through 3.14.6, the :prop_dir:`EXCLUDE_FROM_ALL`
  320. directory property was regressed from pre-3.14 behavior and caused
  321. targets within the directory to be excluded even from its own "all".
  322. This has been fixed.