CMake 4.0 Release Notes

Changes made since CMake 3.31 include the following.

New Features

File-Based API

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

  • The cmake-file-api(7) "codemodel" version 2 "target" object gained a new debugger field.

Command-Line

Commands

Variables

Properties

Modules

Generator Expressions

  • The $<PATH> generator expression gained the NATIVE_PATH operation to convert a CMake path into a native one.

CTest

  • The ctest --interactive-debug-mode option on Windows now enables Windows Error Reporting by default in test processes, allowing them to creating debug popup windows and core dumps. This restores behavior previously removed by CMake 3.11 after updates to libuv made it possible.

CPack

Deprecated and Removed Features

Other Changes

  • On macOS with Ninja Generators and Makefile Generators, when a compiler is found in /usr/bin, it is now used as-is and is no longer mapped to the corresponding compiler inside Xcode. The mapping was introduced by CMake 3.2 to allow build trees to continue to work with their original compiler even when xcode-select switches to a different Xcode installation. However, the compilers inside Xcode cannot be used without explicit -isysroot flags and are therefore not suitable for passing to arbitrary third-party build systems. Furthermore, the mapping behavior can override user-specified compiler paths. Therefore, this behavior has been reverted.

  • Builds targeting macOS no longer choose any SDK or pass an -isysroot flag to the compiler by default. Instead, compilers are expected to choose a default macOS SDK on their own. In order to use a compiler that does not do this, users must now specify -DCMAKE_OSX_SYSROOT=macosx when configuring their build.

  • On AIX, SHARED library targets now produce a shared library archive by default. See policy CMP0182.

  • The cmake --preset command no longer outputs a summary of the preset's CMake cache and environment variables by default. That summary is now only shown when the message log level is set to VERBOSE, DEBUG, or TRACE via the cmake --log-level option or the CMAKE_MESSAGE_LOG_LEVEL cache variable.

  • Precompiled SunOS sparc and i386 binaries are now provided on cmake.org.