CMake 3.26 Release Notes¶
Changes made since CMake 3.25 include the following.
New Features¶
Languages¶
The
ASM_MARMASM
language was added to support the Microsoft ARM assembler language.
Command-Line¶
The
cmake -E copy
command-line tool now supports a-t
argument.The
cmake -E copy_directory_if_different
command-line tool was added.
Configure Log¶
CMake now writes a YAML log of configure-time checks to
CMakeFiles/CMakeConfigureLog.yaml
under the top of the build tree. See thecmake-configure-log(7)
manual.
File-Based API¶
The
cmake-file-api(7)
"codemodel" version 2version
field has been updated to 2.5.The
cmake-file-api(7)
"codemodel" version 2 "target" object gained a newfileSets
field and associatedfileSetIndex
field tosources
objects.The
cmake-file-api(7)
gained a new "configureLog" object kind that enables stable access to thecmake-configure-log(7)
.
Commands¶
The
add_custom_command()
andadd_custom_target()
commands now supportgenerator expressions
in theirCOMMENT
option.The
message()
command gained aCONFIGURE_LOG
mode to record an entry in thecmake-configure-log(7)
.The
string(TIMESTAMP)
andfile(TIMESTAMP)
commands now support the%z
and%Z
specifiers for the time zone.The
try_compile()
andtry_run()
commands gained aLOG_DESCRIPTION
option specifying text to be recorded in thecmake-configure-log(7)
.The
try_compile()
andtry_run()
commands gained aNO_LOG
option to skip recording acmake-configure-log(7)
entry.
Variables¶
The
CMAKE_<LANG>_COMPILER_FRONTEND_VARIANT
variable is now set forGNU
,MSVC
, andAppleClang
compilers that have only one frontend variant.A
CMAKE_VS_VERSION_BUILD_NUMBER
variable is now set by Visual Studio Generators for VS 2017 and above to report the four-component Visual Studio version number.
Properties¶
The
<LANG>_CLANG_TIDY_EXPORT_FIXES_DIR
target property was added to allow theclang-tidy
tool to export its suggested fixes to a set of.yaml
files. A newCMAKE_<LANG>_CLANG_TIDY_EXPORT_FIXES_DIR
variable was created to initialize this property.The
XCODE_EMBED_EXTENSIONKIT_EXTENSIONS
target property was added to tell theXcode
generator to embed ExtensionKit-based extensions such as extensions using the Background Assets framework. Aspects of the embedding can be customized with:
Modules¶
The
ExternalProject
module'sExternalProject_Add()
command gained anINSTALL_BYPRODUCTS
option to specify files generated by theinstall
step.The
FindCUDAToolkit
module:gained support for the
sbsa-linux
cross compilation target, andnow provides an imported target for
nvrtc_static
, if found.
The
FindImageMagick
module now provides imported targets.The
FindPython3
andFindPython
modules gained support for the Stable Application Binary Interface.The
UseSWIG
module gained support for theperl5
language.
Generator Expressions¶
The
$<BUILD_LOCAL_INTERFACE:...>
generator expression was added to prevent usage requirements from being exported to dependent projects.
CTest¶
The
CTEST_NO_TESTS_ACTION
environment variable was added to provide a default value for the--no-tests=<action>
command line argument ofctest(1)
.
Deprecated and Removed Features¶
The
CMakeFiles/CMakeOutput.log
andCMakeFiles/CMakeError.log
files are no longer populated by CMake's built-in modules.cmake(1)
no longer suggests looking at them after aCMake Error
occurs. Information previously logged to those files is instead logged to thecmake-configure-log(7)
.On CYGWIN, the undocumented
CMAKE_LEGACY_CYGWIN_WIN32
mode for compatibility with CMake versions older than 2.8.4 has been removed.
Other Changes¶
Language Standard Flags, such as
-std=c++11
, when generated due totarget_compile_features()
orCMAKE_<LANG>_STANDARD
, are now placed before flags added bytarget_compile_options()
, rather than after them.For all
COMPILE_DEFINITIONS
properties, any leading-D
on an item is removed whether or not it was specified by a generator expression.The
compile_commands.json
database enabled byCMAKE_EXPORT_COMPILE_COMMANDS
now provides theoutput
field in the compile commands objects. This allows multi-config generators, such as theNinja Multi-Config
generator, to provide the compile commands for all configurations.The
USE_FOLDERS
global property is treated asON
by default. See policyCMP0143
.The top-level
project()
call will now emit an author warning if the documented command order in relation tocmake_minimum_required()
is not respected.The
cmake --trace
option now followstry_compile()
andtry_run()
invocations.