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