CMake 4.3 Release Notes

Changes made since CMake 4.2 include the following.

New Features

Common Package Specification

  • Support for importing and exporting packages described using the Common Package Specification (CPS) was added. This improves build system interoperability by allowing expressive, feature-rich package descriptions to be exchanged in a format other than CMake Language.

    • The find_package() now searches for and can import CPS packages.

    • The install() and export() commands gained a new PACKAGE_INFO sub-command to generate CPS package descriptions.

    • The project() command gained new COMPAT_VERSION and SPDX_LICENSE options. These values may be inherited when creating a CPS package description. See the install(PACKAGE_INFO) documentation for details.

Instrumentation

  • cmake-instrumentation(7) was added to enable collection of timing data, target information, and system diagnostic information during the configure, generate, build, test, and install steps of a CMake project:

    • Instrumentation data are indexed and provided to callbacks for custom processing.

    • Instrumentation data are included in submissions to CDash.

    • Optionally, Google Trace Event Format files may be generated to visualize instrumentation data.

File-Based API

  • The cmake-file-api(7) "codemodel" version 2 version field has been updated to 2.10.

  • The cmake-file-api(7) "codemodel" version 2 "target" object gained a new interfaceSources array field, and the sourceGroups array items gained a new interfaceSourceIndexes array field.

Platforms

  • HIP language code may now be compiled for SPIR-V targets, e.g., via chipStar. See the CMAKE_HIP_PLATFORM variable.

Command-Line

  • cmake --version now supports a =json-v1 value to print detailed version information in a JSON format.

  • cmake --build now supports specifying a build directory and preset together. The build preset will be used with the explicit build directory substituted.

  • The cmake -E commands md5sum, sha1sum, sha224sum, sha256sum, sha384sum, and sha512sum now support reading from standard input by passing -.

  • The cmake -E bin2c command-line tool was added.

  • The cmake -E tar command-line tool:

    • Gained a --cmake-tar-compression-level flag to specify the compression level.

    • Gained a --cmake-tar-compression-method flag to specify the compression method.

    • Gained a --cmake-tar-threads flag to enable multithreaded operations.

    • Now supports specifying compression method and level for 7zip and zip formats.

    • Gained a --format=raw flag to disable compression.

    • Gained a --lzma flag to specify LZMA compression.

Commands

  • The cmake_instrumentation() command was added to make project-level instrumentation queries.

  • The file(ARCHIVE_CREATE) command:

    • Gained a THREADS option to enable multithreaded operations.

    • Now supports COMPRESSION method Deflate as an alias for GZip.

    • Now supports COMPRESSION method LZMA.

    • Now supports COMPRESSION method LZMA2 as an alias for XZ.

    • Now supports COMPRESSION method PPMd for format 7zip.

    • Now supports COMPRESSION and COMPRESSION_LEVEL options for formats 7zip and zip.

  • The get_property() and set_property() commands now support a FILE_SET scope for file set properties of a target.

  • The string(JSON) command gained new GET_RAW and STRING_ENCODE modes.

  • The source_group() command now supports generator expressions.

  • The cmake_host_system_information() command gained a LOCALE_CHARSET query for the expected cmake-language(7) script encoding.

Variables

Properties

Modules

  • The FindCUDAToolkit module now creates a CUDA::bin2c imported target for the bin2c utility.

  • The FindLibXml2 module gained a LibXml2_USE_STATIC_LIBS hint to select static libraries.

  • The FindRuby module now provides imported targets.

  • The FindSQLite3 module now provides imported targets with the SQLite3:: prefix.

  • The UseJava module's add_jar() command now accepts a new INCLUDE_MODULES option that adds its arguments to the --module-path argument to the Java compiler. This allows building JAR files that use JPMS modules in their build.

Generator Expressions

CTest

  • The CTestCoverageCollectGCOV module:

    • Now supports TARBALL_COMPRESSION method LZMA.

    • Now supports TARBALL_COMPRESSION method LZMA2 as an alias for XZ.

    • Now supports FROM_EXT with file extensions corresponding to LZMA and ZSTD compression.

CPack

Deprecated and Removed Features

Other Changes