Changes made since CMake 3.19 include the following.
cmake-presets(7)gained support for build and test presets.
Makefile Generators, for some toolchains, now use the compiler to extract implicit dependencies while compiling source files.
CUDAlanguage support now works when
nvccis a symbolic link, for example due to a
The NVIDIA HPC SDK compilers are now supported with compiler id
The Intel oneAPI NextGen LLVM compilers are now supported with compiler id
icpxC/C++ compilers on Linux, and the
icxC/C++ compiler on Windows, are fully supported as of oneAPI 2021.1.
ifxFortran compiler on Linux is supported as of oneAPI 2021.1.
ifxFortran compiler on Windows is not yet supported.
The Intel oneAPI Classic compilers (
ifort) continue to be supported with compiler id
Support was added for the IAR STM8 compiler.
CMake's support for Cross Compiling for Android is now merged with the Android NDK's toolchain file. They now have similar behavior, though some variable names differ. User-facing changes include:
cmake-file-api(7)gained a new "toolchains" object kind that describes the compiler used for each enabled language.
DEPENDSoptions gained support for new generator expressions
$<OUTPUT_CONFIG:...>that control cross-config handling when using the
add_library()command previously prohibited imported object libraries when using potentially multi-architecture configurations. This mostly affected the
Xcodegenerator, e.g. when targeting iOS or one of the other device platforms. This restriction has now been removed.
cmake_path()command was added for operations on filesystem paths.
FILE_PERMISSIONSoptions to support copying of permissions of the source file and using specified permissions respectively.
file(GENERATE)command gained a
NEWLINE_STYLEoption to specify how newlines are handled for the generated file.
FILE_PERMISSIONSoptions for controlling the permissions of the generated file.
target_include_directories()command gained a new option
try_run()command gained a
WORKING_DIRECTORYoption to set the working directory in which to run the compiled check executable.
UNITY_BUILD_UNIQUE_IDtarget property was added to support generation of an identifier that is unique per source file in unity builds. It can help to resolve duplicate symbol problems with anonymous namespaces.
WIN32_EXECUTABLEtarget property now works with Clang on Windows.
XCODE_EMBED_FRAMEWORKStarget property was added to tell the
Xcodegenerator to embed frameworks. Aspects of the embedding can be customized with the
ExternalProject_Add()function gained a
CONFIGURE_HANDLED_BY_BUILDoption. This can be used to make subsequent runs of the configure step be triggered by the build step when an external project dependency rebuilds instead of always re-running the configure step in such cases.
FindBoostmodule gained a
Boost_NO_WARN_NEW_VERSIONSoption to silence the warning about unknown dependencies for new Boost versions.
FindCUDAToolkitmodule gained support for finding CUDA toolkits when
nvccis a symbolic link, for example due to a
FindGDALmodule has been improved to document and mark as advanced its cache variables. There is a new
FindGDAL_SKIP_GDAL_CONFIGvariable which may be used to skip over the
gdal-config-based search. Users may also set
GDAL_ADDITIONAL_LIBRARY_VERSIONSto add additional versions to the library name search strategy.
FindIntlmodule now provides an imported target.
FindOpenSSLmodule learned to support a version range.
GENERATE_NATIVE_HEADERSfeature gained options to export the generated target.
The AUTOMOC feature now works with per-config sources.
--test-diroption to specify the directory in which to look for tests.
CPack DEB Generatorlearned a new
CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRSvariable to specify additional search directories for resolving private library dependencies when using
CPack IFW Generatorgained a new
CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LISTvariable to control visibility of the widget listing installer pages on the left side of the wizard. This feature available only since QtIFW 4.0.
CPack NuGet Generatorgained options:
CPack NuGet Generatordeprecated some variables to reflect changes in the NuGet specification:
Source file extensions must now be explicit. See policy
On AIX, installation of XCOFF executables and shared libraries no longer requires relinking to change the runtime search path from the build-tree RPATH to the install-tree RPATH. CMake now edits the XCOFF binaries directly during installation, as has long been done on ELF platforms.
The precompiled Linux binaries provided on cmake.org have changed their naming pattern to
The precompiled Windows binaries provided on cmake.org have changed their naming pattern to
Changes made since CMake 3.20.0 include the following.
FindIntlmodule in CMake 3.20.0 added checks
Intl_IS_BUILTIN, but they were not implemented correctly. These have been removed and replaced with a single
Intl_IS_BUILT_INcheck, whose name is consistent with the
-rpathlinker flag is now specified as supported on all Apple platforms, not just macOS. The
install_name_dirused for iOS, tvOS and watchOS should now default to
@rpathinstead of using a full absolute path and failing at runtime when the library or framework is embedded in an application bundle (see
The Intel Classic 2021 compiler version numbers are now detected correctly as having major version 2021. CMake 3.20.1 and below were not aware of a change to the identification macro version scheme made by Intel starting in version 2021, and detected the version as 20.2.
The Intel oneAPI Fortran compiler is now identified as
IntelLLVM. The oneAPI 2021.1 Fortran compiler is missing an identification macro, so CMake 3.20.1 and below identified it as
Intel. CMake now has a special case to recognize oneAPI 2021.1 Fortran as
IntelLLVM. The oneAPI 2021.2 Fortran compiler defines the proper identification macro and so is identified as
IntelLLVMby all CMake 3.20 versions.
These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions.