CMake 3.15 Release Notes¶
Changes made since CMake 3.14 include the following.
Xcodegenerator now supports per-target schemes. See the
Green Hills MULTIgenerator has been updated:
It now supports the
It is now available on Linux.
Preliminary support for the
Swiftlanguage was added to the
SWIFTCenvironment variable to specify a compiler.
Swift_DEPENDENCIES_FILEtarget property and
Swift_DEPENDENCIES_FILEsource file property were added to customize dependency files.
Swift_MODULE_NAMEtarget property was added to customize the Swift module name.
Swift_DIAGNOSTICS_FILEsource property was added to indicate where to write the serialized Swift diagnostics.
The Swift support is experimental, not considered stable, and may change in future releases of CMake.
Clangcompiler variant on Windows that targets the MSVC ABI but has a GNU-like command line is now supported.
Support for the Clang-based ARM compiler was added with compiler id
Support was added for the IAR compiler architectures Renesas RX, RL78, RH850 and Texas Instruments MSP430.
Support was added for the IAR compilers built for Linux (IAR BuildLx).
CMAKE_GENERATORenvironment variable was added to specify a default generator to use when
cmake(1)is run without a
-Goption. Additionally, environment variables
CMAKE_GENERATOR_INSTANCEwere created to configure the generator.
--targetparameter gained support for multiple targets, e.g.
cmake --build . --target Library1 Library2. It now also has a short form
cmake --build . -t Library1 Library2.
cmake(1)command gained a new
--installoption. This may be used after building a project to run installation without using the generated build system or the native build tool.
cmake(1)command learned a new CLI option
-E remove_directorycommand-line tool learned to support removing multiple directories.
-E tartool has been improved:
It now continues adding files to an archive even if some of the files are not readable. This behavior is more consistent with the classic
It now parses all flags, and if an invalid flag was provided, a warning is issued.
It now displays an error if no action flag was specified, along with a list of possible actions:
It now supports extracting (
-x) or listing (
-t) only specific files or directories.
It now supports Zstandard compression with a
--zstdoption. Zstandard was designed to give a compression ratio comparable to that of the DEFLATE (zip) algorithm, but faster, especially for decompression.
add_custom_target()commands gained a new
JOB_POOLoption that works with the
Ninjagenerator to set the pool variable on the build statement.
ALIASoption learned to support import libraries of the
cmake_parse_arguments()command gained an additional
<prefix>_KEYWORDS_MISSING_VALUESoutput variable to report keyword arguments that were given by the caller with no values.
execute_process()command gained a
COMMAND_ECHOoption and supporting
CMAKE_EXECUTE_PROCESS_COMMAND_ECHOvariable to enable echoing of the command-line string before execution.
file(INSTALL)command learned a new argument,
FOLLOW_SYMLINK_CHAIN, which can be used to recursively resolve and install symlinks.
list()learned new sub-commands:
message()command learned new types:
string()learned a new sub-command
CMAKE_CROSSCOMPILING_EMULATORvariable and corresponding
CROSSCOMPILING_EMULATORtarget property learned to support arguments to the emulator.
CMAKE_FIND_PACKAGE_PREFER_CONFIGvariable was added to tell
find_package()calls to look for a package configuration file first even if a find module is available.
CMAKE_FRAMEWORKvariable was added to initialize the
FRAMEWORKproperty on all targets.
VS_JUST_MY_CODE_DEBUGGINGtarget property were added to enable the Just My Code feature of the Visual Studio Debugger when compiling with MSVC cl 19.05 and higher.
MSVC_RUNTIME_LIBRARYtarget property were introduced to select the runtime library used by compilers targeting the MSVC ABI. See policy
CMAKE_PROJECT_INCLUDE_BEFOREvariables were added to allow injection of custom code at the sites of
project()calls without knowing the project name a priori.
ADDITIONAL_CLEAN_FILEStarget property and
ADDITIONAL_CLEAN_FILESdirectory property were added. They allow to register additional files that should be removed during the clean stage.
PRIVATE_HEADERproperties may now be set on Interface Libraries. The headers specified by those properties can be installed using the
install(TARGETS)command by passing the
VS_PACKAGE_REFERENCEStarget property was added to tell Visual Studio Generators to add references to
VS_PROJECT_IMPORTtarget property was added to allow managed Visual Studio project files to import external
VS_NO_SOLUTION_DEPLOYtarget property was added to tell Visual Studio Generators whether to deploy an artifact to the WinCE or Windows Phone target device.
FindBoostmodule was reworked to expose a more consistent user experience between its "Config" and "Module" modes and with other find modules in general.
A new imported target
Boost::headersis now defined (same as
New output variables
QUIETargument passed to
find_package()is no longer ignored in config mode. Note that the CMake package shipped with Boost
QUIETargument passed to
find_package(). This is fixed in the next Boost release.
The input switch
Boost_VERSIONnow reports the version in
x.y.zformat in module mode. See policy
FindCupsmodule now provides imported targets.
FindEnvModulesmodule was added to use Lua- and TCL-based environment modules in CTest Scripts.
FindGLEWmodule now provides an interface more consistent with what upstream GLEW provides in its own CMake package files.
INTERFACE_LINK_OPTIONSproperty of imported targets with other (non-library) linker flags.
FindPostgreSQLmodule learned to find debug and release variants separately.
FindPythongained additional lookup strategies and controls, and a new default. See policy
FindPython3gain a new target (respectively
Python3::Module) which can be used to develop Python modules.
FindPythongain capability to control how virtual environments are handled.
UseSWIGmodule learned to manage alternate library names by passing
CSharplanguage to the
The generator expressions
$<PLATFORM_ID>learned to support matching one value from a comma-separated list.
$<CUDA_COMPILER_VERSION:...>generator expressions were added.
$<COMPILE_LANG_AND_ID:...>generator expression was introduced to allow specification of compile options for target files based on the
LANGUAGEof each source file.
$<FILTER:list,INCLUDE|EXCLUDE,regex>generator expression has been added.
$<REMOVE_DUPLICATES:list>generator expression has been added.
$<SHELL_PATH:...>generator expression gained support for a list of paths.
generator expressionswere added to retrieve the prefix, base name, and suffix of the file names of various artifacts:
$<TARGET_OBJECTS:...>generator expression is now supported on
MODULElibraries and executables.
ctest_submit()command learned a new option:
BUILD_ID. This can be used to store the ID assigned to this build by CDash to a variable.
ctest_update()command learned to honor a new variable:
CTEST_UPDATE_VERSION_OVERRIDE. This can be used to specify the current version of your source tree rather than using the update command to discover the current version that is checked out.
CPack IFW Generatorgained a new
CPACK_IFW_PACKAGE_STYLE_SHEETvariable to customize the installer stylesheet.
Deprecated and Removed Features¶
cmake-server(7)mode has been deprecated and will be removed from a future version of CMake. Please port clients to use the
ADDITIONAL_MAKE_CLEAN_FILESdirectory property is now deprecated. Use the
ADDITIONAL_CLEAN_FILESdirectory property instead.
CMAKE_AUTOMOC_RELAXED_MODEis considered deprecated. Support still exists but will be removed in future versions.
export(PACKAGE)command now does nothing unless enabled via
CMAKE_EXPORT_PACKAGE_REGISTRY. See policy
Xcodegenerator now requires at least Xcode 5.
An explicit deprecation diagnostic was added for policy
CMP0065and below were already deprecated). The
cmake-policies(7)manual explains that the OLD behaviors of all policies are deprecated and that projects should port to the NEW behaviors.
If a feature specified by
target_compile_features()is available in the compiler's default standard level, CMake 3.14 and below incorrectly added unnecessary
-std=flags that could lower the standard level. This bug has been fixed in CMake 3.15. This behavior change may expose bugs in existing projects that were relying on undocumented implementation details. Specifying compile features only ensures that the compiler runs in a mode that has those features, not that any specific standard level is used or explicit
CMake learned how to compile C++14 with the IBM AIX XL compiler and the SunPro compiler and to compile C++20 with the AppleClang compiler.
With MSVC-like compilers the value of
CMAKE_<LANG>_FLAGSno longer contains warning flags like
/W3by default. See policy
IBM Clang-based XL compilers that define
__ibmxl__now use the compiler id
XL. See policy
file(REMOVE_RECURSE)commands were changed to ignore empty arguments with a warning instead of treating them as a relative path and removing the contents of the current directory.
Changes made since CMake 3.15.0 include the following.
In CMake 3.15.0 support for the GNU-like
Clangcompiler targeting the MSVC ABI implemented
CMAKE_CXX_STANDARDvalues 98 and 11 using the corresponding
-std=flags. However, these modes do not work with the MSVC standard library. Therefore CMake 3.15.1 passes C++14 standard flags even for C++98 and C++11. This is consistent with MSVC itself which always runs in a mode aware of C++14.
Preliminary Swift support added in 3.15.0 has been updated.
In CMake 3.15.0 and 3.15.1 the
CMAKE_FIND_PACKAGE_PREFER_CONFIGvariable caused the
find_package()command to fail on a missing package even without the
REQUIREDoption. This has been fixed.
CrayPrgEnvcompiler wrapper support has been updated for the 19.06 release of the Cray Programming Environment for which the default linking mode on XC Cray systems is now dynamic instead of static.
In CMake 3.15.0 through 3.15.3, the
EXCLUDE_FROM_ALLdirectory property was regressed from pre-3.14 behavior and caused targets within the directory to be excluded even from its own "all". This has been fixed. The bug also existed in 3.14.0 through 3.14.6 and is fixed in 3.14.7.