CMake 3.25 Release Notes¶
Contents
Changes made since CMake 3.24 include the following.
New Features¶
Presets¶
- The
cmake-presets(7)schema version has been bumped to6. - The
cmake-presets(7)format now supports apackagePresetsfield to specify presets forcpack --preset. - The
cmake-presets(7)format now supports aworkflowPresetsfield to specify presets forcmake --workflow. - The
cmake-presets(7)format now supports anoutputJUnitFilefield to specify JUnit output in test presets.
Languages¶
- The
Compile Featuresfunctionality is now aware of C++26, and defines acxx_std_26meta-feature. C++26 compiler modes may also be specified via theCXX_STANDARD,CUDA_STANDARD,HIP_STANDARD, orOBJCXX_STANDARDtarget properties. CUDAlanguage support now includes device link-time optimization when usingnvcc. TheCMAKE_INTERPROCEDURAL_OPTIMIZATIONvariable and the associatedINTERPROCEDURAL_OPTIMIZATIONtarget property will activate device LTO.
Command-Line¶
- A
cmake --workflow --presetmode was added to drive sequences of configure, build, test, and package operations through a single command. - The
cmake -E capabilitiescommand gained a newtlsfield that tells whether or not TLS is enabled. - The
cmake -E envcommand-line tool gained a--modifyflag to supportENVIRONMENT_MODIFICATIONoperations. - The
cmake --debug-trycompileoption now prints log messages reporting the directory in which each try-compile check is done.
Compilers¶
- Support for the Tasking compiler toolsets (SmartCode, TriCore,
Standalone: ARM, MCS, 8051) was added with compiler id
Tasking. See theCMAKE_TASKING_TOOLSETvariable.
Commands¶
- The
add_subdirectory()command gained aSYSTEMoption to enable theSYSTEMdirectory property in the subdirectory. - The
block()andendblock()commands were added to manage specific scopes (policy or variable) for a contained block of commands. - The
cmake_language()command gained a newGET_MESSAGE_LOG_LEVELsub-command. It can be used to query the current message logging level. - The
find_file(),find_path(),find_library(), andfind_program()commands gained aVALIDATORoption to specify a function to be called for each candidate item to validate it. - The
find_package()command now considers paths of the form<prefix>/<name>*/(cmake|CMake)/<name>*/when searching for package configuration files. - The
return()command gained aPROPAGATEoption to propagate variables to the scope to which control returns. See policyCMP0140. - The
try_compile()andtry_run()commands gained new signatures that more consistently use keyword dispatch and do not require a binary directory to be specified. Additionally, these signatures use a unique directory for each invocation, which allows multiple outputs to be preserved when usingcmake --debug-trycompile. - The
try_compile()andtry_run()commands gained the optionNO_CACHEto store results in normal variables. - The
try_run()command gainedRUN_OUTPUT_STDOUT_VARIABLEandRUN_OUTPUT_STDERR_VARIABLEoptions to capture stdout and stderr separately from the output of the compiled program.
Variables¶
- The
BSDandCMAKE_HOST_BSDvariables are now set to a string value when the target or host system is BSD, respectively. - The
LINUXandCMAKE_HOST_LINUXvariables are now set to true when the target or host system is Linux, respectively. - The
CMAKE_MSVC_DEBUG_INFORMATION_FORMATvariable andMSVC_DEBUG_INFORMATION_FORMATtarget property were introduced to select the debug information format for compilers targeting the MSVC ABI. See policyCMP0141. - The
CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATIONvariable and correspondingXCODE_SCHEME_ENABLE_GPU_API_VALIDATIONtarget property were added to tell theXcodegenerator what to put in the scheme'sMetal: API Validationsetting. - The
CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATIONvariable and correspondingXCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATIONtarget property were added to tell theXcodegenerator what to put in the scheme'sMetal: Shader Validationsetting. - The
CMAKE_XCODE_SCHEME_LAUNCH_MODEvariable and correspondingXCODE_SCHEME_LAUNCH_MODEtarget property were added to tell theXcodegenerator what to put in the scheme's "Launch" mode setting. - The
CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATIONvariable and correspondingXCODE_SCHEME_LAUNCH_CONFIGURATIONtarget property were added to tell theXcodegenerator what configuration to put in the scheme's Launch action.
Properties¶
- The
<LANG>_COMPILER_LAUNCHERtarget property now supportsgenerator expressions. - The
EXPORT_NO_SYSTEMtarget property was added to specify thatinstall(EXPORT)andexport()commands will generate na imported target withSYSTEMpropertyOFF. - The
SYSTEMtarget property was added to specify whether a target should be treated as a system library (i.e. its include directories are automaticallySYSTEMwhen compiling consumers). If not set, the default is the previous behavior: on for imported targets and off for other targets. - The
SYSTEMdirectory property was added to initialize theSYSTEMtarget property for targets created in that directory.
Modules¶
The
FetchContentmodule'sFetchContent_Declare()command gained aSYSTEMoption which sets theSYSTEMdirectory property on subdirectories created byFetchContent_MakeAvailable().The
FindCUDAToolkitmodule now provides a target for nvtx3 for CUDA 10.0+, which supersedes nvToolsExt. A deprecation warning is emitted when usingnvToolsExtif the project requires CMake 3.25 and CUDA 10.0+ is used.The
FindDoxygenmodule's version handling has been improved:- Multiple candidate installations will now be considered, if needed, to satisfy version constraints. Previously, only the first one encountered would be considered.
- Version ranges are supported.
- Variations in the version format reported by Doxygen are now tolerated (e.g. a trailing git commit hash).
The
FindOpenALmodule now provides an imported target.The
FindOpenSPmodule was added to find the OpenSP library.The
FindVulkanmodule gained support for new components:dxcDirectX Shader Compiler.
volkVolk open-source vulkan meta-loader.
CPack¶
- The
CPack Archive Generatorgained a newCPACK_ARCHIVE_FILE_EXTENSIONvariable to control the package file name extension. - The
CPack NSIS Generatorgained two new variablesCPACK_NSIS_EXECUTABLE_PRE_ARGUMENTSandCPACK_NSIS_EXECUTABLE_POST_ARGUMENTSto provide arguments to the nsis executable invocation. - The
CPackmodule gained theCPACK_READELF_EXECUTABLE,CPACK_OBJCOPY_EXECUTABLE, andCPACK_OBJDUMP_EXECUTABLEvariables to control the locations of binutils used bycpack(1).
Deprecated and Removed Features¶
- The
IMPORTED_NO_SYSTEMtarget property has been deprecated in favor ofSYSTEMandEXPORT_NO_SYSTEM. - The
Visual Studio 10 2010generator has been removed. - The
Visual Studio 11 2012generator is now deprecated and will be removed in a future version of CMake.
Other Changes¶
- The
SSL_CERT_FILEandSSL_CERT_DIRenvironment variables can now be used to override where to find certificate authorities for TLS/SSL operations. - If
<LANG>_CLANG_TIDYincludes a-pargument, the full compiler command line is no longer appended after--. - The
Xcodegenerator no longer adds the per-config suffix$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)to library search paths. See policyCMP0142.
Updates¶
Changes made since CMake 3.25.0 include the following.
3.25.1¶
- On Windows, when targeting the MSVC ABI, the
find_library()command no longer accepts.afile names. This behavior was added in CMake 3.25.0, but has been reverted due finding GNU-ABI libraries in cases we did not previously.