CMake 3.23 Release Notes¶
Contents
Changes made since CMake 3.22 include the following.
New Features¶
Presets¶
cmake-presets(7)
files now support schema version4
.cmake-presets(7)
files now have an optionalinclude
field,which allows the files to include other files.cmake-presets(7)
files now support a${fileDir}
macro, whichcontains the directory containing the preset file.cmake-presets(7)
gained support for specifying theresolvePackageReferences
command line option in a build preset to controlrestoration behavior of package references from external package managers.Currently this is only supported by the Visual Studio generator to supportrestoring packages from NuGet. Other generators ignore this option.
Generators¶
TheVisual Studio Generators for VS 2019 and above learned tosupport .NET SDK-style project files (
.csproj
) for C# projects.See theDOTNET_SDK
target property and correspondingCMAKE_DOTNET_SDK
variable.add_custom_command()
is not yet supported in .NET SDK-style projects.TheVisual Studio Generators for VS 2017 and above learned touse portable instances of Visual Studio not known to the VS installer.See the
CMAKE_GENERATOR_INSTANCE
variable.
Command-Line¶
The
cmake(1)
--build
command, when used withVisual Studio Generators on projects that set theVS_PACKAGE_REFERENCES
target property, now automaticallyrestores package references from NuGet. The cache variableCMAKE_VS_NUGET_PACKAGE_RESTORE
may be set to toggle this behaviorin a build tree. Use the--resolve-package-references=<on|off|only>
command-line option to control the behavior on one invocation.The
cmake(1)
command line tool gained a--debug-find-pkg=
option to enable debug messages under specificfind_package()
calls.The
cmake(1)
command line tool gained a--debug-find-var=
option to enable debug messages forfind_*
calls that use specificresult variables.
Compilers¶
The IBM Open XL C/C++ compiler, based on LLVM, is now supported withcompiler id
IBMClang
.The MCST LCC compiler is now supported with compiler id
LCC
.See policyCMP0129
.
File-Based API¶
The
cmake-file-api(7)
"codemodel" version 2version
fieldhas been updated to2.4
.The
cmake-file-api(7)
"codemodel" version 2directory
objectinstallers
field gained a newfileSet
installer type.
Commands¶
The
define_property()
command gained a newINITIALIZE_FROM_VARIABLE
option to cause a target property to beinitialized from a variable when a target is created.The
install(TARGETS)
command gained a newFILE_SET
argument,which can be used to install header file sets associated with a target.The
string(TIMESTAMP)
andfile(TIMESTAMP)
commands nowsupport the%f
specifier for microseconds.The
target_sources()
command gained a newFILE_SET
mode, whichcan be used to add headers as header-only source files of a target.
Variables¶
The
CMAKE_CUDA_ARCHITECTURES
variable and associatedCUDA_ARCHITECTURES
target property now support theall
, andall-major
values for CUDA toolkit 7.0+.The
CMAKE_IGNORE_PREFIX_PATH
andCMAKE_SYSTEM_IGNORE_PREFIX_PATH
variables were addedto tell thefind_package()
,find_program()
,find_library()
,find_path()
, andfind_file()
commands to ignore specified prefixes.The
CMAKE_LINK_LIBRARIES_ONLY_TARGETS
variable andcorrespondingLINK_LIBRARIES_ONLY_TARGETS
targetproperty were added to optionally require that all link itemsthat can be target names are actually names of existing targets.
Properties¶
The
HEADER_SETS
andINTERFACE_HEADER_SETS
read-onlytarget properties were added to list header sets associated with a target.The
HEADER_SET
andHEADER_SET_<NAME>
targetproperties were added to list files in the default header setand named header sets, respectively.The
HEADER_DIRS
andHEADER_DIRS_<NAME>
targetproperties were added to specify the base directories of the defaultheader set and named header sets, respectively.The
IMPORTED_NO_SYSTEM
target property was added tospecify that anImported Target shouldnot be treated as a system library (i.e. its include directoriesare not automaticallySYSTEM
).The
XCODE_EMBED_PLUGINS
target propertywas added to tell theXcode
generator what targets to put intheEmbedPlugIns
build phase.The
XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE
target propertyand supportingCMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE
variable were added to tell theXcode
generator to enablespecifying the Xcode scheme option propertyGPUFrameCapture
.
Modules¶
The
CheckPIESupported
module now supports theOBJC
,OBJCXX
,CUDA
, andHIP
languages. It also now honorsCMAKE_SYSROOT
andCMAKE_OSX_SYSROOT
.The
ExternalProject
module'sExternalProject_Add()
command gained support for aUSES_TERMINAL_PATCH
option to givethe patch step exclusive terminal access.The
FindCUDAToolkit
module now provides a target forlibcufft_static_nocallback
, if found.The
FindGLUT
module now provides theGLUT_INCLUDE_DIRS
result variable to conform with naming conventions documented in thecmake-developer(7)
manual. This supersedes the legacyGLUT_INCLUDE_DIR
variable.The
FindGTest
module now provides a target for GMock, if found.The
FindVulkan
module now provides aVulkan_VERSION
resultvariable reporting the version number.
CTest¶
ctest(1)
gained a newCTEST_SUBMIT_INACTIVITY_TIMEOUT
variable, which can be used to specify a timeout for submission inactivity.
CPack¶
The
CPackproductbuildGenerator
gained the newCPACK_PRODUCTBUILD_DOMAINS
,CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE
,CPACK_PRODUCTBUILD_DOMAINS_USER
, andCPACK_PRODUCTBUILD_DOMAINS_ROOT
variables foradding the domains element to the Distribution XML. With these variables,it is now possible to install products to the user's home directorywithout requiring administrative privileges.The
CPackproductbuildGenerator
gained a new variable,CPACK_PRODUCTBUILD_IDENTIFIER
, used to customize the uniqueproduct identifier associated with the product.The
CPack.distribution.dist.in
template used by theCPackproductbuildGenerator
andCPackPackageMakerGenerator
was updated to use a newCPACK_APPLE_PKG_INSTALLER_CONTENT
variable for its main content.This replaced the previously undocumented and now deprecatedCPACK_PACKAGEMAKER_CHOICES
variable.The
CPackIFWGenerator
gained the newCPACK_IFW_ARCHIVE_FORMAT
andCPACK_IFW_ARCHIVE_COMPRESSION
variables for setting theformat used when packaging new component data archives, and choosingthe compression level used.These features are available for QtIFW 4.2 and newer.The
CPackIFWGenerator
gained newCPACK_IFW_PACKAGE_DISABLE_COMMAND_LINE_INTERFACE
variable toprevent the user from passing any consumer command to the installer, likeinstall
,update
, andremove
.This feature is available for QtIFW 4.0 and newer.The
CPackIFWGenerator
gained the newCPACK_IFW_PACKAGE_PRODUCT_IMAGES
variable for adding alist of images to be shown on thePerformInstallationPage
.This feature is available for QtIFW 4.0 and newer.The
CPackIFWGenerator
gained the newCPACK_IFW_PACKAGE_RUN_PROGRAM
,CPACK_IFW_PACKAGE_RUN_PROGRAM_ARGUMENTS
, andCPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION
variables forexecuting a command after the installer is done if the user acceptsthe action. This feature is available for QtIFW 4.0 and newer.The
CPackIFWGenerator
gained the newCPACK_IFW_PACKAGE_SIGNING_IDENTITY
variable for specifying acode signing identity to be used for signing the generated app bundle.This feature is available on macOS only, and for QtIFW 3.0 and newer.The
CPackWIXGenerator
gained a new variable,CPACK_WIX_SKIP_WIX_UI_EXTENSION
, to skip the inclusionof WixUIExtensions.
Deprecated and Removed Features¶
cmake(1)
now warns when multiple source paths are specified,as incmake-Ssrc1src2
. This has never been officially documentedor supported, but older versions accidentally accepted multiple sourcepaths and used the last path specified. Update scripts to avoidpassing multiple source path arguments.The
cpack(1)
undocumentedOSXX11
generator has been removed.The previously undocumented
CPACK_PACKAGEMAKER_CHOICES
variable used intheCPack.distribution.dist.in
template has been replaced by a newCPACK_APPLE_PKG_INSTALLER_CONTENT
variable. This only affects projectsthat were providing their own customCPack.distribution.dist.in
templatefile, but still relied onCPACK_PACKAGEMAKER_CHOICES
being set. Thosecustom template files should be updated to useCPACK_APPLE_PKG_INSTALLER_CONTENT
instead, or to fully define all thetemplate file's contents without relying on substitution of either variable.
Other Changes¶
The
CPackDragNDropGenerator
no longer attachesCPACK_RESOURCE_FILE_LICENSE
as the license agreement inthe generated.dmg
unless explicitly activated by aCPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE
option.In CMake projects, theCPack
module enables the optionby default for compatibility.CUDA
targets may now enable bothCUDA_SEPARABLE_COMPILATION
andCUDA_PTX_COMPILATION
.CUDA
compiler detection now:issues an error in all cases when it's unable to compute the defaultarchitecture(s) if required (see
CMP0104
),handles
OFF
forCMAKE_CUDA_ARCHITECTURES
on Clang,supports the theoretical case of multiple default architectures, and
tries to detect invalid architectures and issue an error.
CUDA
with Clang now implements policyCMP0105
andthe$<DEVICE_LINK:...>
and$<HOST_LINK:...>
generatorexpressions
.The
define_property()
command'sBRIEF_DOCS
andFULL_DOCS
arguments are now optional.ccmake(1)
may now be enabled on Windows when buildingCMake from source. This is experimental, and so is not includedin official distributions.
Updates¶
Changes made since CMake 3.23.0 include the following.
3.23.1¶
The
target_sources()
FILE_SET
feature added in CMake 3.23.0does not yet place header files properly in AppleFRAMEWORK
targets. Pending further work in a future version of CMake, it is nowan error to add aFILE_SET
of typeHEADERS
to such targets onApple platforms.The
HEADER_SETS
andINTERFACE_HEADER_SETS
targetproperties added in CMake 3.23.0 are now read-only records of the headersets created by thetarget_sources()
command.
3.23.2¶
The
CPACK_PACKAGEMAKER_CHOICES
variable used in theCPack.distribution.dist.in
template file was replaced by a newCPACK_APPLE_PKG_INSTALLER_CONTENT
variable in CMake 3.23.0.This broke projects that provided their own template file but stillexpected theCPACK_PACKAGEMAKER_CHOICES
variable to be defined.The oldCPACK_PACKAGEMAKER_CHOICES
variable is now also set to thesame content as it was before, but it is formally deprecated.
3.23.3, 3.23.4, 3.23.5¶
These versions made no changes to documented features or interfaces.Some implementation updates were made to support ecosystem changesand/or fix regressions.