CMake 3.28 Release Notes¶
Changes made since CMake 3.27 include the following.
New Features¶
Languages¶
C++ 20 named modules are now supported by Ninja Generators and Visual Studio Generators for VS 2022 and newer, in combination with the MSVC 14.34 toolset (provided with VS 17.4) and newer, LLVM/Clang 16.0 and newer, and GCC 14 (after the 2023-09-20 daily bump) and newer. See
cmake-cxxmodules(7)for details.HIPlanguage code may now be compiled for NVIDIA GPUs using the NVIDIA CUDA Compiler (NVCC). See theCMAKE_HIP_PLATFORMvariable.
Platforms¶
On Apple platforms,
.xcframeworkfolders are now supported:The
find_library()command now finds.xcframeworkfolders.The
target_link_libraries()command now supports linking against a.xcframeworkfolder.The
IMPORTED_LOCATIONtarget property of an imported library target may now be the path to a.xcframeworkfolder.
Apple visionOS and its
xrosandxrsimulatorSDKs are now supported. Compiling for Apple visionOS can be requested by settingCMAKE_SYSTEM_NAMEtovisionOS. See Cross Compiling for iOS, tvOS, visionOS, or watchOS for more information.
Presets¶
cmake-presets(7)files now support schema version8. It adds support for a$schemafield.
Compilers¶
Cray Clang-based compilers are now supported with
compiler idCrayClang.The OrangeC compiler is now supported with
compiler idOrangeC.
Commands¶
The
add_custom_command()andadd_custom_target()commands gained aJOB_SERVER_AWAREoption.The
cmake_host_system_information()command gained aMSYSTEM_PREFIXquery for the installation prefix of a MSYS or MinGW development environment on Windows hosts.The
set_property()commandTESTmode gained aDIRECTORYoption to set properties on tests in other directories.The
set_tests_properties()command gained aDIRECTORYoption to set properties on tests in other directories.The
get_property()commandTESTmode gained aDIRECTORYoption to get properties on tests in other directories.The
get_test_property()command gained aDIRECTORYoption to get properties on tests in other directories.
Variables¶
The
CMAKE_CROSSCOMPILING_EMULATORenvironment variable was added to initialize theCMAKE_CROSSCOMPILING_EMULATORcache variable.The
CMAKE_HIP_PLATFORMvariable was added to specify the GPU platform for which HIP language sources are to be compiled (amdornvidia).
Properties¶
On imported shared libraries, the
IMPORTED_IMPLIBtarget property may now be used withoutIMPORTED_LOCATION. This can be used to represent a stub library whose location should not be added as a runtime search path to dependents that link it.The
IMPORTED_LOCATIONproperty of a macOS framework may now be a path to the.frameworkfolder itself.The
XCODE_EMBED_RESOURCEStarget property was added to tell theXcodegenerator what targets to put in theEmbed Resourcesbuild phase.
Modules¶
The
ExternalProjectmodule now includes theBUILD_JOB_SERVER_AWAREoption for theExternalProject_Add()command. This option enables the integration of the GNU Make job server when using an explicitBUILD_COMMANDwith certain Makefile Generators. Additionally, theExternalProject_Add_Step()command has been updated to support the newJOB_SERVER_AWAREoption.The
FetchContentmodule'sFetchContent_Declare()command gained anEXCLUDE_FROM_ALLoption, which propagates through to theadd_subdirectory()call made byFetchContent_MakeAvailable()for the dependency.The
FindCURLmodule gained aCURL_USE_STATIC_LIBShint to select static libraries.The
FindEXPATmodule gained anEXPAT_USE_STATIC_LIBShint to select static libraries.The
FindPkgConfigmodulepkg_get_variable()command gained aDEFINE_VARIABLESoption to pass variables topkg-config.
Generator Expressions¶
The
generator expressions$<IF:...>,$<AND:...>, and$<OR:...>short-circuit to avoid unnecessary evaluation of parameters.
CTest¶
CTest may now take a dynamically-generated resource spec file, which can be specified by the
GENERATED_RESOURCE_SPEC_FILEtest property.
Deprecated and Removed Features¶
The
exec_program()command, which has been deprecated since CMake 3.0, has been removed by policyCMP0153. Use theexecute_process()command instead.The
Visual Studio 11 2012generator has been removed.The
Visual Studio 12 2013generator is now deprecated and will be removed in a future version of CMake.The
IOS_INSTALL_COMBINEDtarget property and correspondingCMAKE_IOS_INSTALL_COMBINEDvariable have been deprecated. Their functionality does not make sense on Apple Silicon hosts.The
Xcodegenerator will now issue a fatal error if the Legacy Build System has been selected for Xcode 14 and newer. Those Xcode versions dropped support for the Legacy Build System and expect the project to be set-up for their current Build System.
Other Changes¶
Generated files, in targets using File Sets, are now considered private by default. Generated public headers must be specified using file sets. This allows Ninja Generators to produce more efficient build graphs. See policy
CMP0154.The
find_library(),find_path(), andfind_file()commands no longer search in installation prefixes derived from thePATHenvironment variable. This behavior was added in CMake 3.3 to support MSYS and MinGW (MSYSTEM) development environments on Windows, but it can search undesired prefixes that happen to be in thePATHfor unrelated reasons. Users who keep some<prefix>/bindirectories in thePATHjust for their tools do not necessarily want any corresponding<prefix>/libor<prefix>/includedirectories searched. The behavior was reverted for non-Windows platforms by CMake 3.6. Now it has been reverted on Windows platforms too.One may set the
CMAKE_PREFIX_PATHenvironment variable with a semicolon-separated list of prefixes that are to be searched.When using MinGW tools in a
MSYSTEMenvironment on Windows, the$MSYSTEM_PREFIX/localand$MSYSTEM_PREFIXprefixes are now added toCMAKE_SYSTEM_PREFIX_PATH.The precompiled Linux
x86_64binaries provided on cmake.org now require GLIBC 2.17 or higher.
Updates¶
Changes made since CMake 3.28.0 include the following.
3.28.1, 3.28.2, 3.28.3¶
These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions.