Contents
Changes made since CMake 3.13 include the following.
The Visual Studio 16 2019 generator was added. This is experimental and based on “Visual Studio 2019 Preview 4” because this version of VS has not been released.
The VS 2019 generator differs from generators for earlier versions in that it does not provide variants that specify the target platform in the generator name. Instead CMAKE_GENERATOR_PLATFORM must be used, e.g. through the -A command-line option. Furthermore, the default target platform (architecture) is now based on the host platform. The VS host toolset selection is now based on the host architecture as well.
The Green Hills MULTI generator has been updated:
The family of modules to check capabilities (like CheckCSourceCompiles) gain capability to manage LINK_OPTIONS.
A CheckFortranSourceRuns module was added to provide a check_fortran_source_runs() command to check if a Fortran source snippet compiles and runs.
The CMakePackageConfigHelpers module’s write_basic_package_version_file() command gained a new ARCH_INDEPENDENT option for supporting architecture-independent packages.
The ExternalProject module ExternalProject_Add() command gained LOG_DIR and LOG_MERGED_STDOUTERR options to control logging.
The ExternalProject module ExternalProject_Add() command gained LOG_PATCH to optionally log the patch step.
The ExternalProject module ExternalProject_Add() command learned to apply SOURCE_SUBDIR when BUILD_IN_SOURCE is also used. The BUILD_COMMAND is run in the given SOURCE_SUBDIR of the SOURCE_DIR.
The FetchContent module gained a new FetchContent_MakeAvailable() command. It accepts a list of dependency names, which it then iterates over, populating and adding each one to the main build using the canonical pattern. This significantly reduces the amount of boilerplate needed in a project.
The FindBISON module’s BISON_TARGET command now runs bison with CMAKE_CURRENT_BINARY_DIR as the working directory. See policy CMP0088.
The FindCURL module gained support for requesting protocols as package components.
The FindFontconfig module was added to find fontconfig.
The FindGDAL module now provides imported targets.
The FindGIF module now provides imported targets.
The FindGit module now provides an imported target for the Git executable.
The FindIce module learned to find slice2confluence and slice2matlab.
The FindLibinput module was added to find libinput.
The FindLibLZMA module now provides imported targets.
The FindMatlab module gained new options R2017b and R2018a to specify the MEX API version to use; these options mirror the new options to the mex command in MATLAB R2018a. The option MX_LIBRARY is no longer needed.
The FindPostgreSQL module now provides imported targets.
The FindPython, FindPython2, and FindPython3 modules gained support for NumPy component.
The FindPython2, FindPython3, and FindPython modules now support running in script mode by skipping the creation of imported targets and helper functions.
The FindSQLite3 module was added to find the SQLite v3.x library.
The FindX11 had the following variables renamed in order to match their library names rather than header names. The old variables are provided for compatibility:
- X11_Xxf86misc_INCLUDE_PATH instead of X11_xf86misc_INCLUDE_PATH
- X11_Xxf86misc_LIB instead of X11_xf86misc_LIB
- X11_Xxf86misc_FOUND instead of X11_xf86misc_FOUND
- X11_Xxf86vm_INCLUDE_PATH instead of X11_xf86vmode_INCLUDE_PATH
- X11_Xxf86vm_LIB instead of X11_xf86vmode_LIB
- X11_Xxf86vm_FOUND instead of X11_xf86vmode_FOUND
- X11_xkbfile_INCLUDE_PATH instead of X11_Xkbfile_INCLUDE_PATH
- X11_xkbfile_LIB instead of X11_Xkbfile_LIB
- X11_xkbfile_FOUND instead of X11_Xkbfile_FOUND
- X11_Xtst_INCLUDE_PATH instead of X11_XTest_INCLUDE_PATH
- X11_Xtst_LIB instead of X11_XTest_LIB
- X11_Xtst_FOUND instead of X11_XTest_FOUND
- X11_Xss_INCLUDE_PATH instead of X11_Xscreensaver_INCLUDE_PATH
- X11_Xss_LIB instead of X11_Xscreensaver_LIB
- X11_Xss_FOUND instead of X11_Xscreensaver_FOUND
The following variables are deprecated completely since they were essentially duplicates:
- X11_Xinput_INCLUDE_PATH (use X11_Xi_INCLUDE_PATH)
- X11_Xinput_LIB (use X11_Xi_LIB)
- X11_Xinput_FOUND (use X11_Xi_FOUND)
The FindX11 now provides X11_Xext_INCLUDE_PATH.
The FindX11 now provides imported targets.
The UseSWIG module learned to pass -module <module_name> to the SWIG compiler if the file property SWIG_MODULE_NAME is defined. See policy CMP0086.
The UseSWIG module gained an option to specify SWIG source file extensions.
The AUTOMOC_EXECUTABLE, AUTORCC_EXECUTABLE, and AUTOUIC_EXECUTABLE target properties were added. They all take a path to an executable and force automoc/autorcc/autouic to use this executable.
Setting these will also prevent the configure time testing for these executables. This is mainly useful when you build these tools yourself.
The new variables CMAKE_GLOBAL_AUTOGEN_TARGET, CMAKE_GLOBAL_AUTOGEN_TARGET_NAME, CMAKE_GLOBAL_AUTORCC_TARGET and CMAKE_GLOBAL_AUTORCC_TARGET_NAME control the generation of global autogen and autorcc targets.
A new CMAKE_AUTOGEN_ORIGIN_DEPENDS variable and AUTOGEN_ORIGIN_DEPENDS target property may be set to enable or disable forwarding of the origin target dependencies to the corresponding _autogen target.
Changes made since CMake 3.14.0 include the following.