Changes made since CMake 3.16 include the following.
The IBM XL Fortran compiler is now supported by the
--debug-findcommand-line option to enable additional human-readable output on where
--trace-formatcommand-line option that can be used to set the
--traceoutput format. Currently, the old human readable and the new JSON format are supported. The new JSON format is easier to parse automatically than the existing format.
-E rmcommand-line tool that can be used to remove directories and files. This supersedes the existing
-E remove_directorytools and has better semantics.
add_custom_command()command learned to interpret paths in
DEPENDSarguments that are specified relative to the current binary directory.
foreach()command learned a new
ZIP_LISTSoption to iterate over multiple lists simultaneously.
message()command learned to output context provided in the
CMAKE_MESSAGE_CONTEXTvariable for log levels
NOTICEand below. Enable this output with the new
--log-contextcommand-line option or
message()command gained new keywords
CMAKE_CTEST_ARGUMENTSvariable was added to specify a list of command-line arguments passed to CTest when running through the
RUN_TESTS) target of the generated build system.
The following variables are now defined inside a
CMAKE_FIND_DEBUG_MODEvariable was introduced to print extra
find_*call information during the cmake run to standard error. Output is designed for human consumption and not for parsing.
CMAKE_MESSAGE_LOG_LEVELvariable can now be used to persist a log level between CMake runs, unlike the
--log-levelcommand line option which only applies to that particular run.
CMAKE_XCODE_SCHEME_WORKING_DIRECTORYvariable and associated
XCODE_SCHEME_WORKING_DIRECTORYtarget property were added to tell the
Xcodegenerator to set the value of the
Custom Working Directoryschema option.
DEPRECATIONtarget property was added to mark a target as deprecated. If a linked target is marked as deprecated, a warning with the deprecation message is issued at generate time.
INSTALL_NAME_DIRtarget property now supports
generator expressions. In particular, the
$<INSTALL_PREFIX>generator expression can be used to set the directory relative to the install-time prefix.
MACHO_CURRENT_VERSIONwere added to set the
curent_version, respectively, for Mach-O binaries. For backwards compatibility, if these properties are not set,
VERSIONare used respectively as fallbacks.
ExternalProject_Add()command gained a
GIT_SUBMODULES_RECURSEoption to specify whether Git submodules should be updated recursively. The default is on to preserve existing behavior.
FindCUDAToolkitmodule was added to find the CUDA Toolkit without enabling CUDA as a language.
FindCURLmodule learned to find CURL using the
CURLConfig.cmakepackage configuration file generated by CURL's cmake buildsystem. It also gained a new
CURL_NO_CURL_CMAKEoption to disable this behavior.
FindLibArchivemodule now provides an imported target for libarchive.
FindPythonmodule has learned to find Python components in active virtual environments managed by
FindPythonmodules gained, respectively, variable
Python_SOABIgiving the standard extension suffix for modules. Moreover, commands
Python_add_library()gained the option
WITH_SOABIto prefix the library suffix with the value of
FindLibXml2module now provides an imported target for the
ctest(1)tool gained support for Dr. Memory to run memcheck runs.
ctest(1)tool gained a
--no-tests=<[error|ignore]>option to explicitly set and unify the behavior between direct invocation and script mode if no tests were found.
ctest(1)tool gained a
--repeat <mode>:<n>option to specify conditions in which to repeat tests. This generalizes the existing
--repeat-until-fail <n>option to add modes for
ctest_test()command gained a
REPEAT <mode>:<n>option to specify conditions in which to repeat tests.
CPack DragNDrop Generatorlearned to handle RTF formatted license files. When
CPACK_DMG_SLA_DIRvariable is set,
<language>.license.rtfis considered, but only as a fallback when the plaintext (
.txt) file is not found in order to maintain backwards compatibility.
CPack NSIS Generatorgained a new variable
CPACK_NSIS_MUI_HEADERIMAGEto set the header image. To not break existing setups, it still defaults to
CPACK_PACKAGE_ICONif the new variable is not set.
An explicit deprecation diagnostic was added for policy
CMP0067and below were already deprecated). The
cmake-policies(7)manual explains that the OLD behaviors of all policies are deprecated and that projects should port to the NEW behaviors.
CPack PackageMaker Generatorgenerator has been deprecated because Xcode no longer distributes the PackageMaker tools. The undocumented
OSXX11generator has also been deprecated.
-E remove_directorytools are deprecated in favor of the new
-E rmtool. The older tools always returned 0 if a named path did not exist even without the force option and cannot be fixed without breaking compatibility, and so have been superseded.
CPack NSIS Generatornow requires NSIS 3.0 or later.
file APIindex file now emits a
multiConfigflag specifying whether or not the generator supports multiple output configurations.
When using MinGW tools, the
find_library()command no longer finds
.dllfiles by default. Instead, it expects
.dll.aimport libraries to be available.
MinGW Makefilesgenerator no longer issues an error if
sh.exeis present in the environment's
Ninjagenerator now prefers the first ninja build tool to appear in the
PATHno matter whether it is called
samu. Previously the first of those names to appear anywhere in the
PATHwould be preferred.
With SDCC the
sdartool is now preferred over
sdcclibas librarian. The latter was deprecated by SDCC 3.2.0 and removed in SDCC 3.8.6.
With SDCC the default flags no longer include any target-specific flags. Previously the default flags were hard-coded for 8051.
Xcodegenerator no longer hard-codes
Changes made since CMake 3.17.0 include the following.
CMake 3.17.0 updated the
CPack NSIS Generatorwith changes that require NSIS 3.0 or later. CMake 3.17.1 now enforces the use of a sufficiently new version.
FindPkgConfigmodule now extracts include directories prefixed with
INTERFACE_INCLUDE_DIRECTORIEStarget properties. Previously they would be places in
The default value of
CMAKE_AUTOMOC_PATH_PREFIXwas changed to
OFFbecause this feature can break existing projects that have identically named header files in different include directories. This restores compatibility with behavior of CMake 3.15 and below. The default was also changed to