# CMake 4.4 Release Notes

Changes made since CMake 4.3 include the following.

## New Features

### Diagnostics

- CMake diagnostic actions are now tracked in a new state type managed by the `cmake_diagnostic()` command. This replaces the old system which sometimes used variables to manage reporting actions and sometimes did not allow management beyond command-line options and presets. The new system also introduces several new diagnostic categories and significantly reduces the cost of adding additional categories in the future. See the `cmake-diagnostics(7)` manual for a list of available categories.

- The `CMD_INSTALL_ABSOLUTE_DESTINATION` diagnostic category was added to diagnose `install()` commands that specify an absolute `DESTINATION`. This diagnostic may be controlled with the `-Winstall-absolute-destination` command-line option, the `installAbsoluteDestination` field in a `CMake Presets` `warnings` object, or the `cmake_diagnostic()` command.

### Presets

- `cmake-presets(7)` files now support schema version 12.

- `cmake(1)`, `ctest(1)`, and `cpack(1)` gained `--presets-file` arguments to support loading `presets` from the specified file instead of `CMakePresets.json` and/or `CMakeUserPresets.json`. See `cmake --presets-file`, `cmake --build --presets-file`, `cmake --workflow --presets-file`, `ctest --presets-file`, and `cpack --presets-file` for details.

- `cmake-presets(7)`, in schema version 12 and above, now expand the ${fileDir} macro to the directory of the presets file containing the `${fileDir}` macro, regardless of whether it is inherited by another preset in a different directory.

- `cmake-presets(7)` gained support for a `testPassthroughArguments` field in the test preset `execution` object for forwarding arguments to test executables via presets.

### File-Based API

- The `cmake-file-api(7)` "codemodel" version 2 object has been updated to 2.11.

- The `cmake-file-api(7)` "codemodel" version 2 "target" object's "sources" and "interfaceSources" objects gained new `fileSetIndexes` fields to support sources belonging to multiple file sets. The `fileSetIndex` fields are maintained for backwards compatibility only, and users are advised to port to the new fields.

- The `cmake-file-api(7)` "codemodel" version 2 "target" object's "sources" object gained a new `backtraces` field to represent multiple command invocations which associate a single source for a given target with multiple file sets. The `backtrace` field is maintained for backwards compatibility only, and users are advised to port to the new field.

- The `cmake-file-api(7)` "codemodel" version 2 "installers" object's optional `fileSetType` field gained a new `SOURCES` value to incorporate the new `SOURCES` file set type in codemodel replies.

### Instrumentation

- The `cmake-instrumentation(7)` data version has been updated to 1.1.

- `cmake-instrumentation(7)` gained a `captureOutput` option which collects the `stdout` and `stderr` of instrumented commands.

- `cmake-instrumentation(7)` gained a `compileTrace` option which records compiler-generated trace files (e.g., from Clang's `-ftime-trace` flag).

### Generators

- The Ninja Generators now support generating a build target named `test_prep/<test-name>` for each test added by `add_test()`, which builds all dependencies for that test. Build dependencies are registered for an executable target invoked by the test, targets referenced in generator expressions in the test command, and explicit dependencies added using the new `BUILD_DEPENDS` option. This behavior is enabled by the new `CMAKE_TEST_BUILD_DEPENDS` variable. A `test_prep/all` target is also generated to depend on every `test_prep/<test-name>` target. Tests with names that are not valid target names are excluded from this behavior. If multiple tests in different directories share the same name, their dependencies are merged into one `test_prep/<test-name>` target.

### Languages

- CUDA language level 23 (corresponding to C++ 23) is now supported with NVCC 13.3 and above.

### Compilers

- C++ 20 named modules are now supported with `clang-cl`, except with the Visual Studio Generators (i.e., the `ClangCl` `toolset`). See `cmake-cxxmodules(7)`.

- The `ibm-flang` compiler is now supported with `compiler id` `IBMFlang`.

- The Pelles C toolchain is now supported with `compiler id` `PellesC`.

  The `ASM_POASM` language was added to support the Pelles Macro Assembler.

- The Open Watcom `wlink` linker is now identified with `CMAKE_<LANG>_COMPILER_LINKER_ID` `OpenWatcom`.

- The wild linker is now supported with `CMAKE_<LANG>_COMPILER_LINKER_ID` `WILD`.

### Command-Line

- `cmake(1)` now supports `--build <dir> --preset <pre>` regardless of the current working directory.

- The `cmake -D` command-line option now populates a default `HELPSTRING` for variables known to CMake.

- `cmake --install` now supports installing multiple components.

- `cmake --install` now accepts `-j<N>` in addition to `-j <N>` for specifying the number of parallel jobs.

- The `cmake -E` commands `copy_if_different`, `copy_if_newer`, `copy_directory`, `copy_directory_if_different`, and `copy_directory_if_newer` gained support for the `-t` argument.

- The `cmake -E tar` command-line tool gained the `--cmake-tar-encoding` flag to specify the pathname encoding used in archives.

### Commands

- The `block()` command can now create a `DIAGNOSTICS` scope.

- The `cmake_diagnostic()` command was added to manipulate CMake's diagnostic state.

- The `cmake_parse_arguments()` command gained a new `PARSE_ARGN` signature that starts parsing after the last named argument of the calling function and works exactly like `PARSE_ARGV` with `<N>` being the number of parameters in the function definition.

- The `discover_tests()` command was added to support registering tests discovered at test time by `ctest(1)`. It runs a user-provided discovery command, parses its output, and generates test names, arguments, and properties from regular-expression captures.

- The `execute_process()` command gained `ENVIRONMENT` and `ENVIRONMENT_MODIFICATION` options to run child processes with a modified environment.

- The `file(ARCHIVE_CREATE)` and `file(ARCHIVE_EXTRACT)` commands gained an `ENCODING` option to specify the encoding of the archive pathnames. The default is now `UTF-8`. See policy `CMP0213`.

- The `file(READ_SYMLINK)` command gained a `RESULT` option to capture errors without failing.

- The `if()` command gained a new `DIAGNOSTIC` operator that evaluates to true if a given diagnostic category name is known to CMake.

- The `include()` command now has a `NO_DIAGNOSTIC_SCOPE` option.

- The `list(FILTER)` command gained a new `PREDICATE` mode that invokes a user-defined `function()` to decide which elements are included or excluded, complementing the existing `REGEX` mode.

- The `list(SORT)` command gained a new `COMPARATOR` keyword that invokes a user-defined `function()` to compare elements, complementing the built-in `COMPARE` methods.

- The `list(TRANSFORM)` command gained a new `APPLY` action that invokes a user-defined `function()` for each element of the list, enabling arbitrary per-element transformations.

- The `list(TRANSFORM)` command gained a new `PREDICATE` selector that invokes a user-defined `function()` to decide which elements are transformed.

- The `string(JSON ... PARTIAL_EQUAL)` command was added to compare two JSON values using partial equality.

### File Sets

- A `SOURCES` file set type was added to specify a target's source files via file sets.

- The `CXX_SCAN_FOR_MODULES` file set property was added to control whether a file set's sources are scanned for C++ modules.

- The `INDEPENDENT_FILES` file set property was added to specify that a file set's sources do not depend on any generated files.

- The `JOB_POOL_COMPILE` file set property was added to assign a file set's sources to a specific Ninja job pool.

- The `SCOPE`, `TYPE`, `BASE_DIRS`, `SOURCES`, and `INTERFACE_SOURCES` file set properties were added to provide the declared details of a file set.

- The `SKIP_LINTING` file set property was added to exclude a file set's sources from target-wide code checks.

- The `SKIP_PRECOMPILE_HEADERS` file set property was added to avoid using precompiled headers for a file set's sources.

- The `SKIP_UNITY_BUILD_INCLUSION` file set property was added to exclude a file set's sources from inclusion in unity builds.

### Variables

- The `CMAKE_INSTALL_DEFAULT_COMPONENT_NAME` variable gained support for a special `<PROJECT_NAME>` placeholder value. It tells each `install()` invocation to take a default component name from the current `PROJECT_NAME` variable value.

### Environment Variables

- The `CMAKE_DISABLE_PRECOMPILE_HEADERS` environment variable was added to disable precompiled headers by default.

### Properties

- The `VERIFY_INTERFACE_HEADER_SETS` and `VERIFY_PRIVATE_HEADER_SETS` target properties now always create the per-target verification target and the aggregate `all_verify_interface_header_sets`, `all_verify_private_header_sets`, and `all_verify_header_sets` targets when the property is enabled, even if the target has no matching header sets.

- The `VERIFY_INTERFACE_HEADER_SETS` and `VERIFY_PRIVATE_HEADER_SETS` target properties now support `OBJC` and `OBJCXX` languages in addition to `C` and `CXX`.

- The `VS_SOLUTION_DEPLOY` target property is now implemented for targets created by `add_custom_target()`.

### Modules

- The `CMakePackageConfigHelpers` module's `write_basic_package_version_file()` command now supports `SamePatchVersion`, `SameFullVersion`, and `SemanticVersion` compatibility modes. The older `ExactVersion` mode is now documented as deprecated in favor of the more explicit `SamePatchVersion` and `SameFullVersion` modes. The `SemanticVersion` mode treats `0.y.z` versions more strictly than `1.y.z` and later versions.

- The `ExternalData` module gained an `ExternalData_LINK_MODE` variable to select an ordered list of file materialization modes for hard links, symbolic links, and copies.

- The `ExternalData` module gained an `ExternalData_STATE_ROOT` variable to store hash records outside `ExternalData_BINARY_ROOT`.

- The `ExternalProject` and `FetchContent` modules gained `CMAKE_EP_GIT_CLONE_RETRY_COUNT` and `CMAKE_EP_GIT_CLONE_RETRY_DELAY` variables to control `git clone` retries.

- The `FindCUDAToolkit` module now creates a `CUDA::sanitizer` target for the compute-sanitizer library.

- The `FindCUDAToolkit` module now provides an imported target for `cufilt` in CUDA 11.4 and above.

- `FindPython` and `FindPython3` modules gained the support of the Stable ABI for Free Threaded Python (`SABIT`) as specified by PEP 803.

### Generator Expressions

- The `TARGET_OBJECTS` generator expression now has an optional `SOURCE_FILES:...` argument, which can take one or more source files as arguments, and will filter its output to only include objects built from those source files.

### Swift

- The Ninja Generators gained the `Swift_SEPARATE_MODULE_EMISSION` target property, initialized by the `CMAKE_Swift_SEPARATE_MODULE_EMISSION` variable, to control whether importable Swift targets emit `.swiftmodule` from a dedicated build edge. Policy `CMP0215` enables this by default.

- The default `Swift_MODULE_NAME` now replaces hyphens with underscores, since hyphens are not valid in Swift module identifiers.

- Swift targets now have a package name by default. See policy `CMP0216`.

- The `Swift_PACKAGE_NAME` target property was added to specify a Swift package name.

- Swift targets on Windows now support the `$<TARGET_PDB_FILE:...>` family of generator expressions.

### CTest

- `ctest(1)` gained support for forwarding extra arguments to test executables using a `--` separator.

- `ctest(1)` gained a CoverageTool option in Dashboard Client mode to configure tests for coverage collection by `llvm-cov`.

- The `ctest_configure()`, `ctest_build()`, `ctest_test()`, and `ctest_memcheck()` commands gained `PRESET` and `PRESETS_FILE` arguments to support using `presets` for their Dashboard Client steps.

  The `CTEST_CONFIGURE_PRESET`, `CTEST_BUILD_PRESET`, `CTEST_TEST_PRESET`, `CTEST_PRESET`, and `CTEST_PRESETS_FILE` variables may be used to specify preset arguments to the above commands in a Dashboard Client script or on the ctest command line via the `-D` option.

- `ctest(1)` gained a `--source-dir` option to specify the source directory. When combined with `-T` Configure, this allows CTest to perform an initial configure step for an empty binary directory.

- `ctest(1)` gained support for a `CTEST_SUBMIT_PARTS` variable that restricts which parts are uploaded when operating in Dashboard Client mode.

- The `ctest_update()` command gained `VERSION_ONLY` and `VERSION_OVERRIDE` options to select or report a source revision without requiring the corresponding `CTEST_UPDATE_VERSION_ONLY` or `CTEST_UPDATE_VERSION_OVERRIDE` dashboard script variables.

### CPack

- The `CPack Archive Generator` gained the `CPACK_ARCHIVE_ENCODING` variable to specify the pathname encoding used in package archives.

- The `CPack NSIS Generator` gained a new variable `CPACK_NSIS_IGNORE_COMPONENTS_PAGE` to ignore the component selection page in the installer.

- The `CPACK_RPM_SPEC_MORE_DEFINE` variable now supports a list of definitions.

## Deprecated and Removed Features

- The `-W[no-][error=]dev` command-line options are deprecated. The new spelling is `-W[no-][error=]author`.

- The `--warn-uninitialized` command-line option is deprecated. The new spelling is `-Wuninitialized`.

- The `--no-warn-unused-cli` command-line option is deprecated. The new spelling is `-Wno-unused-cli`.

- The `CMAKE_WARN_DEPRECATED` and `CMAKE_ERROR_DEPRECATED` variables are deprecated. The new `cmake_diagnostic()` command should be used instead.

- The `MACROS` directory property does not exist anymore. See policy `CMP0217`.

## Other Changes

- A file may belong to at most one non-`HEADERS` file set in a target. See policy `CMP0211`.

- `macro()` invocations now preserve backslashes in arguments. See policy `CMP0219`.

- `variable_watch()` callback command arguments preserve backslashes. See policy `CMP0219`.

- `ctest(1)` now exits with non-zero if invoked with no arguments and no test input file exists.

- Test drivers generated by the `create_test_sourcelist()` command now support the `-N` option to list all tests, one per line. This is useful in combination with the new `discover_tests()` command.

- Names of executables given to the `DEPENDS` argument of `add_custom_command()` no longer have `.exe` suffixes stripped to establish target-level dependencies. See policy `CMP0212`.

- Targets which provide C++ modules may now be consumed by targets with different `compile features` and `options` than the provider.

## Updates

Changes made since CMake 4.4.0 include the following.

### 4.4.1

- The `FindPython`, `FindPython3` modules learned to manage, on `Windows` systems, the `pydebug` ABI flag.

### 4.4.2

- This version made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions.