Changes made since CMake 3.20 include the following.
cmake-presets(7)gained support for specifying the install prefix in a configure preset.
cmake-presets(7)gained support for conditional enabling of presets.
cmake-presets(7)gained support for a
cmake-presets(7)gained support for omitting the
Visual Studio 17 2022generator was added. This is experimental and based on "Visual Studio 2022 Preview 2" because this version of VS has not been released.
The Makefile Generators and the
Ninjagenerator learned to add linker launcher tools along with the linker for
OBJCXXlanguages. See the
<LANG>_LINKER_LAUNCHERtarget property for details.
--install-prefix <dir>command-line option to specify the location of the install prefix.
--toolchain <path/to/file>command-line option to specify a toolchain file.
Messages printed to a terminal now may be colored by message type.
The Fujitsu compiler is now supported using compiler id
Fujitsuin traditional (
Trad) mode, and compiler id
CMake now supports the MSYS runtime environment, much like CYGWIN.
build_command()command gained a
file(COPY_FILE)command was added to copy a single file.
file(GET_RUNTIME_DEPENDENCIES)command gained new
file(REAL_PATH)command gained the option
EXPAND_TILDEto replace any leading tilde with the path to the user's home directory.
file(RENAME)command learned to optionally capture failure in a result variable. It also gained a
NO_REPLACEoption to fail if the destination exists.
install()command gained a new
IMPORTED_RUNTIME_ARTIFACTSmode, which can be used to install the runtime artifacts of imported targets.
install(SCRIPT|CODE)command supports a new option
ALL_COMPONENTSwhich allows the corresponding code to run for every component of a per component installation.
XCODE_EMBED_APP_EXTENSIONStarget property was added to tell the
Xcodegenerator to embed app extensions such as iMessage sticker packs. Aspects of the embedding can be customized with the
FindDevILmodule now provides imported targets.
FindIconvmodule now has version support.
FindIntlmodule now has version support.
FindMPImodule learned to support
FujitsuClangin both host and cross compiling modes.
FindOpenMPmodule learned to support
FindVulkanmodule gained imported targets
RESOURCESoption to allow explicit naming of resources with non-optional namespace.
TARGET_RUNTIME_DLLSgenerator expression was added.
ctest(1)learned to recognize files attached to a test at run time. Previously it was only possible to attach files to tests at configure time by using the
ATTACHED_FILES_ON_FAILtest properties. See Additional Test Measurements for more information.
--output-junitoption to write test results to a JUnit XML file.
ctest_build()command gained a
CPack IFW Generatornow supports hyphens in names given to
DEPENDENCIESarguments. This requires QtIFW 3.1 or later.
CPACK_CUSTOM_INSTALL_VARIABLESvariable was added to set variables in
cmake_install.cmakescript invocations made by CPack.
CMAKE_SYSTEM_NAMEversion-stripping behavior has been removed entirely. If it is set by a
-Dflag or by a
toolchain file, it is left unaltered, even if it still contains a version number. Similar
CMAKE_HOST_SYSTEM_NAMEversion-stripping behavior, also undocumented, has been moved earlier, before
ARMClangcpu/arch compile and link flags are no longer added automatically based on the
CMAKE_SYSTEM_PROCESSORvariable or the undocumented
CMAKE_SYSTEM_ARCHvariable. They must be specified explicitly. See policy
REMOVE_ATsubcommands now error with invalid (i.e., non-integer) values are given as any of their index arguments based on the setting of policy
target_link_libraries()calls referencing object libraries via the
TARGET_OBJECTSgenerator expression now place the object files before all libraries on the link line, regardless of their specified order. See documentation on Linking Object Libraries via $<TARGET_OBJECTS> for details.
The Ninja Generators now pass source files and include directories to the compiler using absolute paths. This makes diagnostic messages and debug symbols more consistent, and matches the Makefile Generators.
NMake Makefilesgenerator now encodes the generated makefiles as UTF-8 with a BOM when using
nmakefrom VS 9 or above.
The Visual Studio Generators for VS 2010 and above now place per-source preprocessor definitions after target-wide preprocssor definitions. This makes VS consistent with the Ninja Generators and the Makefile Generators.
Changes made since CMake 3.21.0 include the following.
Visual Studio 17 2022generator is now based on "Visual Studio 2022 Preview 2". Previously it was based on "Preview 1.1".