CMake 3.29 Release Notes¶
Changes made since CMake 3.28 include the following.
New Features¶
Command-Line¶
Generators¶
Visual Studio Generators now support selecting between the Intel oneAPI Fortran compiler (
ifx) and the Intel classic Fortran compiler (ifort) using afortran=field inCMAKE_GENERATOR_TOOLSET.
File-Based API¶
The
cmake-file-api(7)"codemodel" version 2versionfield has been updated to 2.7.The
cmake-file-api(7)"codemodel" version 2 "target" object gained a new "launchers" field.
Compilers¶
The LLVM/Clang GNU-like frontend on Windows (
clang++) may now be used to compileCUDAlanguage sources.Compilers targeting the GNU ABI on Windows (MinGW) may now be used to compile Objective C (
OBJC) and Objective C++ (OBJCXX). These include GNU compilers (gccandg++) and the LLVM/Clang GNU-like frontends (clangandclang++).TI Clang-based compilers are now supported with
compiler idTIClang.
Commands¶
The add_custom_command(TARGET) signature now supports adding build events through Alias Targets.
The
cmake_language(EXIT)sub-command was added to terminatecmake -Pscripts with a specified exit code.The
export(SETUP)sub-command was added to configure export sets. ItsTARGEToption'sXCFRAMEWORK_LOCATIONsetting specifies the location of a.xcframeworkthat can be substituted for an installed target.The
if()command gained new testsIS_READABLE,IS_WRITABLEandIS_EXECUTABLEto check file or directory permissions.
Variables¶
The
CMAKE_INSTALL_PREFIXenvironment variable was added to provide a default value for theCMAKE_INSTALL_PREFIXvariable.The
CMAKE_LINKER_TYPEvariable and correspondingLINKER_TYPEtarget property were added to specify what linker to use with some toolchains.The
CMAKE_<LANG>_COMPILER_LINKER,CMAKE_<LANG>_COMPILER_LINKER_ID,CMAKE_<LANG>_COMPILER_LINKER_VERSIONandCMAKE_<LANG>_COMPILER_LINKER_FRONTEND_VARIANTvariables were added to describe the linker used by the language's link step.The
CMAKE_PROJECT_INCLUDE,CMAKE_PROJECT_INCLUDE_BEFORE,CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE, andCMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFOREvariables learned to support a semicolon-separated list of CMake language files to be included sequentially. These variables can also reference module names to be found inCMAKE_MODULE_PATHor builtin to CMake.The
CMAKE_SKIP_TEST_ALL_DEPENDENCYvariable was added to control whether thetest(orRUN_TESTS) buildsystem target depends on theall(orALL_BUILD) target.A
CMAKE_TEST_LAUNCHERvariable and correspondingTEST_LAUNCHERtarget property were added to specify a launcher to be used by executable targets when invoked by tests added by theadd_test()command.
Properties¶
The
CROSSCOMPILING_EMULATORtarget property now supportsgenerator expressions.The
UNITY_BUILDtarget property now supports the Objective C (OBJC) and Objective C++ (OBJCXX) languages.The
XCODE_EMBED_XPC_SERVICEStarget property was added to tell theXcodegenerator what targets to put in theEmbed XPC Resourcesbuild phase.
Modules¶
The
CMakePackageConfigHelpersmodule gained newgenerate_apple_platform_selection_file()andgenerate_apple_architecture_selection_file()functions, which can be used to generate a file that includes another Apple-platform-specific file or the includes an architecture-specific implementation of a package for an Apple platform, respectively.The
FindOpenGLmodule learned to find a GLU include directory different than the GL include directory. A newOPENGL_INCLUDE_DIRSresult variable provides all include directories.
CTest¶
ctest(1)gained a--http-headeroption to add custom headers on submission to CDash.ctest(1)gained the--tests-from-fileand--exclude-from-fileoptions to run or exclude tests named in a file.ctest(1)now supports job server integration on POSIX systems.The
ctest -joption may now be given without a value to let ctest choose a default level of parallelism, or with0to let ctest use unbounded parallelism. The correspondingCTEST_PARALLEL_LEVELenvironment variable, if set to the empty string, is now equivalent to passing-jwith no value.The
ctest_test()command gained optionsINCLUDE_FROM_FILEandEXCLUDE_FROM_FILEto run or exclude tests named in a file.
CPack¶
The
CPack DEB GeneratorCPACK_DEBIAN_FILE_NAMEvariable may now be set without any suffix, and the.debsuffix will be added automatically.The
CPack RPM GeneratorCPACK_RPM_FILE_NAMEvariable may now be set without any suffix, and the.rpmsuffix will be added automatically.The
CPack WIX Generatorgained a new variable,CPACK_WIX_INSTALL_SCOPE, to control theInstallScopeproperty of WiX MSI installers.
Other Changes¶
CMake learned to de-duplicate libraries on link lines based on linker capabilities. See policy
CMP0156.The
add_test()command now honorsCMAKE_CROSSCOMPILING_EMULATORonly when cross-compiling. See policyCMP0158.On Windows, when targeting the MSVC ABI, the
find_library()command now accepts.afile names after first considering.lib. This is symmetric with existing behavior when targeting the GNU ABI, in which the command accepts.libfile names after first considering.a.On Windows, when targeting the MSVC ABI, the
find_library()command now considers.dll.libfile names before.lib. This is the default suffix for DLL import libraries created by Rust toolchains for the MSVC ABI.The
NinjaandNMake Makefilesgenerators now use the-external:Iflag for system includes when using IntelLLVM as of version 2021.4. The-external:W0flag is also used as of version 2022.2.The
create_test_sourcelist()command now provides a full path to the generated driver source file.The
CPACK_PRODUCTBUILD_DOMAINSvariable now defaults to true. See policyCMP0161.
Updates¶
Changes made since CMake 3.29.0 include the following.
3.29.1¶
The
CMAKE_LINKER_TYPEvariable and correspondingLINKER_TYPEtarget property now work with compilers for theSwiftlanguage.
3.29.2, 3.29.3, 3.29.4¶
These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions.
3.29.5¶
The
CPack WIX Generator'sCPACK_WIX_INSTALL_SCOPEvariable, new in 3.29, now defaults toNONE. This restores compatibility with behavior of 3.28 and below: without a custom WiX template, it produces installers that only create start menu and uninstall entries for the current user, even though they install for all users.In 3.29.0 through 3.29.4,
CPACK_WIX_INSTALL_SCOPEdefaulted toperMachine. This created MSI installers that create start menu and uninstall entries for all users by default. While this behavior is better on its own, these installers do not cleanly replace existing installations created with MSI installers produced by 3.28 and below. 3.29.5 reverts the default for compatibility. Projects may transition toperMachineon their own schedule by settingCPACK_WIX_INSTALL_SCOPE.
3.29.6¶
This version made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions.