CMake 3.25.0-rc4 is ready for testing

I am proud to announce the fourth CMake 3.25 release candidate.
https://cmake.org/download/

Documentation is available at:
https://cmake.org/cmake/help/v3.25

Release notes appear below and are also published at
https://cmake.org/cmake/help/v3.25/release/3.25.html

Some of the more significant changes in CMake 3.25 are:

  • The “find_file()”, “find_path()”, “find_library()”, and
    “find_program()” commands gained a “VALIDATOR” option to specify a
    function to be called for each candidate item to validate it.

  • The “try_compile()” and “try_run()” commands gained new signatures
    that more consistently use keyword dispatch and do not require a
    binary directory to be specified. Additionally, these signatures
    use a unique directory for each invocation, which allows multiple
    outputs to be preserved when using “cmake --debug-trycompile”.

  • The “add_subdirectory()” command gained a “SYSTEM” option to enable
    the “SYSTEM” directory property in the subdirectory.

  • The “block()” and “endblock()” commands were added to manage
    specific scopes (policy or variable) for a contained block of
    commands.

  • The “return()” command gained a “PROPAGATE” option to propagate
    variables to the scope to which control returns. See policy
    “CMP0140”.

  • The “BSD” and “CMAKE_HOST_BSD” variables are now set to a string
    value when the target or host system is BSD, respectively.

  • The “LINUX” and “CMAKE_HOST_LINUX” variables are now set to true
    when the target or host system is Linux, respectively.

  • The “CMAKE_MSVC_DEBUG_INFORMATION_FORMAT” variable and
    “MSVC_DEBUG_INFORMATION_FORMAT” target property were introduced to
    select the debug information format for compilers targeting the MSVC
    ABI. See policy “CMP0141”.

CMake 3.25 Release Notes


Changes made since CMake 3.24 include the following.

New Features

Presets

  • The “cmake-presets(7)” schema version has been bumped to “6”.

  • The “cmake-presets(7)” format now supports a “packagePresets” field
    to specify presets for “cpack --preset”.

  • The “cmake-presets(7)” format now supports a “workflowPresets” field
    to specify presets for “cmake --workflow”.

  • The “cmake-presets(7)” format now supports an “outputJUnitFile” field
    to specify JUnit output in test presets

Languages

  • The “Compile Features” functionality is now aware of C++26, and
    defines a “cxx_std_26” meta-feature. C++26 compiler modes may also
    be specified via the “CXX_STANDARD”, “CUDA_STANDARD”,
    “HIP_STANDARD”, or “OBJCXX_STANDARD” target properties.

  • “CUDA” language support now includes device link-time optimization
    when using “nvcc”. The “CMAKE_INTERPROCEDURAL_OPTIMIZATION”
    variable and the associated “INTERPROCEDURAL_OPTIMIZATION” target
    property will activate device LTO.

Command-Line

  • A “cmake --workflow --preset” mode was added to drive sequences of
    configure, build, test, and package operations through a single
    command.

  • The “cmake -E capabilities” command gained a new “tls” field that
    tells whether or not TLS is enabled.

  • The “cmake -E env” command-line tool gained a “–modify” flag to
    support “ENVIRONMENT_MODIFICATION” operations.

  • The “cmake --debug-trycompile” option now prints log messages
    reporting the directory in which each try-compile check is done.

Compilers

  • Support for the Tasking compiler toolsets (SmartCode, TriCore,
    Standalone: ARM, MCS, 8051) was added with compiler id “Tasking”.
    See the “CMAKE_TASKING_TOOLSET” variable.

Commands

  • The “add_subdirectory()” command gained a “SYSTEM” option to enable
    the “SYSTEM” directory property in the subdirectory.

  • The “block()” and “endblock()” commands were added to manage
    specific scopes (policy or variable) for a contained block of
    commands.

  • The “cmake_language()” command gained a new “GET_MESSAGE_LOG_LEVEL”
    sub-command. It can be used to query the current message logging
    level.

  • The “find_file()”, “find_path()”, “find_library()”, and
    “find_program()” commands gained a “VALIDATOR” option to specify a
    function to be called for each candidate item to validate it.

  • The “find_package()” command now considers paths of the form
    “//(cmake|CMake)//” when searching for package
    configuration files.

  • The “return()” command gained a “PROPAGATE” option to propagate
    variables to the scope to which control returns. See policy
    “CMP0140”.

  • The “try_compile()” and “try_run()” commands gained new signatures
    that more consistently use keyword dispatch and do not require a
    binary directory to be specified. Additionally, these signatures
    use a unique directory for each invocation, which allows multiple
    outputs to be preserved when using “cmake --debug-trycompile”.

  • The “try_compile()” and “try_run()” commands gained the option
    “NO_CACHE” to store results in normal variables.

  • The “try_run()” command gained “RUN_OUTPUT_STDOUT_VARIABLE” and
    “RUN_OUTPUT_STDERR_VARIABLE” options to capture stdout and stderr
    separately from the output of the compiled program.

Variables

  • The “BSD” and “CMAKE_HOST_BSD” variables are now set to a string
    value when the target or host system is BSD, respectively.

  • The “LINUX” and “CMAKE_HOST_LINUX” variables are now set to true
    when the target or host system is Linux, respectively.

  • The “CMAKE_MSVC_DEBUG_INFORMATION_FORMAT” variable and
    “MSVC_DEBUG_INFORMATION_FORMAT” target property were introduced to
    select the debug information format for compilers targeting the MSVC
    ABI. See policy “CMP0141”.

  • The “CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION” variable and
    corresponding “XCODE_SCHEME_ENABLE_GPU_API_VALIDATION” target
    property were added to tell the “Xcode” generator what to put in the
    scheme’s “Metal: API Validation” setting.

  • The “CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION” variable and
    corresponding “XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION” target
    property were added to tell the “Xcode” generator what to put in the
    scheme’s “Metal: Shader Validation” setting.

  • The “CMAKE_XCODE_SCHEME_LAUNCH_MODE” variable and corresponding
    “XCODE_SCHEME_LAUNCH_MODE” target property were added to tell the
    “Xcode” generator what to put in the scheme’s “Launch” mode setting.

  • The “CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION” variable and
    corresponding “XCODE_SCHEME_LAUNCH_CONFIGURATION” target property
    were added to tell the “Xcode” generator what configuration to put
    in the scheme’s Launch action.

Properties

  • The “_COMPILER_LAUNCHER” target property now supports
    “generator expressions”.

  • The “EXPORT_NO_SYSTEM” target property was added to specify that
    “install(EXPORT)” and “export()” commands will generate an imported
    target with “SYSTEM” property “OFF”.

  • The “SYSTEM” target property was added to specify whether a target
    should be treated as a system library (i.e. its include directories
    are automatically “SYSTEM” when compiling consumers). If not set,
    the default is the previous behavior: on for imported targets and
    off for other targets.

  • The “SYSTEM” directory property was added to initialize the “SYSTEM”
    target property for targets created in that directory.

Modules

  • The “FetchContent” module “FetchContent_Declare()” command gained a
    “SYSTEM” option to enable the “SYSTEM” directory property in the
    subdirectory.

  • The “FindCUDAToolkit” module now provides a target for nvtx3 for
    CUDA 10.0+, which supersedes nvToolsExt. A deprecation warning is
    emitted when using “nvToolsExt” if the project requires CMake 3.25
    and CUDA 10.0+ is used.

  • The “FindDoxygen” module’s version handling has been improved:

    • Multiple candidate installations will now be considered, if
      needed, to satisfy version constraints. Previously, only the
      first one encountered would be considered.

    • Version ranges are supported.

    • Variations in the version format reported by Doxygen are now
      tolerated (e.g. a trailing git commit hash).

  • The “FindOpenAL” module now provides an imported target.

  • The “FindOpenSP” module was added to find the OpenSP library.

  • The “FindVulkan” module gained support for new components:

    “dxc”
    DirectX Shader Compiler.

    “volk”
    Volk open-source vulkan meta-loader.

CPack

  • The “CPack Archive Generator” gained a new
    “CPACK_ARCHIVE_FILE_EXTENSION” variable to control the package file
    name extension.

  • The “CPack NSIS Generator” gained two new variables
    “CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS” and
    “CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS” to provide arguments to the
    nsis executable invocation.

  • The “CPack” module gained the “CPACK_READELF_EXECUTABLE”,
    “CPACK_OBJCOPY_EXECUTABLE”, and “CPACK_OBJDUMP_EXECUTABLE” variables
    to control the locations of binutils used by “cpack(1)”.

Deprecated and Removed Features

  • The “IMPORTED_NO_SYSTEM” target property has been deprecated in
    favor of “SYSTEM” and “EXPORT_NO_SYSTEM”.

  • The “Visual Studio 10 2010” generator has been removed.

  • The “Visual Studio 11 2012” generator is now deprecated and will be
    removed in a future version of CMake.

Other Changes

  • On Windows, when targeting the MSVC ABI, the “find_library()”
    command now accepts “.a” file names after first considering “.lib”.
    This is symmetric with existing behavior when targeting the GNU ABI,
    in which the command accepts “.lib” file names after first
    considering “.a”.

  • The “SSL_CERT_FILE” and “SSL_CERT_DIR” environment variables can now
    be used to override where to find certificate authorities for
    TLS/SSL operations.

  • If “_CLANG_TIDY” includes a “-p” argument, the full compiler
    command line is no longer appended after “–”.

  • The “Xcode” generator no longer adds the per-config suffix
    “$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)” to library search
    paths. See policy “CMP0142”.


Changes made since CMake 3.25.0-rc3:

Alex Turbov (2):

  • Help: Fix broken external links found by sphinx linkcheck
  • Help: Fix some redirects reported with sphinx linkcheck

Brad King (9):

  • ci: Update debian10-ninja job to use Swift 5.7.1
  • Xcode: Restore Swift framework search directories
  • Xcode: Implement Swift include directories
  • VS: Restore support for two-part default toolset version
  • gitlab-ci: update macOS jobs to use Xcode 14.1
  • Help: Clarify compilers affected by MSVC ABI abstractions
  • block: Fix variable scope protection from modification by subdirectories
  • cmState: Clarify name of member tracking the active scope in a directory
  • CMake 3.25.0-rc4

Christoph Seitz (2):

  • Tasking: Remove CMAKE_SYSTEM_PROCESSOR support per CMP0123
  • Tasking: Update CMAKE_TASKING_TOOLSET documentation

Craig Scott (2):

  • Help: Make VALIDATOR wording clearer and more precise
  • Help: clean up and clarify block() and return()

Daniel Schürmann (1):

  • IAR: Restore support for CMAKE_CXX_FLAGS_INIT

Gordon Jess (1):

  • Tasking: Fix PIC option for Tasking Toolset

Robert Maynard (1):

  • FindCUDAToolkit: Restore usage from multiple directories

klytje (1):

  • FindOpenSSL: Search “lib64” for mingw 64-bit installs

I am seeing on a Windows 11 computer a possible regression for TLS_VERIFY true due to CMake 3.25.0-rc3 update to cURL 7.86. This doesn’t happen on a Windows 10 computer or MacOS. I didn’t immediately have a second Windows 11 computer to try, so this could be a PC-specific issue, however it is quite repeatable.

Note: from the Windows 11 PC, using Curl 7.86.0 download or MSYS2, work fine like:

curl -L https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3-SHA-256.txt
set(CMAKE_TLS_VERIFY true)

file(DOWNLOAD https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3-SHA-256.txt STATUS ret LOG log)

message(STATUS "ret: ${ret}
${log}")

Note: If I set(CMAKE_TLS_VERIFY false) then CMake 3.25.0-rc3,4 work as well on the Windows 11 PC.
However, with TLS_VERIFY false on the rc3,rc4 despite it then succeeding I get distinct log text like:

Host: objects.githubusercontent.com
user-agent: curl/7.86.0
accept: */*

schannel: remote party requests renegotiation
schannel: renegotiating SSL/TLS connection
schannel: SSL/TLS connection renegotiated
schannel: failed to decrypt data, need more data
HTTP/2 200

Note: the CMake 3.25.0-rc3,4 fail over 95% of the time for this test. If I run it repeatedly, it occasionally succeeds but I think less than 5% success rate.

Logs at Gist

Thanks. I can reproduce that, and I’ve opened CMake Issue 24147 for it.

OK great; I was worried it was just my computer again, glad it wasn’t just me and found at the release candidate stage!