CMake 3.23 Release Notes

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

Command-Line

  • Thecmake(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.

  • Thecmake(1) command line tool gained a--debug-find-pkg=option to enable debug messages under specificfind_package()calls.

  • Thecmake(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 idIBMClang.

  • The MCST LCC compiler is now supported with compiler idLCC.See policyCMP0129.

File-Based API

  • Thecmake-file-api(7) "codemodel" version 2version fieldhas been updated to2.4.

  • Thecmake-file-api(7) "codemodel" version 2directoryobjectinstallers field gained a newfileSet installer type.

Commands

  • Thedefine_property() command gained a newINITIALIZE_FROM_VARIABLE option to cause a target property to beinitialized from a variable when a target is created.

  • Theinstall(TARGETS) command gained a newFILE_SET argument,which can be used to install header file sets associated with a target.

  • Thestring(TIMESTAMP) andfile(TIMESTAMP) commands nowsupport the%f specifier for microseconds.

  • Thetarget_sources() command gained a newFILE_SET mode, whichcan be used to add headers as header-only source files of a target.

Variables

Properties

Modules

  • TheCheckPIESupported module now supports theOBJC,OBJCXX,CUDA, andHIP languages. It also now honorsCMAKE_SYSROOT andCMAKE_OSX_SYSROOT.

  • TheExternalProject module'sExternalProject_Add()command gained support for aUSES_TERMINAL_PATCH option to givethe patch step exclusive terminal access.

  • TheFindCUDAToolkit module now provides a target forlibcufft_static_nocallback, if found.

  • TheFindGLUT module now provides theGLUT_INCLUDE_DIRSresult variable to conform with naming conventions documented in thecmake-developer(7) manual. This supersedes the legacyGLUT_INCLUDE_DIR variable.

  • TheFindGTest module now provides a target for GMock, if found.

  • TheFindVulkan module now provides aVulkan_VERSION resultvariable reporting the version number.

CTest

CPack

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.

  • Thecpack(1) undocumentedOSXX11 generator has been removed.

  • The previously undocumentedCPACK_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

Updates

Changes made since CMake 3.23.0 include the following.

3.23.1

  • Thetarget_sources()FILE_SET feature added in CMake 3.23.0does not yet place header files properly in AppleFRAMEWORKtargets. Pending further work in a future version of CMake, it is nowan error to add aFILE_SET of typeHEADERS to such targets onApple platforms.

  • TheHEADER_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

  • TheCPACK_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.