CMake 4.1 Release Notes

Changes made since CMake 4.0 include the following.

New Features

File-Based API

Generators

Command-Line

  • The cmake --build command-line tool, when used with the Xcode generator, now detects when a third-party tool has wrapped the generated .xcodeproj in a .xcworkspace, and drives the build through the workspace instead.

Configure Log

Compilers

Commands

  • The add_dependencies() command may be called with no dependencies.

  • The cmake_pkg_config() command now supports the IMPORT and POPULATE subcommands for interfacing CMake targets with pkg-config based dependencies.

  • The project() command now has experimental support for the COMPAT_VERSION keyword, gated by CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO.

Variables

Environment Variables

Properties

Modules

Regular Expressions

CTest

CPack

Deprecated and Removed Features

Other Changes

  • The ExternalProject module no longer checks the URL archive file extension. Any archive type that cmake -E tar can extract is now allowed.

  • Modules FindPython3, FindPython2 and FindPython now enforce consistency of artifacts in cross-compiling mode. This prevents mixing host and target artifacts. See policy CMP0190.

  • The GNUInstallDirs module now prefers to default SYSCONFDIR, LOCALSTATEDIR, and RUNSTATEDIR to absolute paths when installing to special prefixes. See policy CMP0192.

  • The GNUInstallDirs module now caches CMAKE_INSTALL_* variables with their leading usr/ for install prefix /. See policy CMP0193.

  • The install(TARGETS) command no longer ignores file sets which haven't been defined at the point it is called. The ordering of target_sources(FILE_SET) and install(TARGETS) is no longer semantically relevant.

  • Enabling ASM no longer accidentally succeeds using MSVC's cl C compiler as an assembler. See policy CMP0194.

  • The MSVC link -machine: flag is no longer added to the CMAKE_*_LINKER_FLAGS variables. See policy CMP0197.

  • The TARGET_PROPERTY generator expression now evaluates the LINK_LIBRARIES and INTERFACE_LINK_LIBRARIES target properties transitively. See policy CMP0189.

Updates

Changes made since CMake 4.1.0 include the following.

4.1.1

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

4.1.2

  • The file(GENERATE) command, when evaluating generator expressions, now uses the value of policy CMP0189 as of each call site. Previously, it used the value as of the end of the directory's CMakeLists.txt, as all other generator expression evaluations do.