CMake 3.10 Release Notes¶
Contents
Changes made since CMake 3.9 include the following.
New Features¶
Platforms¶
The flang Fortran compiler is now supported, with compiler id
Flang
.A new minimal platform file for
Midipix
was added.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.
Generators¶
The Makefile Generators and the
Ninja
generator learned to add compiler launcher tools like ccache along with the compiler for theCUDA
language (C
andCXX
were supported previously). See theCMAKE_<LANG>_COMPILER_LAUNCHER
variable and<LANG>_COMPILER_LAUNCHER
target property for details.The
CodeBlocks
extra generator learned to optionally exclude files from outside the project root directory from the generated project. See theCMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES
variable.
Commands¶
The
cmake_host_system_information()
command learned more keys to get information about the processor capabilities and the host OS version.The
configure_file()
command learned to support indented# cmakedefine
and# cmakedefine01
. Spaces and/or tabs between the#
character and thecmakedefine
/cmakedefine01
words are now understood and preserved in the output.The
execute_process()
command gained aRESULTS_VARIABLE
option to collect a list of results from all children in a pipeline of processes when multipleCOMMAND
arguments are given.The
include_guard()
command was introduced to allow guarding CMake scripts from being included more than once. The command supportsDIRECTORY
andGLOBAL
options to adjust the corresponding include guard scope. If no options given, include guard is similar to basic variable-based check.The
string()
command learned a newPREPEND
subcommand.The
string(TIMESTAMP)
command now supports%A
for full weekday name and%B
for full month name.
Variables¶
A
CMAKE_DIRECTORY_LABELS
variable was added to specify labels for all tests in a directory.
Properties¶
A
<LANG>_CPPCHECK
target property and supportingCMAKE_<LANG>_CPPCHECK
variable were introduced to tell the Makefile Generators and theNinja
generator to runcppcheck
with the compiler forC
andCXX
languages.A
LABELS
directory property was added to specify labels for all targets and tests in a directory.A
TEST_INCLUDE_FILES
directory property was added to list any number of files to be included when running tests withctest(1)
. This generalizes theTEST_INCLUDE_FILE
property.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_OUTPUT_HEADER_FILE
andVS_SHADER_VARIABLE_NAME
have been added to specify more details of.hlsl
sources with Visual Studio Generators.
Modules¶
The
FindCurses
module gained aCURSES_NEED_WIDE
option to request the wide-character variant.The
FindEXPAT
module now provides imported targets.The
FindFreetype
module now provides imported targets.FindMPI
gained 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.
A
FindOpenACC
module was added to detect compiler support for OpenACC. Currently only supports PGI, GNU and Cray compilers.The
FindOpenGL
module gained support for GLVND on Linux.The
FindOpenMP
module gained support for language-specific components.A
FindPatch
module was added to find thepatch
command-line executable.The
FindProtobuf
moduleprotobuf_generate_cpp()
command gained aDESCRIPTORS
option to generate descriptor files.The
GoogleTest
module gained a new commandgtest_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 theTIMEOUT
keyword (see 3.10.3).The
InstallRequiredSystemLibraries
module gained support for installing Intel compiler runtimes.
Autogen¶
When using
AUTOMOC
orAUTOUIC
with a multi configuration generator (e.g.Xcode
), included*.moc
,moc_*.cpp
andui_*.h
files are generated in<AUTOGEN_BUILD_DIR>/include_<CONFIG>
instead of<AUTOGEN_BUILD_DIR>/include
.When using
AUTOMOC
orAUTOUIC
, source files that areGENERATED
will be processed as well. They were ignored byAUTOMOC
andAUTOUIC
in earlier releases. See policyCMP0071
.When using
AUTOMOC
, CMake searches for the stringsQ_OBJECT
,Q_GADGET
orQ_NAMESPACE
in a source file to determine if it needs to bemoc
processed. The newCMAKE_AUTOMOC_MACRO_NAMES
variable andAUTOMOC_MACRO_NAMES
target property may be set to register additional strings (macro names) to search for.When using
AUTOMOC
, the newCMAKE_AUTOMOC_COMPILER_PREDEFINES
variable andAUTOMOC_COMPILER_PREDEFINES
target property specify whether to enable or disable the generation of the compiler pre definitions filemoc_predefs.h
.
CTest¶
A
CTEST_LABELS_FOR_SUBPROJECTS
CTest 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 theCTestConfig.cmake
config file.
CPack¶
A
CPack FreeBSD Generator
was added for FreeBSDpkg(8)
.The
CPack DEB Generator
was enabled on Windows. While not fully featured (due to the lack of external UNIX tools) this will allow building basic cross-platform Debian packages.The
CPack DEB Generator
learned to set package release version inVersion
info property. See theCPACK_DEBIAN_PACKAGE_RELEASE
variable.The
CPack DEB Generator
learned more strict package version checking that complies with Debian rules.The
CPackIFW
modulecpack_ifw_configure_component()
andcpack_ifw_configure_component_group()
commands gained a newREPLACES
andCHECKABLE
options.The
CPack IFW Generator
gained newCPACK_IFW_PACKAGE_FILE_EXTENSION
variable to customize target binary format.The
CPack IFW Generator
gained newCPACK_IFW_REPOSITORIES_DIRECTORIES
variable 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.The
CPack RPM Generator
andCPack DEB Generator
learned to set the package epoch version. SeeCPACK_RPM_PACKAGE_EPOCH
andCPACK_DEBIAN_PACKAGE_EPOCH
variables.
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.
Other Changes¶
On FreeBSD the C++ compiler named
c++
is now the preferred default.The
file(GENERATE)
command now interprets relative paths given to itsOUTPUT
andINPUT
arguments with respect to the caller’s current binary and source directories, respectively. See policyCMP0070
.The
get_filename_component()
PROGRAM
mode 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.
Updates¶
Changes made since CMake 3.10.0 include the following.
3.10.1¶
The
cmake-server(7)
codemodel
responsecrossReferences
field added by 3.10.0 has been dropped due to excessive memory usage. Another approach will be needed to provide backtrace information.
3.10.3¶
CMake 3.10.1 added a
TIMEOUT
option togtest_discover_tests()
from theGoogleTest
module. That keyword clashed with theTIMEOUT
test property, which is one of the common properties that would be set with the command’sPROPERTIES
keyword, usually leading to legal but unintended behavior. The keyword was changed toDISCOVERY_TIMEOUT
in CMake 3.10.3 to address this problem. The ambiguous behavior of thegtest_discover_tests()
command’sTIMEOUT
keyword in 3.10.1 and 3.10.2 has not been preserved.