3.15.0:
New Features
============
Generators
----------
* The "Xcode" generator now supports per-target schemes. See the
"CMAKE_XCODE_GENERATE_SCHEME" variable and "XCODE_GENERATE_SCHEME"
target property.
* The "Green Hills MULTI" generator has been updated:
* It now supports the "add_custom_command()" and
"add_custom_target()" commands.
* It is now available on Linux.
Languages
---------
* Preliminary support for the "Swift" language was added to the
"Ninja" generator:
* Use the "SWIFTC" environment variable to specify a compiler.
* The "Swift_DEPENDENCIES_FILE" target property and
"Swift_DEPENDENCIES_FILE" source file property were added to
customize dependency files.
* The "Swift_MODULE_NAME" target property was added to customize
the Swift module name.
* The "Swift_DIAGNOSTICS_FILE" source property was added to
indicate where to write the serialised Swift diagnostics.
The Swift support is experimental, not considered stable, and may
change in future releases of CMake.
Compilers
---------
* The "Clang" compiler variant on Windows that targets the MSVC ABI
but has a GNU-like command line is now supported.
* Support for the Clang-based ARM compiler was added with compiler
id "ARMClang".
* Support was added for the IAR compiler architectures Renesas RX,
RL78, RH850 and Texas Instruments MSP430.
* Support was added for the IAR compilers built for Linux (IAR
BuildLx).
Command-Line
------------
* The "CMAKE_GENERATOR" environment variable was added to specify a
default generator to use when "cmake(1)" is run without a "-G"
option. Additionally, environment variables
"CMAKE_GENERATOR_PLATFORM", "CMAKE_GENERATOR_TOOLSET", and
"CMAKE_GENERATOR_INSTANCE" were created to configure the generator.
* The "cmake(1)" "--build" tool "--target" parameter gained support
for multiple targets, e.g. "cmake --build . --target Library1
Library2". It now also has a short form "-t" alias, e.g. "cmake
--build . -t Library1 Library2".
* The "cmake(1)" command gained a new "--install" option. This may
be used after building a project to run installation without using
the generated build system or the native build tool.
* The "cmake(1)" command learned a new CLI option "--loglevel".
* The "cmake(1)" "-E remove_directory" command-line tool learned to
support removing multiple directories.
* The "cmake(1)" "-E tar" tool has been improved:
* It now continues adding files to an archive even if some of the
files are not readable. This behavior is more consistent with the
classic "tar" tool.
* It now parses all flags, and if an invalid flag was provided, a
warning is issued.
* It now displays an error if no action flag was specified, along
with a list of possible actions: "t" (list), "c" (create) or "x"
(extract).
* It now supports extracting ("-x") or listing ("-t") only
specific files or directories.
* It now supports Zstandard compression with a "--zstd" option.
Zstandard was designed to give a compression ratio comparable to
that of the DEFLATE (zip) algorithm, but faster, especially for
decompression.
Commands
--------
* The "add_custom_command()" and "add_custom_target()" commands
gained a new "JOB_POOL" option that works with the "Ninja" generator
to set the pool variable on the build statement.
* The "add_library()" command "ALIAS" option learned to support
import libraries of the "UNKNOWN" type.
* The "cmake_parse_arguments()" command gained an additional
"_KEYWORDS_MISSING_VALUES" output variable to report keyword
arguments that were given by the caller with no values.
* The "execute_process()" command gained a "COMMAND_ECHO" option and
supporting "CMAKE_EXECUTE_PROCESS_COMMAND_ECHO" variable to enable
echoing of the command-line string before execution.
* The "file(INSTALL)" command learned a new argument,
"FOLLOW_SYMLINK_CHAIN", which can be used to recursively resolve and
install symlinks.
* "list()" learned new sub-commands: "PREPEND", "POP_FRONT" and
"POP_BACK".
* The "message()" command learned new types: "NOTICE", "VERBOSE",
"DEBUG" and "TRACE".
* The "string()" learned a new sub-command "REPEAT".
Variables
---------
* The "CMAKE_CROSSCOMPILING_EMULATOR" variable and corresponding
"CROSSCOMPILING_EMULATOR" target property learned to support
arguments to the emulator.
* The "CMAKE_FIND_PACKAGE_PREFER_CONFIG" variable was added to tell
"find_package()" calls to look for a package configuration file
first even if a find module is available.
* The "CMAKE_FRAMEWORK" variable was added to initialize the
"FRAMEWORK" property on all targets.
* The "CMAKE_VS_JUST_MY_CODE_DEBUGGING" variable and
"VS_JUST_MY_CODE_DEBUGGING" target property were added to enable the
Just My Code feature of the Visual Studio Debugger when compiling
with MSVC cl 19.05 and higher.
* The "CMAKE_MSVC_RUNTIME_LIBRARY" variable and
"MSVC_RUNTIME_LIBRARY" target property were introduced to select the
runtime library used by compilers targeting the MSVC ABI. See policy
"CMP0091".
* The "CMAKE_PROJECT_INCLUDE" and "CMAKE_PROJECT_INCLUDE_BEFORE"
variables were added to allow injection of custom code at the sites
of "project()" calls without knowing the project name a priori.
Properties
----------
* The "ADDITIONAL_CLEAN_FILES" target property and
"ADDITIONAL_CLEAN_FILES" directory property were added. They allow
to register additional files that should be removed during the clean
stage.
* The "PUBLIC_HEADER" and "PRIVATE_HEADER" properties may now be set
on Interface Libraries. The headers specified by those properties
can be installed using the "install(TARGETS)" command by passing the
"PUBLIC_HEADER" and "PRIVATE_HEADER" arguments respectively.
* The "VS_PACKAGE_REFERENCES" target property was added to tell
Visual Studio Generators to add references to "nuget" packages.
* The "VS_PROJECT_IMPORT" target property was added to allow managed
Visual Studio project files to import external ".props" files.
* The "VS_NO_SOLUTION_DEPLOY" target property was added to tell
Visual Studio Generators whether to deploy an artifact to the WinCE
or Windows Phone target device.
Modules
-------
* The "FindBoost" module was reworked to expose a more consistent
user experience between its “Config” and “Module” modes and with
other find modules in general.
* A new imported target "Boost::headers" is now defined (same as
"Boost::boost").
* New output variables "Boost_VERSION_MACRO",
"Boost_VERSION_MAJOR", "Boost_VERSION_MINOR",
"Boost_VERSION_PATCH", and "Boost_VERSION_COUNT" were added.
* The "QUIET" argument passed to "find_package()" is no longer
ignored in config mode. Note that the CMake package shipped with
Boost "1.70.0" ignores the "QUIET" argument passed to
"find_package()". This is fixed in the next Boost release.
* The input switch "Boost_DETAILED_FAILURE_MSG" was removed.
* "Boost_VERSION" now reports the version in "x.y.z" format in
module mode. See policy "CMP0093".
* The "FindCups" module now provides imported targets.
* The "FindEnvModules" module was added to use Lua- and TCL-based
environment modules in CTest Scripts.
* The "FindGLEW" module now provides an interface more consistent
with what upstream GLEW provides in its own CMake package files.
* The "FindPkgConfig" now populates "INTERFACE_LINK_OPTIONS"
property of imported targets with other (non-library) linker flags.
* The "FindPostgreSQL" module learned to find debug and release
variants separately.
* Modules "FindPython3", "FindPython2" and "FindPython" gained
additional lookup strategies and controls, and a new default. See
policy "CMP0094".
* Modules "FindPython", "FindPython2" and "FindPython3" gain a new
target (respectively "Python::Module", "Python2::Module" and
"Python3::Module") which can be used to develop Python modules.
* Modules "FindPython3", "FindPython2" and "FindPython" gain
capability to control how virtual environments are handled.
* The "UseSWIG" module learned to manage alternate library names by
passing "-interface " for "python" language or
"-dllimport " for "CSharp" language to the "SWIG"
compiler.
Generator Expressions
---------------------
* The "generator expressions" "C_COMPILER_ID", "CXX_COMPILER_ID",
"CUDA_COMPILER_ID", "Fortran_COMPILER_ID", "COMPILE_LANGUAGE",
"COMPILE_LANG_AND_ID", and "PLATFORM_ID" learned to support matching
one value from a comma-separated list.
CTest
-----
* The "ctest_submit()" command learned a new option: "BUILD_ID".
This can be used to store the ID assigned to this build by CDash to
a variable.
* The "ctest_update()" command learned to honor a new variable:
"CTEST_UPDATE_VERSION_OVERRIDE". This can be used to specify the
current version of your source tree rather than using the update
command to discover the current version that is checked out.
CPack
-----
* The "CPack IFW Generator" gained a new
"CPACK_IFW_PACKAGE_STYLE_SHEET" variable to customize the installer
stylesheet.
Deprecated and Removed Features
===============================
* The "cmake-server(7)" mode has been deprecated and will be removed
from a future version of CMake. Please port clients to use the
"cmake-file-api(7)" instead.
* The "ADDITIONAL_MAKE_CLEAN_FILES" directory property is now
deprecated. Use the "ADDITIONAL_CLEAN_FILES" directory property
instead.
* The variable "CMAKE_AUTOMOC_RELAXED_MODE" is considered
deprecated. Support still exists but will be removed in future
versions.
* The "export(PACKAGE)" command now does nothing unless enabled via
"CMAKE_EXPORT_PACKAGE_REGISTRY". See policy "CMP0090".
* The "Xcode" generator now requires at least Xcode 5.
* An explicit deprecation diagnostic was added for policy "CMP0066"
("CMP0065" and 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.
Other Changes
=============
* CMake learned how to compile C++14 with the IBM AIX XL compiler
and the SunPro compiler and to compile C++20 with the AppleClang
compiler.
* With MSVC-like compilers the value of "CMAKE__FLAGS" no
longer contains warning flags like "/W3" by default. See policy
"CMP0092".
* IBM Clang-based XL compilers that define "__ibmxl__" now use the
compiler id "XLClang" instead of "XL". See policy "CMP0089".
* The "file(REMOVE)" and "file(REMOVE_RECURSE)" commands were
changed to ignore empty arguments with a warning instead of treating
them as a relative path and removing the contents of the current
directory.
Changes in 3.14.5 since 3.14.4:
* FindBoost: Add compiler features for Boost Contract library
* libarchive: avoid b64_encode name conflict with Solaris built-in function
* FindThreads: Drop incorrect docs about usage with C++
* Do not exclude include directories made implicit by CPATH
* VS: Isolate custom command input/output generation scopes
* VS: Clarify name of custom commands AdditionalInputs variable
* VS: De-duplicate custom command dependencies
Changes in 3.14.4 since 3.14.3:
* FindBoost: Record compiler features for Boost 1.67 and above
* FindBoost: Fix compiler features for `fiber` and `context`
* iOS: Fix try_compile FILE_COPY not to fail
* target_link_libraries: Fix static library private deps in other dirs
* Help: Add 3.14.4 release notes
* FindSWIG: Support swig4.0
* Apple: Preserve high resolution mtime for static libraries
* Apple: Properly lookup XCTest for iOS and tvOS
* FindPython: NumPy: fix erroneous dependencies management
* FindPython: ensure variable Python_RUNTIME_LIBRARY_DIRS is set correctly
Changes in 3.14.3 since 3.14.2:
* FindOpenGL: look for GLVND libraries with a libglvnd suffix
* FindBoost: Add support for MSVC toolset version 14.2
* IRSL: Update redist directory for VS 2019 update 1
* VS: Provide the default platform name to project code
* FindQt3: Restore missing lib and bin path suffixes
* FindBoost: Fix detection with version suffixes on Gentoo
Changes in 3.14.2 since 3.14.1:
* MSVC: Fix MSVC_TOOLSET_VERSION for VS 2019 v142 toolset
* ARMCC: Do not identify ARMClang as ARMCC
* IRSL: Fix discovery of VS 2019 v142 toolset redistributables
* Tests: Clarify hand-written cases in RunCMake.ParseImplicitIncludeInfo
* Tests: Teach RunCMake.ParseImplicitIncludeInfo to match output by regex
* Fix implicit include directory extraction for adaptive relative paths
* Xcode: Factor out duplicate source group code into lambda
* Xcode: Avoid mutating App Bundle targets during generation
* cmake-gui: Fix icon overlay on windows
* Modules/CTest: Fix SubmitURL
* cmake-gui: Fix theme on Windows with Qt >= 5.10
Changes in 3.14.1 since 3.14.0:
* VS: Fix x64 host recognition by x86 cmake process
* find_program: Restore leading double slash on Windows network path
* Eclipse: Fix extra generator to not crash on interface libraries
* ARMCC: Fix identification of ARM compiler when it defines GNU macros
* Help: Clarify policy CMP0082 documentation
* Restore support for include_directories() in toolchain files
* CUDA: Tolerate square brackets in PROMPT environment variable
* cmake: Fix '-E copy foo .' to avoid clobbering file
* FindFontconfig: Convert module variables to camel case
* ParseImplicitIncludeInfo: Canonicalize implicit include dirs
* CPackIFW: Add missing cpack_ifw_configure_component_group option processing
* FindPython*: ensure correct architecture is selected.
* Autogen: Do not treat hard-coded -I/usr/include exclusion as implicit include
* ctest_coverage: fix out-of-bounds index in Jacoco parser
3.14.0:
New Features
Generators
* 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 Green Hills MULTI generator has been updated:
File-Based API
* A file-based api for clients to get semantic buildsystem information has been added.
Platforms
* CMake now supports Cross Compiling for iOS, tvOS, or watchOS using simple toolchain files.
Command-Line
* The cmake(1) Build Tool Mode (cmake --build) gained --verbose and -v options to specify verbose build output. Some generators such as Xcode don’t support this option currently.
* The cmake(1) -E compare_files command learned a new --ignore-eol option to specify that end-of-line differences (e.g. LF vs CRLF) should be ignored when comparing files.
* The cmake-gui(1) dialog gained new -S and -B arguments to explicitly specify source and build directories.
Commands
* The file() command learned a new sub-command, CREATE_LINK, which can be used to create hard or symbolic links.
* The file() command learned a new sub-command, READ_SYMLINK, which can be used to determine the path that a symlink points to.
* The file() command gained a SIZE mode to get the size of a file on disk.
* The find_package() command learned to optionally resolve symbolic links in the paths to package configuration files. See the CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS variable.
* The get_filename_component() command gained new LAST_EXT and NAME_WLE variants to work with the extension after the last . in the name.
* The if() command gained support for checking if cache variables are defined with the DEFINED CACHE{VAR} syntax.
* The install(CODE) and install(SCRIPT) commands learned to support generator expressions. See policy CMP0087.
* The install(TARGETS) command learned how to install to an appropriate default directory for a given target type, based on variables from the GNUInstallDirs module and built-in defaults, in lieu of a DESTINATION argument.
* The install(FILES) and install(DIRECTORY) commands learned a new set of parameters for installing files as a file type, setting the destination based on the appropriate variables from GNUInstallDirs and built-in defaults, in lieu of a DESTINATION argument.
* The list() operations REMOVE_ITEM, REMOVE_DUPLICATES, SORT, REVERSE, and FILTER all now accept a non-existent variable as the list since these operations on empty lists is also the empty list.
* The list() operation REMOVE_AT now indicates that the given indices are invalid for a non-existent variable or empty list.
* The try_compile() and try_run() commands gained a new LINK_OPTIONS option.
Variables
* A CMAKE_BUILD_RPATH_USE_ORIGIN variable and corresponding BUILD_RPATH_USE_ORIGIN target property were added to enable use of relative runtime paths (RPATHs). This helps achieving relocatable and reproducible builds that are invariant of the build directory.
Properties
* A CMAKE_ROLE global property was added to allow scripts to determine whether they’re running in project mode, script mode, find-package mode, CTest, or CPack.
* The CUDA_RESOLVE_DEVICE_SYMBOLS target property is now supported on shared library, module library, and executable targets. Previously it was only honored on static libraries.
* The EXCLUDE_FROM_ALL target property was created to override the setting of its directory. A target will now be built as part of “all” if its EXCLUDE_FROM_ALL property is set to OFF, even if its containing directory is marked as EXCLUDE_FROM_ALL.
* INTERFACE_POSITION_INDEPENDENT_CODE target property gains the support of generator expressions.
In case the compiler used advertises C++17 but uses a C++ library that
lacks some features, we'll need specific testing.
Unbreaks the build for: libstdc++ from 5.4 and clang 7.0
Submitted upstream: https://gitlab.kitware.com/cmake/cmake/merge_requests/3030/diffs
(No response yet)
From wizermil.
Changes in 3.13.4 since 3.13.3:
* Tests: add cases for providing Qt5Core_VERSION manually
* AutoGen: query Qt5 version from directory properties
* Revert "file: Allow DOWNLOAD/UPLOAD using alternate authentication
methods"
* Intel: Record support for relaxed constexpr by version 18.0.5
* macOS: Restore compatibility for setting FRAMEWORK after install()
* FindLAPACK: Distinguish check result variable name from FindBLAS
* macOS: Add missing explicit dependency on CoreServices framework
* cmake: Convert no source/build dir error to warning
* Help: Add 3.13.4 release note for no source/build dir error/warning
* FindDoxygen: Escape backslashes in default values
Changes in 3.13.3 since 3.13.2:
- VS: Exclude VS 2019 instances when using VS 2017 generator
- Tests: Add cases for -{C,D,U} without a source tree
- Tests: Add case for warning when AUTOMOC/UIC/RCC gets disabled
- cmake: Stop processing if -P option lacks file name
- cmake: Ensure source and binary dirs are set
- cmake: distinguish '-Cpath' from '-C path' in source dir parsing
- Autogen: Issue a warning when AUTOMOC/UIC/RCC gets disabled.
- BundleUtilities: Ensure target dir exists when creating symlinks
Changes in 3.13.2 since 3.13.1:
* CUDA: Add CUDA 10 (Turing) detection
* CUDA: Fix crash on linking to a CUDA target without CUDA enabled
* CPack/External: Fix status messages of staging scripts
* Autogen: Revert passing compiler implicit includes to moc
Changes in 3.13.1 since 3.13.0:
Fortran: Fix module dependency scanning with upper-case SUBMODULE
FindBoost: Restore finding without CXX language enabled
VS: Avoid crash with VS 2015 when all SDKs are higher than 10.0.14393.0
Autogen: Fix empty uic executable string
CMake 3.13.0:
The Visual Studio Generators for VS 2010 and above learned to
support the “INTERPROCEDURAL_OPTIMIZATION” target property and
supporting “CheckIPOSupported” module.
The “Green Hills MULTI” generator has been updated to include
support for platform, architecture, and toolset selection.
The “cmake” command gained the “-S <source_dir>” command line
option to specify the location of the source directory. This option
can be used independently of “-B”.
The “cmake” command gained the “-B <build_dir>” command line
option to specify the location of the build directory. This option
can be used independently of “-S”.
The “cmake” “-E create_symlink” command can now be used on
Windows.
The “target_link_directories()” command was created to specify
link directories for targets and their dependents.
The “target_link_options()” command was created to specify link
options for targets and their dependents.
The “target_link_libraries()” command may now be called to modify
targets created outside the current directory. See policy “CMP0079”.
The “install(TARGETS)” command learned to install targets created
outside the current directory.
A “VS_DEBUGGER_COMMAND_ARGUMENTS” target property was created to
set the debugging command line arguments with Visual Studio
Generators for VS 2010 and above.
A “VS_DEBUGGER_ENVIRONMENT” target property was created to set the
debugging environment with Visual Studio Generators for VS 2010 and
above.
The “option()” command now honors an existing normal variable of
the same name and does nothing instead of possibly creating a cache
entry (or setting its type) and removing the normal variable. See
policy “CMP0077”.
The “target_sources()” command now interprets relative source file
paths as relative to the current source directory. This simplifies
incrementally building up a target’s sources from subdirectories.
The “CMP0076” policy was added to provide backward compatibility
with the old behavior where required.
ccmake needs wsyncup(3) and since NetBSD 8.0 it is present on NetBSD.
Handle that via `USE_CURSES= wsyncup' and remove enforcements about
ncurses in CMakeLists.txt and Source/Checks/Curses/CMakeLists.txt.
Bump PKGREVISION
Changes in 3.12.3 since 3.12.2:
* CTest: Fix --test-load regression
* FindMPI: Restore MPI__COMPILE_FLAGS as a command-line string
* FindDoxygen: Ensure policy settings allow use of IN_LIST
* libarchive: Backport fix for build with LibreSSL 2.7
* libuv: do not require PATH_MAX to be defined
* VS: Fix CSharp flag selection when linking to a static C++ library
* CSharp: Fix regression in VS project type selection
* CTest: Fix regression in ctest_start()
* Help: TESTS property: clarify usage.
Changes in 3.12.2 since 3.12.1:
* Android: Add support for NDK r18
* CheckIPOSupported: Simplify result reporting logic
* CheckIPOSupported: Tolerate backslashes in output of failed checks
* VS: Restore CMakeLists.txt references in each target
* EXPORT_PROPERTIES: Add test for an undefined property
* EXPORT_PROPERTIES: Prevent null dereference for undefined property
* Help: Fix typo in clang-tidy example -checks option
* FindBoost: Fix context discovery for 1.60 and below
* FindCUDA: Do not find cublas_device on CUDA >= 9.2
* FindMatlab: Remove erroneous duplicate code
* CUDA: Avoid using deprecated cublas_device to identify device lib dirs
* cmState: Clear GlobVerificationManager state on Reset
Changes in 3.12.1 since 3.12.0:
- CSharp: Set CMAKE_CSharp_COMPILER_LOADED variable when language is enabled
- UseSWIG: Use CSharp language only if it is enabled
- Help: Add explicit <PackageName>_ROOT variable documentation
- Tests: Add case showing CMP0048 warning on injected project command
- project: Do not issue CMP0048 warnings on injected call
- CPack: Restore support for 0-valued version components
- FindCUDA/select_compute_arch: Restore two-component CUDA_VERSION
- GoogleTest: Ensure policy settings allow use of IN_LIST
- FindTCL: Add support for version 8.7
- FindPython*: fix erroneous behavior on multiple 'find_package' calls
- UseSWIG: restore legacy behavior for SWIG_MODULE_<name>_EXTRA_FLAGS
Changelog:
Changes made since CMake 3.11 include the following.
New Features
Generators
* The Visual Studio Generators for VS 2017 learned to support a version=14.##
option in the CMAKE_GENERATOR_TOOLSET value (e.g. via the cmake(1) -T
option) to specify a toolset version number.
Command-Line
* The cmake(1) Build Tool Mode (cmake --build) gained --parallel [<jobs>] and
-j [<jobs>] options to specify a parallel build level. They map to
corresponding options of the native build tool.
Commands
* The add_compile_definitions() command was added to set preprocessor
definitions at directory level. This supersedes add_definitions().
* The cmake_minimum_required() and cmake_policy(VERSION) commands now accept
a version range using the form <min>[...<max>]. The <min> version is
required but policies are set based on the older of the running CMake
version and the version specified by <max>. This allows projects to specify
a range of versions for which they have been updated and avoid explicit
policy settings.
* The file(GLOB) and file(GLOB_RECURSE) commands learned a new flag
CONFIGURE_DEPENDS which enables expression of build system dependency on
globbed directory’s contents.
* The file(TOUCH) and file(TOUCH_NOCREATE) commands were added to expose
TOUCH functionality without having to use CMake’s command-line tool mode
with execute_process().
* The find_package() command now searches a prefix specified by a
PackageName_ROOT CMake or environment variable. Package roots are
maintained as a stack so nested calls to all find_* commands inside find
modules also search the roots as prefixes. See policy CMP0074.
* The install() command learned an optional NAMELINK_COMPONENT parameter,
which allows you to change the component for a shared library’s namelink.
If none is specified, the value of COMPONENT is used by default.
* The list() command learned a JOIN sub-command to concatenate list’s
elements separated by a glue string.
* The list() command learned a SUBLIST sub-command to get a sublist of the
list.
* The list() command learned a TRANSFORM sub-command to apply various string
transformation to list’s elements.
* The project() command learned an optional HOMEPAGE_URL parameter which has
the effect of setting variables like PROJECT_HOMEPAGE_URL, <PROJECT-NAME>
_HOMEPAGE_URL and CMAKE_PROJECT_HOMEPAGE_URL.
* The string() command learned a JOIN sub-command to concatenate input
strings separated by a glue string.
* target_compile_options() and add_compile_options() commands gained a SHELL:
prefix to specify a group of related options using shell-like quoting.
* The target_link_libraries() command now supports Object Libraries. Linking
to an object library uses its object files in direct dependents and also
propagates usage requirements.
Variables
* The CMAKE_FOLDER variable was added to initialize the FOLDER property on
all targets.
* The CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION variable was defined to
initialize all DOTNET_TARGET_FRAMEWORK_VERSION target properties.
* CMAKE_PROJECT_VERSION* variables have been introduced:
+ CMAKE_PROJECT_VERSION
+ CMAKE_PROJECT_VERSION_MAJOR
+ CMAKE_PROJECT_VERSION_MINOR
+ CMAKE_PROJECT_VERSION_PATCH
+ CMAKE_PROJECT_VERSION_TWEAK
* The CMAKE_SUPPRESS_REGENERATION variable was extended to support the Ninja
and Makefile Generators. It is also now documented.
* CMAKE_VS_SDK_*_DIRECTORIES variables were defined to tell Visual Studio
Generators for VS 2010 and above how to populate fields in .vcxproj files
that specify SDK directories. The variables are:
+ CMAKE_VS_SDK_EXCLUDE_DIRECTORIES
+ CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES
+ CMAKE_VS_SDK_INCLUDE_DIRECTORIES
+ CMAKE_VS_SDK_LIBRARY_DIRECTORIES
+ CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES
+ CMAKE_VS_SDK_REFERENCE_DIRECTORIES
+ CMAKE_VS_SDK_SOURCE_DIRECTORIES
* A MSVC_TOOLSET_VERSION variable was added to provide the MSVC toolset
version associated with the current MSVC compiler version in MSVC_VERSION.
Properties
* The COMMON_LANGUAGE_RUNTIME target property was introduced to configure the
use of managed C++ for Visual Studio Generators for VS 2010 and above. A
corresponding IMPORTED_COMMON_LANGUAGE_RUNTIME target property was added to
support C++/CLI for imported targets.
* The DOTNET_TARGET_FRAMEWORK_VERSION target property was introduced as
replacement for VS_DOTNET_TARGET_FRAMEWORK_VERSION, which is considered
deprecated now.
* An EXPORT_PROPERTIES target property was added to specify a custom list of
target properties to include in targets exported by the install(EXPORT) and
export() commands.
* The PDB_OUTPUT_DIRECTORY property learned to support generator expressions.
* A TESTS directory property was added to hold the list of tests defined by
the add_test() command.
* A VS_DEBUGGER_COMMAND target property was created to set the debugging
command line with Visual Studio Generators for VS 2010 and above.
* HLSL source file properties VS_SHADER_DISABLE_OPTIMIZATIONS and
VS_SHADER_ENABLE_DEBUG gained support for generator expressions.
* HLSL source file property VS_SHADER_OBJECT_FILE_NAME has been added to the
Visual Studio Generators for VS 2010 and above. The property specifies the
file name of the compiled shader object.
Modules
* The FindALSA module now provides imported targets.
* The FindCURL module now provides imported targets.
* The FindJPEG module now provides imported targets.
* The FindLibXml2 module now provides imported targets.
* The FindMatlab module now supports the Matlab Runtime Compiler (MCR) for
compiling and linking matlab extensions.
* A FindODBC module was added to find an Open Database Connectivity (ODBC)
library.
* The FindPkgConfig module has learned to export the found libraries with
full path for direct consumption with the target_link_libraries() command.
* New FindPython3 and FindPython2 modules, as well as a new FindPython
module, have been added to provide a new way to locate python environments.
* The UseSWIG module gained a whole refresh and is now more consistent with
standard CMake commands to generate libraries and is fully configurable
through properties.
* The UseSWIG module learned to manage multiple behaviors through
UseSWIG_MODULE_VERSION variable to ensure legacy support as well as more
robust handling of SWIG advanced features (like %template).
* The UseSWIG module learned to support CSHARP variant wrapper files.
* The WriteCompilerDetectionHeader module gained a BARE_FEATURES option to
add a compatibility define for the exact keyword of a new language feature.
Generator Expressions
* A new $<GENEX_EVAL:...> and $<TARGET_GENEX_EVAL:target,...> generator
expression has been added to enable consumption of generator expressions
whose evaluation results itself in generator expressions.
* A new $<IN_LIST:...> generator expression has been added.
* A new $<TARGET_EXISTS:...> generator expression has been added.
* A new $<TARGET_NAME_IF_EXISTS:...> generator expression has been added.
CTest
* The ctest_start() command has been reworked so that you can simply call
ctest_start(APPEND) and it will read all the needed information from the
TAG file. The argument parsing has also been relaxed so that the order of
the arguments is less significant.
* A PROCESSOR_AFFINITY test property was added to request that CTest run a
test with CPU affinity for a set of processors disjoint from other
concurrently running tests with the property set.
CPack
* The CPack module now uses variables CMAKE_PROJECT_VERSION_MAJOR,
CMAKE_PROJECT_VERSION_MINOR and CMAKE_PROJECT_VERSION_PATCH to initialize
corresponding CPack variables.
* cpack(1) gained basic support for NuGet. See the CPackNuGet module.
Other
* The Compile Features functionality is now aware of C++ 20. No specific
features are yet enumerated besides the cxx_std_20 meta-feature.
* The Compile Features functionality is now aware of the availability of C
features in MSVC since VS 2010.
* The Compile Features functionality is now aware of C language standards
supported by Texas Instruments C compilers.
Deprecated and Removed Features
* The Visual Studio 8 2005 generator has been removed.
* CMake no longer produces <tgt>_LIB_DEPENDS cache entries for library
targets. See policy CMP0073.
Other Changes
* Include flags for directories marked as SYSTEM are now moved after
non-system directories. The -isystem flag does this automatically, so
moving them explicitly to the end makes the behavior consistent on
compilers that do not have any -isystem flag.
* Fortran dependency scanning now supports dependencies implied by Fortran
Submodules.
* The existence and functionality of the file ${CMAKE_BINARY_DIR}/
cmake_install.cmake has now been documented in the install() documentation
so that external packaging software can take advantage of CPack-style
component installs.
* The CheckIncludeFile module check_include_file macro learned to honor the
CMAKE_REQUIRED_LIBRARIES variable. See policy CMP0075.
* The CheckIncludeFileCXX module check_include_file_cxx macro learned to
honor the CMAKE_REQUIRED_LIBRARIES variable. See policy CMP0075.
* The CheckIncludeFiles module check_include_files macro learned to honor the
CMAKE_REQUIRED_LIBRARIES variable. See policy CMP0075.
* The cmake(1) -E copy_directory tool now fails when the source directory
does not exist. Previously it succeeded by creating an empty destination
directory.
* The UseSWIG module swig_add_library() command (and legacy swig_add_module
command) now set the prefix of Java modules to "" for MINGW, MSYS, and
CYGWIN environments.
3.11.4:
Windows: Restore support for running CMake through a symlink
ExternalProject: Fix cache generation when args end with "-NOTFOUND"
ExternalProject: Improve URL_HASH argument description
Xcode 9.4 triggers linker warnings that the C++ feature detection
code considers fatal. Simply ignore these warning by adding an entry
to the existing filter table.
Changes in 3.11.3:
* cmSystemTools: Revert GetRealPath implementation on Windows
* CPack: Fix cross-compilation of WiX generator
* TestDriver: Replace strncpy with strcpy
3.11.2:
Ninja: Do not add empty custom command for file(GENERATE) outputs
C++ feature checks: Filter out warnings caused by local configuration
libuv: linux/sparc64: use fcntl to set and clear O_NONBLOCK
FindCUDA: Fix regression in separable compilation without cublas
FindBoost: Remove extra indentation in 1.65/1.66 dependency block
add_library: Restore error on alias of non-global imported target
add_custom_{command,target}: Fix crash on empty expanded command
CMake 3.11.2
IRSL: Fix Intel library list for ifort-only setups
InstallRequiredSystemLibraries: Check for existence of mfcm dlls
FindBoost: Backport versioned python dependencies for v1.35 to v1.66
Fix CMAKE_DISABLE_SOURCE_CHANGES recognition of top of build tree
FindJava, FindJNI, UseJava: update for version 10 support
FindJava, FindJNI: Ensure most recent version is searched first
FindJava, FindJNI: fix erroneous regex, enhance registry lookup
Help: Specify COMPILE_OPTIONS and COMPILE_FLAGS source properties
usage
Qt4Macros: Use get_property/set_property
Qt4Macros: Don't AUTOMOC or AUTOUIC qt4-generated files
FindPkgConfig: do not unset unused variable
FindBLAS: do not write an imported target name into BLAS_LIBRARIES
Autogen: Register generated dependency files
Changes in 3.11.1 since 3.11.0:
Revert "CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES"
CPack: Fix crash on invalid generator name
Restore support for explicitly referenced CMakeLists.txt sources
Exclude "libgcc_eh" library files from implicit link libraries
Features: Record for VS 2017 through 15.6
Explicitly require LibUV 1.10 or higher to build CMake
bootstrap: Add option to enable/disable usage of system libuv
Fix crash with --trace-expand --warn-uninitialized together
FindOpenMP: Fix support for Intel on Windows
Autogen: Protected calls to cmSystemTools::CollapseCombinedPath
Autogen: Protected calls to cmSystemTools::Split/JoinPath
Autogen: Protected calls to cmSystemTools::GetFilenameWithoutLastExtension
Autogen: Protected calls to cmQtAutoGen::SubDirPrefix
Autogen: Protected calls to cmFilePathChecksum
Autogen: Use std::istreambuf_iterator for file so string reading
Autogen: Print moc/uic/rcc output to stdout
With pkgsrc built packages, the goal is to have the user's compiler
optimization flags set by the user using CFLAGS, etc. To that end,
the cmake Makefile has subst.mk code to "sed -e 's,-O.,,'" out opt.
flags in Modules/Compiler/*.cmake for cmake compiles with the
CMAKE_BUILD_TYPE set (e.g. to Release).
Unfortunately, this sed-based approach has two drawbacks: First, it
gets applied to packages build with cmake outside of pkgsrc (changing
the semantics of -DCMAKE_BUILD_TYPE=Release in an unexpected way by
remove -O flags from it). Second, the sed expression damages some
of the Modules/Compiler/*.cmake as not all opt flags match the "-O."
regular expression.
To address this we:
1. remove the subst.mk sed operation on Modules/Compiler/*.cmake
2. add a new config variable CMAKE_PKGSRC_BUILD_FLAGS that should
be set for pkgsrc-based cmake builds (e.g. in mk/configure/cmake.mk)
3. we add a patch for Modules/Compiler/GNU.cmake to look for
CMAKE_PKGSRC_BUILD_FLAGS and choose a set of non-opt compiler
flags when this is set (to provide the desired behavior under pksrc).
note that the GNU.cmake file is also used by clang. We can
make the corresponding changes to other compilers if desired.
The result is that cmake compiles under pkgsrc set CMAKE_PKGSRC_BUILD_FLAGS
and follow CFLAGS, etc. (bypassing CMAKE_BUILD_TYPE), but cmake compiles
outside of pkgsrc follow the standard cmake semantics for CMAKE_BUILD_TYPE.
Also, we no longer damage Modules/Compiler/*.cmake with sed.
Some of the more significant changes in CMake 3.11 are:
The Makefile Generators and the “Ninja” generator learned to add
compiler launcher tools along with the compiler for the “Fortran”
language (“C”, “CXX”, and “CUDA” were supported previously). See the
“CMAKE_<LANG>_COMPILER_LAUNCHER” variable and
“<LANG>_COMPILER_LAUNCHER” target property for details.
Visual Studio Generators learned to support the “COMPILE_LANGUAGE”
“generator expression” in target-wide “COMPILE_DEFINITIONS”,
“INCLUDE_DIRECTORIES”, “COMPILE_OPTIONS”, and “file(GENERATE)”. See
generator expression documentation for caveats.
The “Xcode” Generator learned to support the “COMPILE_LANGUAGE”
“generator expression” in target-wide “COMPILE_DEFINITIONS” and
“INCLUDE_DIRECTORIES”. It previously supported only
“COMPILE_OPTIONS” and “file(GENERATE)”. See generator expression
documentation for caveats.
“add_library()” and “add_executable()” commands can now be called
without any sources and will not complain as long as sources are
added later via the “target_sources()” command.
The “target_compile_definitions()” command learned to set the
“INTERFACE_COMPILE_DEFINITIONS” property on Imported Targets.
The “target_compile_features()” command learned to set the
“INTERFACE_COMPILE_FEATURES” property on Imported Targets.
The “target_compile_options()” command learned to set the
“INTERFACE_COMPILE_OPTIONS” property on Imported Targets.
The “target_include_directories()” command learned to set the
“INTERFACE_INCLUDE_DIRECTORIES” property on Imported Targets.
The “target_sources()” command learned to set the
“INTERFACE_SOURCES” property on Imported Targets.
The “target_link_libraries()” command learned to set the
“INTERFACE_LINK_LIBRARIES” property on Imported Targets.
The “COMPILE_DEFINITIONS” source file property learned to support
“generator expressions”.
A “COMPILE_OPTIONS” source file property was added to manage list
of options to pass to the compiler.
When using “AUTOMOC” or “AUTOUIC”, CMake now starts multiple
parallel “moc” or “uic” processes to reduce the build time. A new
“CMAKE_AUTOGEN_PARALLEL” variable and “AUTOGEN_PARALLEL” target
property may be set to specify the number of parallel “moc” or “uic”
processes to start. The default is derived from the number of CPUs
on the host.
CMake 3.10.3
* GoogleTest: Rename TIMEOUT parameter to avoid clash
* Autogen: Fix for the empty source file crash in 3.10.2
* ccmake: fix status line buffer overflow on very wide terminals
Changes in 3.10.2:
KWIML: Backport RISC-V update to CMake 3.10
FindPostgreSQL: Add support for PG10
cmGraphVizWriter: Updated to create and follow dependers for interface targets
Autogen: Fix for problematic nested list separator
Autogen: Ignore not existing source files in cmMakefile
3.10.1:
bootstrap: Check support for unordered_map from compiler mode
CPack: Fix macOS PKG component dependency information
CUDA: Treat /usr/include as an implicit include directory
server: Revert "Report backtraces in codemodel response"
CMake 3.10.1
FindMPI: Correct legacy variable handling
FindMPI: Fix multiple configure runs
FindMPI: Fix various legacy problems
IRSL: Fix MSVC variable deferencing
IAR: FindBinUtils should work for CXX as well as C
GoogleTest: Fix multiple discovery on same target
GoogleTest: Improve gtest_discover_tests messages
GoogleTest: Add timeout to discovery
GoogleTest: Add test for missing test executable
CUDA: Shared libraries on Darwin properly setup @rpath install_names
Autogen: Fix for AUTOMOC on macOS frameworks in CMake 3.10
Autogen: Tests: Add test for MacOS frameworks
Clang: Do not mistake clang-cl 6.0 for GNU-like clang
CMake 3.10 are:
The flang Fortran compiler is now supported, with compiler id
“Flang”.
Support for the MSVC ARM64 architecture was added. Visual Studio
2017 Update 4 and above offer an ARM64 toolchain.
The “include_guard()” command was introduced to allow guarding
CMake scripts from being included more than once. The command
supports “DIRECTORY” and “GLOBAL” options to adjust the
corresponding include guard scope. If no options given, include
guard is similar to basic variable-based check.
“FindMPI” received a major overhaul. It now features language specific
components, better Fortran support, and support for statically linked
MPI implementations.
A “FindOpenACC” module was added to detect compiler support for
OpenACC. Currently only supports PGI, GNU and Cray compilers.
The “FindOpenGL” module underwent numerous improvements. It has gained
support for GLVND and EGL on Linux. It now has import targets that
separate the OpenGL library and OpenGL contexts.
The “GoogleTest” module gained a new command
“gtest_discover_tests()” implementing dynamic (build-time) test
discovery.
When using “AUTOMOC” or “AUTOUIC”, source files that are
“GENERATED” will be processed as well. They were ignored by
“AUTOMOC” and “AUTOUIC” in earlier releases. See policy “CMP0071”.
A “CTEST_LABELS_FOR_SUBPROJECTS” CTest module variable and CTest
script variable were added to specify a list of labels that should
be treated as subprojects by CDash. To use this value in both the
CTest module and the ctest command line Dashboard Client mode (e.g.
“ctest -S”) set it in the “CTestConfig.cmake” config file.
CPack gained a “FREEBSD” generator for FreeBSD “pkg(8)”,
configured by the “CPackFreeBSD” module.
The CPack “DEB” generator, configured by the “CPackDeb” module,
was enabled on Windows. While not fully featured (due to the lack
of external UNIX tools) this will allow building basic cross-
platform Debian packages.
The “cmake(1)” “-E” mode gained support for “sha1sum”,
“sha224sum”, “sha256sum”, “sha384sum”, and “sha512sum”.
The “file(GENERATE)” command now interprets relative paths given
to its “OUTPUT” and “INPUT” arguments with respect to the caller’s
current binary and source directories, respectively. See policy
“CMP0070”.