I am proud to announce the second CMake 3.28 release candidate.
https://cmake.org/download/
Documentation is available at:
https://cmake.org/cmake/help/v3.28
Release notes appear below and are also published at
https://cmake.org/cmake/help/v3.28/release/3.28.html
Some of the more significant changes in CMake 3.28 are:
-
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. -
âHIPâ language code may now be compiled for NVIDIA GPUs using the
NVIDIA CUDA Compiler (NVCC). See the âCMAKE_HIP_PLATFORMâ variable. -
On Apple platforms, â.xcframeworkâ folders are now supported.
-
The âexec_program()â command, which has been deprecated since CMake
3.0, has been removed by policy âCMP0153â. Use the
âexecute_process()â command instead. -
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()â, and âfind_file()â commands no
longer search in installation prefixes derived from the âPATHâ
environment 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
the âPATHâ for unrelated reasons. Users who keep some
â/binâ directories in the âPATHâ just for their tools do not
necessarily want any corresponding â/libâ or
â/includeâ directories searched. The behavior was reverted
for non-Windows platforms by CMake 3.6. Now it has been reverted on
Windows platforms too.
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. -
âHIPâ language code may now be compiled for NVIDIA GPUs using the
NVIDIA CUDA Compiler (NVCC). See the âCMAKE_HIP_PLATFORMâ variable.
Platforms
-
On Apple platforms, â.xcframeworkâ folders are now supported:
-
The âfind_library()â command now finds â.xcframeworkâ folders.
-
The âtarget_link_libraries()â command now supports linking against
a â.xcframeworkâ folder. -
The âIMPORTED_LOCATIONâ target property of an imported library
target may now be the path to a â.xcframeworkâ folder.
-
-
Apple visionOS and its âxrosâ and âxrsimulatorâ SDKs are now
supported. Compiling for Apple visionOS can be requested by setting
âCMAKE_SYSTEM_NAMEâ to âvisionOSâ. See Cross Compiling for iOS,
tvOS, visionOS, or watchOS for more information.
Presets
- âcmake-presets(7)â files now support schema version â8â. It adds
support for a â$schemaâ field.
Compilers
-
Cray Clang-based compilers are now supported with âcompiler idâ
âCrayClangâ. -
The OrangeC compiler is now supported with âcompiler idâ âOrangeCâ.
Commands
-
The âadd_custom_command()â and âadd_custom_target()â commands gained
a âJOB_SERVER_AWAREâ option. -
The âcmake_host_system_information()â command gained a
âMSYSTEM_PREFIXâ query for the installation prefix of a MSYS or
MinGW development environment on Windows hosts. -
The âset_property()â command âTESTâ mode gained a âDIRECTORYâ option
to set properties on tests in other directories. -
The âset_tests_properties()â command gained a âDIRECTORYâ option to
set properties on tests in other directories. -
The âget_property()â command âTESTâ mode gained a âDIRECTORYâ option
to get properties on tests in other directories. -
The âget_test_property()â command gained a âDIRECTORYâ option to get
properties on tests in other directories.
Variables
-
The âCMAKE_CROSSCOMPILING_EMULATORâ environment variable was added
to initialize the âCMAKE_CROSSCOMPILING_EMULATORâ cache variable. -
The âCMAKE_HIP_PLATFORMâ variable was added to specify the GPU
platform for which HIP language sources are to be compiled (âamdâ or
ânvidiaâ).
Properties
-
On imported shared libraries, the âIMPORTED_IMPLIBâ target property
may now be used without âIMPORTED_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_LOCATIONâ property of a macOS framework may now be a
path to the â.frameworkâ folder itself. -
The âXCODE_EMBED_RESOURCESâ target property was added to tell the
âXcodeâ generator what targets to put in the âEmbed Resourcesâ build
phase.
Modules
-
The âExternalProjectâ module now includes the
âBUILD_JOB_SERVER_AWAREâ option for the âExternalProject_Add()â
command. This option enables the integration of the GNU Make job
server when using an explicit âBUILD_COMMANDâ with certain Makefile
Generators. Additionally, the âExternalProject_Add_Step()â command
has been updated to support the new âJOB_SERVER_AWAREâ option. -
The âExternalProjectâ module now declares âBYPRODUCTSâ for the
downloaded file for generated âdownloadâ steps. Previously, if
multiple external projects downloaded to the same file, hash
verification could fail. Now, when using the Ninja Generators, this
scenario is detected and Ninja will raise an error stating that
multiple rules generate the same file. -
The âFetchContentâ moduleâs âFetchContent_Declare()â command gained
an âEXCLUDE_FROM_ALLâ option, which propagates through to the
âadd_subdirectory()â call made by âFetchContent_MakeAvailable()â for
the dependency. -
The âFindCURLâ module gained a âCURL_USE_STATIC_LIBSâ hint to select
static libraries. -
The âFindEXPATâ module gained an âEXPAT_USE_STATIC_LIBSâ hint to
select static libraries. -
The âFindPkgConfigâ module âpkg_get_variable()â command gained a
âDEFINE_VARIABLESâ option to pass variables to âpkg-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_FILEâ test
property.
Deprecated and Removed Features
-
The âexec_program()â command, which has been deprecated since CMake
3.0, has been removed by policy âCMP0153â. Use the
âexecute_process()â command instead. -
The âVisual Studio 11 2012â generator has been removed.
-
The âVisual Studio 12 2013â generator is now deprecated and will be
removed in a future version of CMake. -
The âIOS_INSTALL_COMBINEDâ target property and corresponding
âCMAKE_IOS_INSTALL_COMBINEDâ variable have been deprecated. Their
functionality does not make sense on Apple Silicon hosts. -
The âXcodeâ generator 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()â, and âfind_file()â commands no
longer search in installation prefixes derived from the âPATHâ
environment 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
the âPATHâ for unrelated reasons. Users who keep some
â/binâ directories in the âPATHâ just for their tools do not
necessarily want any corresponding â/libâ or
â/includeâ directories 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_PATHâ environment variable with a
semicolon-separated list of prefixes that are to be searched. -
When using MinGW tools in a âMSYSTEMâ environment on Windows, the
â$MSYSTEM_PREFIX/localâ and â$MSYSTEM_PREFIXâ prefixes are now added
to âCMAKE_SYSTEM_PREFIX_PATHâ. -
The precompiled Linux âx86_64â binaries provided on cmake.org now
require GLIBC 2.17 or higher.
Changes made since CMake 3.28.0-rc1:
Ben Boeckel (6):
- Tests/NinjaPrivateDeps: fix error message for Build-PrivateFileSet-check
- cxxmodules: include
INCLUDES DESTINATION
directories - FlagTables:
-ifcOutput
takes a subsequent argument - FlagTables: Add entries for cl -scanDependencies flag
- VS: Explicitly disallow C++ modules provided by imported targets
- Tests/CXXModules: test Visual Studio synthetic target error
Brad King (5):
- curl: Update script to get curl 8.4.0
- curl: Set build options the way we need for CMake
- Utilities: Update hard-coded try_compile results for curl 8.4.0
- curl: Backport SOCKS5 heap buffer overflow fix from curl 8.4.0
- CMake 3.28.0-rc2
Curl Upstream (1):
- curl 2023-10-11 (d755a5f7)
Kyle Edwards (1):
- execute_process(): Restore opening files relative to WORKING_DIRECTORY
Orkun Tokdemir (2):
- Tests: Revert âNinjaMultiConfig: Update tests for the new dependency changeâ
- Autogen: Revert âAUTO*_EXECUTABLE: add support for per-config valuesâ
Zack Galbreath (1):
- ctest: Restore support for http redirects during Submit step
scivision (1):
- bootstrap: update known compilers
Ů ŮŘŻŮ Ř´ŮŮŮŮ (Mehdi Chinoune) (1):
- PGI/NVHPC: Remove -Mipa compiler option for 23.3+