CMake 3.10 Release Notes¶
Changes made since CMake 3.9 include the following.
The flang Fortran compiler is now supported, with compiler id
A new minimal platform file for
Support for the MSVC ARM64 architecture was added. Visual Studio 2017 Update 4 and above offer an ARM64 toolchain.
Support for the IAR ARM Compiler was improved.
The Makefile Generators and the
Ninjagenerator learned to add compiler launcher tools like ccache along with the compiler for the
CXXwere supported previously). See the
<LANG>_COMPILER_LAUNCHERtarget property for details.
CodeBlocksextra generator learned to optionally exclude files from outside the project root directory from the generated project. See the
cmake_host_system_information()command learned more keys to get information about the processor capabilities and the host OS version.
configure_file()command learned to support indented
# cmakedefine01. Spaces and/or tabs between the
#character and the
cmakedefine01words are now understood and preserved in the output.
execute_process()command gained a
RESULTS_VARIABLEoption to collect a list of results from all children in a pipeline of processes when multiple
COMMANDarguments are given.
include_guard()command was introduced to allow guarding CMake scripts from being included more than once. The command supports
GLOBALoptions to adjust the corresponding include guard scope. If no options given, include guard is similar to basic variable-based check.
string()command learned a new
string(TIMESTAMP)command now supports
%Afor full weekday name and
%Bfor full month name.
CMAKE_DIRECTORY_LABELSvariable was added to specify labels for all tests in a directory.
<LANG>_CPPCHECKtarget property and supporting
CMAKE_<LANG>_CPPCHECKvariable were introduced to tell the Makefile Generators and the
Ninjagenerator to run
cppcheckwith the compiler for
LABELSdirectory property was added to specify labels for all targets and tests in a directory.
TEST_INCLUDE_FILESdirectory property was added to list any number of files to be included when running tests with
ctest(1). This generalizes the
VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname>target property was added to support custom XML tags for reference assemblies in C# targets.
Source file properties
VS_SHADER_VARIABLE_NAMEhave been added to specify more details of
.hlslsources with Visual Studio Generators.
FindCursesmodule gained a
CURSES_NEED_WIDEoption to request the wide-character variant.
FindEXPATmodule now provides imported targets.
FindFreetypemodule now provides imported targets.
FindMPIgained a number of new features, including:
Language-specific components have been added to the module.
Many more MPI environments are now supported.
The environmental support for Fortran has been improved.
A user now has fine-grained control over the MPI selection process, including passing custom parameters to the MPI compiler.
The version of the implemented MPI standard is now being exposed.
MPI-2 C++ bindings can now be detected and also suppressed if so desired.
The available Fortran bindings are now being detected and verified.
Various MPI-3 information can be requested, including the library version and Fortran capabilities of the individual bindings.
Statically linked MPI implementations are supported.
FindOpenACCmodule was added to detect compiler support for OpenACC. Currently only supports PGI, GNU and Cray compilers.
FindOpenGLmodule gained support for GLVND on Linux.
FindOpenMPmodule gained support for language-specific components.
FindPatchmodule was added to find the
protobuf_generate_cpp()command gained a
DESCRIPTORSoption to generate descriptor files.
GoogleTestmodule gained a new command
gtest_discover_tests()implementing dynamic (build-time) test discovery. Unlike the source parsing approach, dynamic discovery executes the test (in 'list available tests' mode) at build time to discover tests. This is robust against unusual ways of labeling tests, provides much better support for advanced features such as parameterized tests, and does not require re-running CMake to discover added or removed tests within a test executable. Note that a breaking change was made in CMake 3.10.3 to address an ambiguity of the
TIMEOUTkeyword (see 3.10.3).
InstallRequiredSystemLibrariesmodule gained support for installing Intel compiler runtimes.
AUTOUICwith a multi configuration generator (e.g.
ui_*.hfiles are generated in
AUTOUIC, source files that are
GENERATEDwill be processed as well. They were ignored by
AUTOUICin earlier releases. See policy
AUTOMOC, CMake searches for the strings
Q_NAMESPACEin a source file to determine if it needs to be
mocprocessed. The new
AUTOMOC_MACRO_NAMEStarget property may be set to register additional strings (macro names) to search for.
AUTOMOC, the new
AUTOMOC_COMPILER_PREDEFINEStarget property specify whether to enable or disable the generation of the compiler pre definitions file
CTEST_LABELS_FOR_SUBPROJECTSCTest module variable and CTest script variable were added to specify a list of labels that should be treated as subprojects by CDash. To use this value in both the CTest module and the ctest command line Dashboard Client mode (e.g.
ctest -S) set it in the
CPack FreeBSD Generatorwas added for FreeBSD
CPack DEB Generatorwas enabled on Windows. While not fully featured (due to the lack of external UNIX tools) this will allow building basic cross-platform Debian packages.
CPack DEB Generatorlearned to set package release version in
Versioninfo property. See the
CPack DEB Generatorlearned more strict package version checking that complies with Debian rules.
cpack_ifw_configure_component_group()commands gained a new
CPack IFW Generatorgained new
CPACK_IFW_PACKAGE_FILE_EXTENSIONvariable to customize target binary format.
CPack IFW Generatorgained new
CPACK_IFW_REPOSITORIES_DIRECTORIESvariable to specify additional repositories dirs that will be used to resolve and repack dependent components. This feature is only available when using QtIFW 3.1 or later.
CPack RPM Generatorand
CPack DEB Generatorlearned to set the package epoch version. See
-Emode gained support for
The graphviz output now distinguishes among the different dependency types
INTERFACEand represents them in the output graph as solid, dashed and dotted edges.
Deprecated and Removed Features¶
Support for building CMake itself with C++98 compilers was dropped. CMake is now implemented using C++11.
Support for building CMake on HP-UX has been dropped pending better support for C++11 and a port of libuv. See CMake Issue 17137. Use CMake 3.9 or lower instead for HP-UX support.
On FreeBSD the C++ compiler named
c++is now the preferred default.
file(GENERATE)command now interprets relative paths given to its
INPUTarguments with respect to the caller's current binary and source directories, respectively. See policy
PROGRAMmode semantics have been revised to not tolerate unquoted spaces in the path to the program while also accepting arguments. While technically incompatible with the old behavior, it is expected that behavior under typical use cases with properly-quoted command-lines has not changed.
Changes made since CMake 3.10.0 include the following.
crossReferencesfield added by 3.10.0 has been dropped due to excessive memory usage. Another approach will be needed to provide backtrace information.
CMake 3.10.1 added a
GoogleTestmodule. That keyword clashed with the
TIMEOUTtest property, which is one of the common properties that would be set with the command's
PROPERTIESkeyword, usually leading to legal but unintended behavior. The keyword was changed to
DISCOVERY_TIMEOUTin CMake 3.10.3 to address this problem. The ambiguous behavior of the
TIMEOUTkeyword in 3.10.1 and 3.10.2 has not been preserved.