CMake 3.30 Release Notes¶
Changes made since CMake 3.29 include the following.
New Features¶
Presets¶
cmake-presets(7)files now support schema version9.includefields now expand all macros except$env{}and preset-specific macros, i.e., those derived from the fields inside a preset's definition.
File-Based API¶
The
cmake-file-api(7)"cmakeFiles" version 1 object'sversionfield has been updated to 1.1. It gained aglobsDependentfield to reportfile(GLOB)calls usingCONFIGURE_DEPENDS.
Generators¶
Visual Studio Generators now add
UseDebugLibrariesindicators to.vcxprojfiles to denote which configurations are debug configurations. See policyCMP0162.
Languages¶
The
Compile Featuresfunctionality now implements support for thecxx_std_26andcuda_std_26meta-features to indicate that the compiler mode must be at least C++26. These meta-features were first documented by CMake 3.25, but were not fully implemented.
Commands¶
The
add_library()command, on platforms that do not support shared libraries, now rejects creation of shared libraries instead of automatically converting them to static libraries. See policyCMP0164.The
enable_language()command now fails with an error if it is called before the firstproject()call. See policyCMP0165.The
file(DOWNLOAD)andfile(UPLOAD)commands gained aTLS_VERSION <min>option to specify the minimum TLS version for connections tohttps://URLs.
Variables¶
The
CMAKE_<LANG>_STANDARD_LATESTvariable was added to describe the latest<LANG>language standard CMake supports for the selected compiler.The
CMAKE_TLS_VERIFYenvironment variable was added as a fallback to the existingCMAKE_TLS_VERIFYvariable. It specifies whether to verify the server certificate forhttps://URLs by default.The
CMAKE_TLS_VERSIONvariable andCMAKE_TLS_VERSIONenvironment variable were added to specify a default minimum TLS version for connections tohttps://URLs by thefile(DOWNLOAD)andfile(UPLOAD)commands.The
CMAKE_VS_USE_DEBUG_LIBRARIESvariable and correspondingVS_USE_DEBUG_LIBRARIEStarget property were added to explicitly controlUseDebugLibrariesindicators in.vcxprojfiles.
Properties¶
The
GENERATEDsource file property is now visible in all directories. See policyCMP0163. PolicyCMP0118's documentation has been revised to describe its actual effects.The
PROPAGATE_TOP_LEVEL_INCLUDES_TO_TRY_COMPILEglobal property can be used to propagateCMAKE_PROJECT_TOP_LEVEL_INCLUDESintotry_compile()calls that use the whole-project signature. This is primarily intended as a way for dependency providers to be enabled in suchtry_compile()calls.A
VS_FILTER_PROPStarget property was added to tell Visual Studio Generators to use a custom MSBuild filter.propsfile.
Modules¶
The
ExternalProjectmodule'sExternalProject_Add()command gained aTLS_VERSION <min>option, and support for theCMAKE_TLS_VERSIONvariable andCMAKE_TLS_VERSIONenvironment variable, to specify the minimum TLS version for connections tohttps://URLs.The
FindBacktracemodule now provides an imported target.The
FindBLASandFindLAPACKmodules gained support forlibblastrampoline.The
FindCUDAToolkitmodule now provides a target forlibnvfatbinandlibnvfatbin_static, if found.The
FindCUDAToolkitmodule now searches theCMAKE_CUDA_COMPILERvariable and theCUDACXXenvironment variable even when theCUDAlanguage isn't enabled.The
FindOpenMPmodule gained anOpenMP_RUNTIME_MSVCoption to control the OpenMP runtime used with MSVC.The
FindPythonandFindPython3modules gained support for the free threaded Python version.The
FindPython,FindPython2, andFindPython3modules, on Windows, now offer better support for the Python debug variant:new variables:
Python_EXECUTABLE_DEBUGPython_INTERPRETERPython_DEBUG_POSTFIX
new targets:
Python::InterpreterDebugPython::InterpreterMultiConfig
The
python_add_library()command now manages theDEBUG_POSTFIXtarget property based on the value of thePython_DEBUG_POSTFIXvariable.
Generator Expressions¶
The
<LANG>_COMPILER_FRONTEND_VARIANTfamily of generator expressions were added to access the value of the associatedCMAKE_<LANG>_COMPILER_FRONTEND_VARIANTvariables.Link features, as used with the
LINK_LIBRARYgenerator expression, gained the ability to have attributes that describe their behavior by specifying theCMAKE_LINK_LIBRARY_<FEATURE>_ATTRIBUTESorCMAKE_<LANG>_LINK_LIBRARY_<FEATURE>_ATTRIBUTESvariables.The
QUOTEgenerator expression was added to evaluate to".The
TARGET_PROPERTYgenerator expression learned to evaluate custom transitive properties defined by newTRANSITIVE_COMPILE_PROPERTIESandTRANSITIVE_LINK_PROPERTIEStarget properties.The
TARGET_PROPERTYgenerator expression now evaluates target propertiesINTERFACE_LINK_OPTIONS,INTERFACE_LINK_DIRECTORIES, andINTERFACE_LINK_DEPENDScorrectly by following private dependencies of static libraries. See policyCMP0166.
CTest¶
The
ctest_submit()command andctest -T Submitstep gainedTLSVersionandTLSVerifyoptions to control negotiation withhttps://URLs. See theCTEST_TLS_VERSIONandCTEST_TLS_VERIFYvariables.
CPack¶
The
CPack Inno Setup Generatoris now available on non-Windows hosts.The
CPack NuGet Generatorgained theCPACK_NUGET_PACKAGE_README,CPACK_NUGET_PACKAGE_REPOSITORY_URL,CPACK_NUGET_PACKAGE_REPOSITORY_TYPE,CPACK_NUGET_PACKAGE_REPOSITORY_BRANCH, andCPACK_NUGET_PACKAGE_REPOSITORY_COMMITvariables.The
CPack NuGet Generatorcan now generate dependency groups for framework-specific dependencies. TheCPACK_NUGET_PACKAGE_TFMSvariable was added to specify a list of target framework monikers (TFMs) for which groups should be generated.The
CPack WIX Generatorgained support for WiX Toolset v4. See theCPACK_WIX_VERSIONvariable.
Deprecated and Removed Features¶
The
FindBoostmodule has been removed by policyCMP0167. Port projects to upstream Boost'sBoostConfig.cmakepackage configuration file, for whichfind_package(Boost)now searches.Calling
FetchContent_Populate()with just the name of a dependency is now deprecated. Projects should callFetchContent_MakeAvailable()instead. See policyCMP0169. CallingFetchContent_Populate()with full population details rather than just a dependency name remains fully supported.The
Visual Studio 9 2008generator has been removed.
Other Changes¶
ctest(1)now rejects unknown command-line arguments with an error. Previously they were silently ignored.The precompiled Windows
.msiinstallers provided on cmake.org, when performing a fresh installation, now modify the system-widePATHby default. When replacing an existing installation of 3.30 or later, thePATHmodification preference is preserved by default.The official
.zipsource archive provided on cmake.org now uses LF newlines, instead of CRLF newlines, for consistency with modern conventions.The durations printed after "Configuring done" and "Generating done" messages now reflect time spent in generator-specific steps, and in a code model evaluation step at the beginning of generation that was not previously captured. Printed durations may appear longer than in previous versions of CMake, but are more accurate.
FetchContentnow prefers to populate content directly rather than using a separate sub-build. This may significantly improve configure times on some systems (Windows especially, but also on macOS when using the Xcode generator).cmake --freshalso forces the download, update, and patch steps of directly populated dependencies to be re-executed. PolicyCMP0168provides backward compatibility for those projects that still rely on using a sub-build for content population.When
FETCHCONTENT_FULLY_DISCONNECTEDis set to true,FetchContent_MakeAvailable()and the single-argument form ofFetchContent_Populate()require that the dependency's source directory has already been populated. CMake 3.29 and earlier did not check this requirement, but it is now enforced, subject to policyCMP0170.
Updates¶
Changes made since CMake 3.30.0 include the following.
3.30.1, 3.30.2¶
These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions.
3.30.3¶
The
project(<PROJECT-NAME>)command now sets<PROJECT-NAME>_SOURCE_DIR,<PROJECT-NAME>_BINARY_DIR, and<PROJECT-NAME>_IS_TOP_LEVELas normal variables in addition to setting them as cache entries. This is needed to preserve support for someFetchContentuse cases under policyCMP0169's NEW behavior.The
FindPythonandFindPython3modules now define, respectively, thePython_DEFINITIONSandPython3_DEFINITIONSvariables on Windows to support development with the free threaded version of Python. TheINTERFACE_COMPILE_DEFINITIONStarget property is also defined for the various targets provided by these modules.
3.30.4¶
The
project(<PROJECT-NAME>)command now sets<PROJECT-NAME>_SOURCE_DIR,<PROJECT-NAME>_BINARY_DIR, and<PROJECT-NAME>_IS_TOP_LEVELas normal variables only if they are already set as cache or non-cache variables whenproject()is invoked. Cache entries by the same names are always set as before. This refines 3.30.3's behavior change to restore behavior of nested directories that callproject()with the same project name, but the implementation in this release is flawed (this release note has been retoractively updated). It can result in different behavior between the first and subsequent runs. Do not use CMake 3.30.4 if your project contains nested calls toproject()with the same project name and you use these variables.
3.30.5¶
The
project(<PROJECT-NAME>)command now sets<PROJECT-NAME>_SOURCE_DIR,<PROJECT-NAME>_BINARY_DIR, and<PROJECT-NAME>_IS_TOP_LEVELas non-cache variables only if they are already set as non-cache variables whenproject()is invoked. Cache entries by the same names are always set as before. This refines 3.30.3's behavior change to restore behavior of nested directories that callproject()with the same project name, and it addresses the bug in the implementation introduced in 3.30.4.
3.30.6, 3.30.7, 3.30.8, 3.30.9¶
These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions.