CMake 3.27 Release Notes¶
Changes made since CMake 3.26 include the following.
New Features¶
Debugger¶
cmake(1)now supports interactive debugging of the CMake language. See the--debuggeroption.
Presets¶
cmake-presets(7)files now support schema version7.cmake-presets(7)now supports$penv{}macro expansion inincludefields.
Generators¶
The Makefile and Ninja generators now support using the
--dependency-filelinker flag, added by GNU Binutils 2.35 and LLVM's LLD 12.0.0, so that files read by the linker will cause a relink if they change (typically modified timestamps). See theCMAKE_LINK_DEPENDS_USE_LINKERvariable.The Visual Studio Generators for VS 14 (2015) and above learned to select the Windows SDK version explicitly using a
version=field in theCMAKE_GENERATOR_PLATFORMvariable. See Visual Studio Platform Selection.
Languages¶
The
CXXlanguage now treats source file extensions.ccm,.cxxm, and.c++mas C++.
File-Based API¶
The
cmake-file-api(7)"codemodel" version 2versionfield has been updated to 2.6.The
cmake-file-api(7)"codemodel" version 2 "target" object gained a new "frameworks" field in the "compileGroups" objects.
Platforms¶
Apple text-based stubs (i.e.
.tbdfiles) may now be created for shared libraries on macOS. See theENABLE_EXPORTSproperty.
Commands¶
The
add_custom_command()command gained a newDEPENDS_EXPLICIT_ONLYoption to tell the Ninja Generators not to add any dependencies implied by the target to which it is attached. TheCMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLYvariable was added to enableDEPENDS_EXPLICIT_ONLYon all calls toadd_custom_command()command.The
cmake_file_api()command was added for projects to addCMake file APIqueries for the current CMake run.The
find_package()command now searches prefixes specified by upper-case<PACKAGENAME>_ROOTCMake variables and upper-case<PACKAGENAME>_ROOTenvironment variables. See policyCMP0144.The
install(CODE)andinstall(SCRIPT)commands now support the$<INSTALL_PREFIX>generator expression.
Variables¶
The
CMAKE_DLL_NAME_WITH_SOVERSIONvariable and associatedDLL_NAME_WITH_SOVERSIONtarget property were added to optionally append theSOVERSIONto the filename of the.dllpart of a shared library on Windows.Variables
CMAKE_VS_DEBUGGER_COMMAND,CMAKE_VS_DEBUGGER_COMMAND_ARGUMENTS,CMAKE_VS_DEBUGGER_ENVIRONMENT, andCMAKE_VS_DEBUGGER_WORKING_DIRECTORYwere added to initialize corresponding target properties.The
CMAKE_VS_WINDOWS_TARGET_PLATFORM_MIN_VERSIONvariable was added to initialize theVS_WINDOWS_TARGET_PLATFORM_MIN_VERSIONtarget property on all targets when they are created.
Properties¶
A
CUDA_CUBIN_COMPILATIONtarget property was added to Object Libraries to support compiling to.cubinfiles instead of host object files. Currently only supported with NVIDIA.A
CUDA_FATBIN_COMPILATIONtarget property was added to Object Libraries to support compiling to.fatbinfiles instead of host object files. Currently only supported with NVIDIA.A
CUDA_OPTIX_COMPILATIONtarget property was added to Object Libraries to support compiling to.optixirfiles instead of host object files. Currently only supported with NVIDIA.The
<LANG>_CLANG_TIDY,<LANG>_CPPCHECK,<LANG>_CPPLINT, and<LANG>_INCLUDE_WHAT_YOU_USE, target properties now supportgenerator expressions.The
<LANG>_LINKER_LAUNCHERtarget property now supportsgenerator expressions.The
SKIP_LINTINGsource file property was added to suppress target-wide code checks on specific sources.
Modules¶
The
FindCUDAToolkitmodule now provides an imported target forcudla, and imported targets for CUPTI'snvperfandpcsamplingcomponents.The
FindDoxygenmodule'sdoxygen_add_docs()command gained aCONFIG_FILEoption to specify a custom doxygen configuration file.The
FindOpenGLmodule gained support for componentsGLES2andGLES3.The
FindwxWidgetsmodule now provides an imported target.
Generator Expressions¶
The
COMPILE_ONLYgenerator expression was added to specify compilation usage requirements without any linking requirements.$<LIST:...>generator expressions were added for query, transformation, and ordering operations on lists.$<PATH:...>generator expressions for decomposition and transformation operations learned to process lists of paths element-wise.The
TARGET_IMPORT_FILE,TARGET_IMPORT_FILE_BASE_NAME,TARGET_IMPORT_FILE_PREFIX,TARGET_IMPORT_FILE_SUFFIX,TARGET_IMPORT_FILE_NAME, andTARGET_IMPORT_FILE_DIRgenerator expressions were added. These expand to details about the linker import file for a target.The
TARGET_RUNTIME_DLL_DIRSgenerator expression was added. It expands to a list of the directories containing DLLs inTARGET_RUNTIME_DLLS.
Autogen¶
The
CMAKE_AUTOMOC_EXECUTABLE,CMAKE_AUTORCC_EXECUTABLE, andCMAKE_AUTOUIC_EXECUTABLEvariables were added to initialize the corresponding target properties as targets are created.The
AUTOGEN_USE_SYSTEM_INCLUDEtarget property and correspondingCMAKE_AUTOGEN_USE_SYSTEM_INCLUDEvariable were added to explicitly control whether autogen headers are considered system headers.The
INTERFACE_AUTOMOC_MACRO_NAMEStarget property was added to specify macro names formocas a transitive usage requirement.
CTest¶
The
TIMEOUT_SIGNAL_NAMEandTIMEOUT_SIGNAL_GRACE_PERIODtest properties were added to specify a POSIX signal to send to a test process when its timeout is reached.
CPack¶
The
CPack Inno Setup Generatorwas added to package using Inno Setup.
Deprecated and Removed Features¶
Compatibility with versions of CMake older than 3.5 is now deprecated and will be removed from a future version. Calls to
cmake_minimum_required()orcmake_policy()that set the policy version to an older value now issue a deprecation diagnostic.The Extra Generators have been deprecated. IDEs may use the
cmake-file-api(7)to view CMake-generated project build trees.The
FindCUDAmodule, which has been deprecated since CMake 3.10, has been removed by policyCMP0146. Port projects to CMake's first-classCUDAlanguage support.The
FindPythonInterpandFindPythonLibsmodules, which have been deprecated since CMake 3.12, have been removed by policyCMP0148. Port projects toFindPython3,FindPython2, orFindPython.The
DartandFindDartmodules have been deprecated via policyCMP0145. Port projects to theCTestmodule.The
Visual Studio 9 2008generator is now deprecated and will be removed in a future version of CMake.
Other Changes¶
cmake --build $dir --verbosewill now print the working directory and command line used to perform the build.The
ExternalProjectandFetchContentmodules now resolve relativeGIT_REPOSITORYpaths as relative to the parent project's remote, not as a relative local file system path. SeeCMP0150.The
ExternalProjectconfigurestep no longer re-runs on every build when theUPDATE_DISCONNECTEDoption is enabled. It will only re-run if details of thedownload,update, orpatchstep change.The
ExternalProjectupdateandpatchsteps now always re-run if any of their details change, even if theUPDATE_DISCONNECTEDoption is enabled. If using theGITdownload method, and theGIT_TAGis changed to a commit that is not already known locally, an error is now issued instead of silently using the previousGIT_TAG.The
FindPython,FindPython2andFindPython3modules now support the Windows ARM64 platform.The
file(GET_RUNTIME_DEPENDENCIES)command now case-preserves DLL names reported on Windows. They are still converted to lowercase for filter matching.The
SYSTEMtarget property is now honored for Apple Frameworks.Visual Studio Generators, for VS 15.8 (2017) and newer, now build custom commands in parallel. See policy
CMP0147.Visual Studio Generators for VS 14 (2015) and above now prefer to select the latest Windows SDK version. See policy
CMP0149.
Updates¶
Changes made since CMake 3.27.0 include the following.
3.27.1¶
This version made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions.
3.27.2¶
Visual Studio Generators for VS 14 (2015) and above now prefer to select the latest Windows SDK, as documented by policy
CMP0149, when targeting any version of Windows. In CMake 3.27.[0-1] the preference was limited to targeting Windows 10 and above.Visual Studio Generators for VS 14 (2015) and above now support using
version=8.1in theCMAKE_GENERATOR_PLATFORMvariable to select the Windows 8.1 SDK. In CMake 3.27.[0-1] theversion=field was limited to selecting Windows 10 SDKs.
3.27.3, 3.27.4, 3.27.5, 3.27.6, 3.27.7¶
These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions.