# CMake 4.0.0-rc4 is ready for testing

**URL:** https://discourse.cmake.org/t/cmake-4-0-0-rc4-is-ready-for-testing/13725
**Category:** Announcements
**Created:** [March 11, 2025, 10:04pm UTC](https://discourse.cmake.org/t/cmake-4-0-0-rc4-is-ready-for-testing/13725 "2025-03-11T22:04:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![johnwparent](https://discourse.cmake.org/user_avatar/discourse.cmake.org/johnwparent/32/2179_2.png) [@johnwparent](https://discourse.cmake.org/u/johnwparent)
#### Post date: [March 11, 2025, 10:04pm UTC](https://discourse.cmake.org/t/cmake-4-0-0-rc4-is-ready-for-testing/13725/1 "2025-03-11T22:04:14Z")

</div>

I am proud to announce the fourth CMake 4.0 release candidate.  
[https://cmake.org/download/](https://cmake.org/download/)

Documentation is available at:  
[https://cmake.org/cmake/help/v4.0](https://cmake.org/cmake/help/v4.0)

Release notes appear below and are also published at  
[https://cmake.org/cmake/help/v4.0/release/4.0.html](https://cmake.org/cmake/help/v4.0/release/4.0.html)

Release milestone is available at:  
[release milestone](https://gitlab.kitware.com/cmake/cmake/-/milestones/160)

Some of the most significant changes in CMake 4.0 are:

- The “CMAKE\_POLICY\_VERSION\_MINIMUM” variable was added to help  
packagers and end users try to configure existing projects that have  
not been updated to work with supported CMake versions. The  
“CMAKE\_POLICY\_VERSION\_MINIMUM” environment variable was added to  
initialize it.

- The “$\<PATH\>” generator expression gained the “NATIVE\_PATH”  
operation to convert a CMake path into a native one.

- Compatibility with versions of CMake older than 3.5 has been  
removed. Calls to “cmake\_minimum\_required()” or “cmake\_policy()”  
that set the policy version to an older value now issue an error.  
Note that calls to those commands can still support older versions  
of CMake by using their “VERSION” arguments’ “\<min\>…\<max\>” syntax.  
This requires only the “\<min\>” version of CMake, but when running a  
newer version, sets policies up to the “\<max\>” version.

- 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.

- 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.

- Precompiled SunOS sparc64 and x86\_64 binaries are now provided on  
[cmake.org](http://cmake.org).  
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

- The “cmake --link-no-warning-as-error” option was added to suppress  
the effects of the “LINK\_WARNING\_AS\_ERROR” target property and  
“CMAKE\_LINK\_WARNING\_AS\_ERROR” variable.

- The “cmake --project-file” option was added to specify an alternate  
filename for “CMakeLists.txt” files. This is intended for temporary  
use by developers during an incremental transition and not for  
publication of a final product. CMake will always emit a warning  
when the project file is anything other than “CMakeLists.txt”.

## Commands

- The “target\_link\_libraries()” command now supports the “LINKER:”  
prefix.

## Variables

- The “AIX” and “CMAKE\_HOST\_AIX” variables are now set to true when  
the target or host system is AIX, respectively.

- Linker flag variables learned to support the “LINKER:” prefix:

- The “CMAKE\_EXECUTE\_PROCESS\_COMMAND\_ERROR\_IS\_FATAL” variable was  
added to specify the “execute\_process()” command’s default  
“COMMAND\_ERROR\_IS\_FATAL” behavior.

- The “CMAKE\_\<LANG\>_LINK\_MODE" and "CMAKE_\<LANG\>\_DEVICE\_LINK\_MODE”  
variables were added to provide information on how the link step is  
done.

- The “CMAKE\_LINK\_WARNING\_AS\_ERROR” variable and corresponding  
“LINK\_WARNING\_AS\_ERROR” target property were added to link using a  
linker-specific flag to treat warnings as errors.

- The “CMAKE\_MSVC\_RUNTIME\_CHECKS” variable and “MSVC\_RUNTIME\_CHECKS”  
target property were introduced to select runtime checks for  
compilers targeting the MSVC ABI. See policy “CMP0184”.

- The “CMAKE\_POLICY\_VERSION\_MINIMUM” variable was added to help  
packagers and end users try to configure existing projects that have  
not been updated to work with supported CMake versions. The  
“CMAKE\_POLICY\_VERSION\_MINIMUM” environment variable was added to  
initialize it.

- The “CMAKE\_XCODE\_SCHEME\_LLDB\_INIT\_FILE” variable and corresponding  
“XCODE\_SCHEME\_LLDB\_INIT\_FILE” target property were added to tell the  
“Xcode” generator what to put in the scheme’s “LLDB Init File”  
setting.

- The “CMAKE\_XCODE\_SCHEME\_TEST\_CONFIGURATION” variable and  
corresponding “XCODE\_SCHEME\_TEST\_CONFIGURATION” target property were  
added to tell the “Xcode” generator what to put in the scheme’s  
“Build Configuration” setting for the test action.

## Properties

- The “DEBUGGER\_WORKING\_DIRECTORY” target property and corresponding  
“CMAKE\_DEBUGGER\_WORKING\_DIRECTORY” variable were added to tell  
generators what debugger working directory should be set for  
targets.

- The “STATIC\_LIBRARY\_OPTIONS” target property now supports an  
“ARCHIVER:” prefix to pass options to the archiver through the  
compiler driver in a portable way.

- The “Swift\_MODULE\_DIRECTORY” target property now supports “generator  
expressions”.

- The “VS\_CUSTOM\_COMMAND\_DISABLE\_PARALLEL\_BUILD” source file property  
was added to tell Visual Studio Generators not to run a custom  
command in parallel.

- The “VS\_SOLUTION\_ITEMS” directory property was added to tell Visual  
Studio Generators to attach files directly to the Solution (“.sln”).

## Modules

- The “ExternalData” module gained a “ExternalData\_HTTPHEADERS”  
variable to specify HTTP headers.

- The “ExternalProject” module’s “ExternalProject\_Add()” command  
gained an “INSTALL\_JOB\_SERVER\_AWARE” option to enable integration of  
the GNU Make job server when using an explicit “INSTALL\_COMMAND”  
with Makefile Generators.

- The “FeatureSummary” module “add\_feature\_info()” command now  
supports full Condition Syntax. See policy “CMP0183”.

- The “FindBISON” module “bison\_target()” command gained an “OPTIONS”  
option to specify Bison command-line options.

- The “FindCURL” module now provides a “CURL\_VERSION” result variable  
to match upstream cURL’s CMake package.

- The “FindFLEX” module “flex\_target()” command gained an “OPTIONS”  
option to specify Flex command-line options.

- The “FindPatch” module now supports running in cmake -P script mode  
by skipping the creation of the imported target.

- The “FindProtobuf” module “protobuf\_generate()” command gained a  
“PROTOC\_EXE” option to specify a custom “protoc” executable.

- The “FindPython”, “FindPython2”, and “FindPython3” modules gained  
the possibility to do multiple calls in the same directory by using,  
respectively, the variables “Python\_ARTIFACTS\_PREFIX”,  
“Python2\_ARTIFACTS\_PREFIX”, and “Python3\_ARTIFACTS\_PREFIX”.

- The “FindRuby” module learned to find rbenv-provided installations.

## 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

- The “CPack Archive Generator” learned to generated “.tar” packages  
without compression.

- The “CPack Archive Generator” now honors the  
“CPACK\_ARCHIVE\_FILE\_NAME” variable for all packages. Previously,  
this variable worked only for component-based packages.

# Deprecated and Removed Features

- Compatibility with versions of CMake older than 3.5 has been  
removed. Calls to “cmake\_minimum\_required()” or “cmake\_policy()”  
that set the policy version to an older value now issue an error.  
Note that calls to those commands can still support older versions  
of CMake by using their “VERSION” arguments’ “\<min\>…\<max\>” syntax.  
This requires only the “\<min\>” version of CMake, but when running a  
newer version, sets policies up to the “\<max\>” version.

- The “Visual Studio 14 2015” and “Visual Studio 15 2017” generators  
no longer support specifying a platform as part of the generator  
name. See Visual Studio Platform Selection.

- The “CMAKE\_\<LANG\>_USING\_LINKER\_MODE" variable is no longer used to  
determine the type of the contents of the  
"CMAKE_\<LANG\>_USING\_LINKER_\<TYPE\>” variable. The  
“CMAKE\_\<LANG\>\_LINK\_MODE” variable, set by CMake, is used instead.

- The “FindGDAL” module is now deprecated in favor of upstream GDAL’s  
official CMake package configuration file. Port projects to the  
latter by calling “find\_package(GDAL CONFIG)”. For further details,  
see GDAL’s documentation on CMake integration.

- The “FindRuby” module no longer provides variables with the upper-  
case “RUBY\_” prefix. See policy “CMP0185”.

- CTest’s undocumented declarative scripting mode has been removed.  
This mode used to be triggered by a “ctest -S” script which did not  
call any CTest Commands unless “CTEST\_RUN\_CURRENT\_SCRIPT” was  
explicitly set to “OFF”.

- The “ctest\_run\_script()” command may no longer be called without any  
arguments.

# 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 sparc64 and x86\_64 binaries are now provided on  
[cmake.org](http://cmake.org).

* * *

Changes made since CMake 4.0.0-rc3:

Brad King (9):

- cmCTest: De-duplicate working directory code
- PathResolver: Document in comments the on-disk case lookup on macOS
- PathResolver: Add mode to collapse paths naively and look up on-disk case
- cmSystemTools: Fix regression in input path normalization on Windows
- cmCurl: Avoid using undocumented type for CURLOPT\_NETRC values
- cmSystemTools: Restore GetRealPathResolvingWindowsSubst
- cmSystemTools: Fix GetRealPath implementation on Windows
- ci: Explicitly enable or disable RunCMake.AppleSilicon test in macos jobs
- CMake 4.0.0-rc4

Daniel Pfeifer (2):

- cmCTestStartCommand: Remove unnecessary code
- ctest: Restore support for -T Test without dashboard configuration

Juan Ramos (1):

- cmake-gui: Fix regression that prints an incidental error on fresh build trees

Marc Chevrier (1):

- LinkerId: Suppress decorated diagnostics during linker inspection

Matthew Woehlke (2):

- find\_package: CPS component requirements != CMake components
- Help: Document handling of CPS transitive components
