CMake 3.13 Release Notes¶
Contents
Changes made since CMake 3.12 include the following.
New Features¶
Generators¶
- The Visual Studio Generators for VS 2010 and above learned to
support the INTERPROCEDURAL_OPTIMIZATIONtarget property and supportingCheckIPOSupportedmodule.
- The Xcodegenerator learned to configure more Xcode Scheme fields. See theCMAKE_XCODE_GENERATE_SCHEMEvariable.
- The Green Hills MULTIgenerator has been updated:- Added support for architecture selection through
CMAKE_GENERATOR_PLATFORM: e.g.arm,ppc, and86.
- Added support for toolset selection through
CMAKE_GENERATOR_TOOLSET, e.g.comp_201205,comp_201510,comp_201722_beta.
- Added support for platform selection through GHS_TARGET_PLATFORM, e.g.integrity,linux,standalone, etc.
- No longer checks that armbased compilers are installed but ensures that the correctgbuild.exeexists.
- No longer hard-codes ARM files, BSP, toolset, or OS locations.
 
- Added support for architecture selection through
Command-Line¶
- The cmake(1)command gained the-S <source_dir>command line option to specify the location of the source directory. This option can be used independently of-B.
- The cmake(1)command gained the-B <build_dir>command line option to specify the location of the build directory. This option can be used independently of-S.
- The cmake(1)-E create_symlinkcommand can now be used on Windows.
Commands¶
- The add_custom_command()andadd_custom_target()commands learned to support generator expressions inWORKING_DIRECTORYoptions.
- The add_link_options()command was created to add link options in the current directory.
- The install(TARGETS)command learned to install targets created outside the current directory.
- The link_directories()command gained options to control insertion position.
- The list(SORT)command gained options to control the comparison operation used to order the entries.
- The math()command gained options for hexadecimal.
- The target_link_directories()command was created to specify link directories for targets and their dependents.
- The target_link_options()command was created to specify link options for targets and their dependents.
- The target_link_libraries()command may now be called to modify targets created outside the current directory. See policyCMP0079.
Variables¶
- A CMAKE_AUTOGEN_VERBOSEvariable was added to optionally increase the verbosity ofAUTOMOC,AUTOUICandAUTORCCfrom within CMake project code.
- A CMAKE_VS_GLOBALSvariable was added to initializeVS_GLOBAL_<variable>target properties on targets as they are created.
Properties¶
- The DEPLOYMENT_ADDITIONAL_FILEStarget property was added to tell theVisual Studio 9 2008generator to specify additional files for deployment to WinCE devices for remote debugging.
- The INTERFACE_LINK_DEPENDStarget property was created to specify transitive link dependencies on files.
- The LINK_DEPENDStarget property learned to supportgenerator expressions.
- LINK_DIRECTORIESand- INTERFACE_LINK_DIRECTORIEStarget properties were added to collect link directories for a target and its dependents. Use the- target_link_directories()command to set them.
- LINK_OPTIONSand- INTERFACE_LINK_OPTIONStarget properties were added to collect link options for a target and its dependents. Use the- target_link_options()command to set them.
- A LINK_OPTIONSdirectory property was added to collect link options for targets created under the current directory. Use theadd_link_options()command to set it.
- A STATIC_LIBRARY_OPTIONStarget property was created to specify archiver options to use when creating static libraries.
- A VS_DEBUGGER_COMMAND_ARGUMENTStarget property was created to set the debugging command line arguments with Visual Studio Generators for VS 2010 and above.
- A VS_DEBUGGER_ENVIRONMENTtarget property was created to set the debugging environment with Visual Studio Generators for VS 2010 and above.
- The VS_DEBUGGER_COMMANDandVS_DEBUGGER_WORKING_DIRECTORYtarget properties now support generator expressions.
Modules¶
- The FindBoostmodule gained aBoost_ARCHITECTUREoption to specify a Boost architecture-specific library filename fragment.
- The FindCURLmodule learned to find debug and release variants separately.
- The FindMatlabmodule gained new componentsENGINE_LIBRARYandDATAARRAY_LIBRARYto request finding the Matlab C++ Engine and DataArray libraries respectively.
- The FindMatlabmodule now explicitly exports mexFunction in Visual Studio.
- The FindMatlabmodule gained a newMCC_COMPILERcomponent to request finding the Matlab Compiler add-on.
- The FindPkgConfigmodule gained an option to create imported targets in global scope.
- The FindPkgConfigmodule gained support for<and>operators for version checks in addition to the already supported operators>=,<=, and=.
- Modules FindPython3,FindPython2andFindPythongain capability to control order of resource lookup on macOS (Framework) and Windows (Registry).
- The FindSubversionmoduleSubversion_WC_INFOcommand gained anIGNORE_SVN_FAILUREoption to suppress failures, e.g. when the source tree is not under Subversion control.
- The UseSWIGmodule learned to manage target propertyINCLUDE_DIRECTORIESforSWIGcompilation.
CTest¶
- ctest(1)gained a- --progressoption to enable a live test progress summary when output goes to a terminal.
CPack¶
- The CPack DEB Generatorlearned to split debug symbols into a corresponding .ddeb package whenCPACK_DEBIAN_DEBUGINFO_PACKAGEis set.
- The CPack DEB Generatorlearned to honor theSOURCE_DATE_EPOCHenvironment variable when packaging files. This is useful for generating reproducible packages.
- CPack gained a new CPack External Generatorwhich is used to export the CPack metadata in a format that other software can understand. The intention of this generator is to allow external packaging software to take advantage of CPack’s features when it may not be possible to use CPack for the entire packaging process.
Deprecated and Removed Features¶
- An explicit deprecation diagnostic was added for policies CMP0055throughCMP0063(CMP0054and below were already deprecated). Thecmake-policies(7)manual explains that the OLD behaviors of all policies are deprecated and that projects should port to the NEW behaviors.
Other Changes¶
- The precompiled binaries provided on cmake.orgnow include qthelp-format documentation.
- The option()command now honors an existing normal variable of the same name and does nothing instead of possibly creating a cache entry (or setting its type) and removing the normal variable. See policyCMP0077.
- The Makefile Generators learned to remove custom command and
custom target byproducts during make clean.
- The target_sources()command now interprets relative source file paths as relative to the current source directory. This simplifies incrementally building up a target’s sources from subdirectories. TheCMP0076policy was added to provide backward compatibility with the old behavior where required.
- The BundleUtilitiesmodule may no longer be included at configure time. This was always a bug anyway. See policyCMP0080.
- The UseSWIGmodule has changed strategy for target naming. See policyCMP0078.
- The LINK_DIRECTORIEStarget property now expects absolute paths. See policyCMP0081.
- The CPack generators have been moved into their own separate section in the documentation, rather than having the documentation in their internal implementation modules. These internal implementation modules are also no longer available to scripts that may have been incorrectly including them, because they should never have been available in the first place.
Updates¶
Changes made since CMake 3.13.0 include the following.
3.13.2¶
- CMake 3.13.0 included a change to pass compiler implicit include
directories to the moctool forAUTOMOC. This has been reverted due to regressing existing builds and will need further investigation before being re-introduced in a later release.
3.13.3¶
- The Visual Studio 15 2017generator has been fixed to work when VS 2019 is installed.
- CMake now checks that at least one of the source or binary directory is specified when running CMake and issues an error if both are missing. This has always been a documented requirement, but the implementation previously accidentally accepted cases in which neither are specified so long as some other argument is given, and silently used the current working directory as the source and build tree.
3.13.4¶
- The error added by 3.13.3 in cases that neither a source or binary
directory is specified has been downgraded to a warning.  While this
was never intended, documented, nor supported behavior, some projects
relied on it.  The error has been downgraded to a warning for the
remainder of the 3.13.x release series to allow a transition period,
but it may become a fatal error again in a later release.  Scripts
relying on the old behavior can be trivially fixed by specifying
the path to the source tree (even if just .) explicitly and continue to work with all versions of CMake.
3.13.5¶
- In CMake 3.13.0 through 3.13.4, calling target_link_libraries()to addPRIVATEdependencies to a static library created in another directory (under policyCMP0079NEWbehavior) would incorrectly propagate usage requirements of those dependencies to dependents that link the static library. This has been fixed.
