Changes made since CMake 2.8.12 include the following.
The CMake documentation has been converted to reStructuredText and now transforms via Sphinx (http://sphinx-doc.org) into man and html pages. This allows the documentation to be properly indexed and to contain cross-references.
Conversion from the old internal documentation format was done by an automatic process so some documents may still contain artifacts. They will be updated incrementally over time.
A basic reStructuredText processor has been implemented to support
cmake --help-commandand similar command-line options.
New manuals were added:
Release notes for CMake 3.0.0 and above will now be included with the html documentation.
set(x [===[bracket argument]===] #[[bracket comment]])
Content between equal-length open- and close-brackets is taken literally with no variable replacements.
This syntax change could not be made in a fully compatible way. No policy is possible because syntax parsing occurs before any chance to set a policy. Existing code using an unquoted argument that starts with an open bracket will be interpreted differently without any diagnostic. Fortunately the syntax is obscure enough that this problem is unlikely in practice.
add_library()command learned a new
INTERFACElibrary type. Interface libraries have no build rules but may have properties defining
usage requirementsand may be installed, exported, and imported. This is useful to create header-only libraries that have concrete link dependencies on other libraries.
export()command learned a new
EXPORTmode that retrieves the list of targets to export from an export set configured by the
EXPORToption. This makes it easy to export from the build tree the same targets that are exported from the install tree.
export()command learned to work with multiple dependent export sets, thus allowing multiple packages to be built and exported from a single tree. The feature requires CMake to wait until the generation step to write the output file. This means one should not
include()the generated targets file later during project configuration because it will not be available. Use Alias Targets instead. See policy
include_external_msproject()command learned to handle non-C++ projects like
ctest_update()command learned to update work trees managed by the Perforce (p4) version control tool.
message()command learned a
DEPRECATIONmode. Such messages are not issued by default, but may be issued as a warning if
CMAKE_WARN_DEPRECATEDis enabled, or as an error if
target_link_libraries()command now allows repeated use of the
CMAKE_FIND_NO_INSTALL_PREFIXhas been introduced to tell CMake not to add the value of
CMAKE_SYSTEM_PREFIX_PATHvariable by default. This is useful when building a project that installs some of its own dependencies to avoid finding files it is about to replace.
CMAKE_STAGING_PREFIXwas introduced for use when cross-compiling to specify an installation prefix on the host system that differs from a
CMAKE_INSTALL_PREFIXvalue meant for the target system.
CMAKE_SYSROOTwas introduced to specify the toolchain SDK installation prefix, typically for cross-compiling. This is used to pass a
--sysrootoption to the compiler and as a prefix searched by
CMAKE_<LANG>_COMPILER_TARGETwas introduced for use when cross-compiling to specify the target platform in the toolchain file specified by the
CMAKE_TOOLCHAIN_FILEvariable. This is used to pass an option such as
--target=<triple>to some cross-compiling compiler drivers.
A new directory property
CMAKE_CONFIGURE_DEPENDSwas introduced to allow projects to specify additional files on which the configuration process depends. CMake will re-run at build time when one of these files is modified. Previously this was only possible to achieve by specifying such files as the input to a
A new AUTORCC feature replaces the need to invoke
.qrcfiles to be listed as target sources.
A new AUTOUIC feature replaces the need to invoke
SKIP_RETURN_CODEtest property was introduced to tell
ctest(1)to treat a particular test return code as if the test were not run. This is useful for test drivers to report that certain test requirements were not available.
New types of Compatible Interface Properties were introduced, namely the
COMPATIBLE_INTERFACE_NUMBER_MINfor calculating numeric maximum and minimum values respectively.
ExternalDatamodule learned to work with no URL templates if a local store is available.
ExternalProject_Addlearned a new
GIT_SUBMODULESoption to specify a subset of available submodules to checkout.
FindBoostmodule learned a new
Boost_NAMESPACEoption to change the
boostprefix on library names.
FindBoostmodule learned to control search for libraries with the
gtag (for MS debug runtime) with a new
Boost_USE_DEBUG_RUNTIMEoption. It is
ONby default to preserve existing behavior.
add_jarfunction learned a new
MANIFESToption to pass the
CMakeFindDependencyMacromodule was introduced with a
find_dependencymacro to find transitive dependencies in a
package configuration file. Such dependencies are omitted by the listing of the
FindRubymodule learned to search for Ruby 2.0 and 2.1.
generator expressionshave been added.
generator expressionnow has a variant which takes no argument. This is equivalent to the
generator expressionsgenerator expressions have been added.
generator expressionhas been added.
-Eoption learned a new
cmake-gui(1)dialog learned to remember window settings between sessions.
cmake-gui(1)dialog learned to remember the type of a cache entry for completion in the
Directories named in the
INTERFACE_INCLUDE_DIRECTORIEStarget property of imported targets linked conditionally by a
generator expressionwere not checked for existence. Now they are checked. See policy
Build target names must now match a validity pattern and may no longer conflict with CMake-defined targets. See policy
Build targets that specify themselves as a link dependency were silently accepted but are now diagnosed. See
Link dependency analysis learned to assume names containing
::refer to Alias Targets or Imported Targets. It will now produce an error if such a linked target is missing. Previously in this case CMake generated a link line that failed at build time. See policy
enable_language()commands initialize support for a language, it is now an error if the full path to the compiler cannot be found and stored in the corresponding
CMAKE_<LANG>_COMPILERvariable. This produces nicer error messages up front and stops processing when no working compiler is known to be available.
Compatibility options supporting code written for CMake versions prior to 2.4 have been removed.
Several long-outdated commands that should no longer be called have been disallowed in new code by policies:
The builtin documentation formatters that supported command-line options such as
--help-htmlhave been removed in favor of the above-mentioned new documentation system. These and other command-line options that used to generate man- and html- formatted pages no longer work. The
--help-custom-modulesoption now produces a warning at runtime and generates a minimal document that reports the limitation.
COMPILE_DEFINITIONS_<CONFIG>directory properties and the
COMPILE_DEFINITIONS_<CONFIG>target properties have been deprecated. Instead set the corresponding
COMPILE_DEFINITIONSdirectory property or
COMPILE_DEFINITIONStarget property and use
$<CONFIG:...>to specify per-configuration definitions. See policy
LOCATIONtarget property should no longer be read from non-IMPORTED targets. It does not make sense in multi-configuration generators since the build configuration is not known while configuring the project. It has been superseded by the
$<TARGET_FILE>generator expression. See policy
The version scheme was changed to use only two components for the feature level instead of three. The third component will now be used for bug-fix releases or the date of development versions. See the
CMAKE_VERSIONvariable documentation for details.
The default install locations of CMake itself on Windows and OS X no longer contain the CMake version number. This allows for easy replacement without re-generating local build trees manually.
Generators for Visual Studio 10 (2010) and later were renamed to include the product year like generators for older VS versions:
Visual Studio 10->
Visual Studio 10 2010
Visual Studio 11->
Visual Studio 11 2012
Visual Studio 12->
Visual Studio 12 2013
This clarifies which generator goes with each Visual Studio version. The old names are recognized for compatibility.
On 64-bit OS X the
CMAKE_HOST_SYSTEM_PROCESSORvalue is now correctly detected as
build_command()command now returns a
--buildcommand line instead of a direct invocation of the native build tool. When using
Visual Studiogenerators, CMake and CTest no longer require
CMAKE_MAKE_PROGRAMto be located up front. Selection of the proper msbuild or devenv tool is now performed as late as possible when the solution (
.sln) file is available so it can depend on project content.
--buildcommand now shares its own stdout and stderr pipes with the native build tool by default. The
--use-stderroption that once activated this is now ignored.
generator expressionsused to perform case-insensitive comparison but have now been corrected to perform case-sensitive comparison. See policy
edit_cachetarget will no longer select
ccmake(1)by default when no interactive terminal will be available (e.g. with
Ninjaor an IDE generator). Instead
cmake-gui(1)will be preferred if available.
ExternalProjectdownload step learned to re-attempt download in certain cases to be more robust to temporary network failure.
FeatureSummaryno longer lists transitive dependencies since they were not directly requested by the current project.
cmake-mode.elmajor Emacs editing mode has been cleaned up and enhanced in several ways.