html
Changes made since CMake 3.7 include the following.
CMake learned to support CSharp
(C#) as a first-class language that can be enabled via the project
and enable_language
commands. It is currently supported by the Visual Studio Generators
for VS 2010 and above.
C# assemblies and programs can be added just like common C++ targets using the add_library
and add_executable
commands. References between C# targets in the same source tree may be specified by target_link_libraries
like for C++. References to system or 3rd-party assemblies may be specified by the target properties :prop_tgt:VS_DOTNET_REFERENCE_<refname> and :prop_tgt:VS_DOTNET_REFERENCES.
More fine tuning of C# targets may be done using target and source file properties. Specifically the target properties related to Visual Studio (VS_*
) are worth a look (for setting toolset versions, root namespaces, assembly icons, ...).
CUDA
as a first-class language that can be enabled via the project
and enable_language
commands.CUDA
is currently supported by the Makefile Generators
and the Ninja
generator on Linux, macOS, and Windows. Support for the Visual Studio IDE is under development but not included in this release.nvcc
) is supported.Compile Features <cmake-compile-features(7)>
functionality now offers meta-features that request compiler modes for specific language standard levels (e.g. cxx_std_11
). See :prop_gbl:CMAKE_C_KNOWN_FEATURES and :prop_gbl:CMAKE_CXX_KNOWN_FEATURES.Compile Features <cmake-compile-features(7)>
functionality is now aware of C++ 17. No specific features are yet enumerated besides the cxx_std_17
meta-feature.Compile Features <cmake-compile-features(7)>
functionality is now aware of the availability of C99 in gcc since version 3.4.Fuchsia
was added.CodeBlocks
extra generator may now be used to generate with NMake Makefiles JOM
.Visual Studio Generators
for VS 2013 and above learned to support a host=x64
option in the CMAKE_GENERATOR_TOOLSET
value (e.g. via the cmake(1)
-T
option) to request use of a VS 64-bit toolchain on 64-bit hosts.Visual Studio Generators
learned to treat files passed to target_link_libraries
whose names end in .targets
as MSBuild "targets" files to be imported into generated project files.add_custom_command
and add_custom_target
commands learned the option COMMAND_EXPAND_LISTS
which causes lists in the COMMAND
argument to be expanded, including lists created by generator expressions.execute_process
command gained an ENCODING
option to specify on Windows which encoding is used for output from child process.math(EXPR)
command gained support for unary +
and -
operators.source_group
command gained TREE
and PREFIX
options to add groups following source tree directory structure.string(TIMESTAMP)
command learned to treat %%
as a way to encode plain %
.string(TIMESTAMP)
command will now honor the SOURCE_DATE_EPOCH
environment variable and use its value instead of the current time.try_compile
command source file signature gained new options to specify the language standard to use in the generated test project.try_compile
command source file signature now honors language standard variables like CMAKE_CXX_STANDARD
. See policy CMP0067
.CMAKE_CODELITE_USE_TARGETS
variable was added to tell the CodeLite
extra generator to change the generated project to have target-centric organization. The build
, rebuild
, and clean
operations within CodeLite
then work on a selected target rather than the whole workspace. (Note that the Ninja
clean operation on a target includes its dependencies, though.)CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS
variable was added to tell the Sublime Text 2
extra generator to place specified environment variables in the generated .sublime-project
.CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE
variable was added to tell the Sublime Text 2
extra generator whether to exclude the build tree from the .sublime-project
when it is inside the source tree.CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD
variable was added to tell Visual Studio Generators
for VS 2010 and above to include the PACKAGE
target in the default build, similar to the existing CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
variable for the INSTALL
target.CMAKE_BUILD_RPATH
variable were added to support custom RPATH
locations to be added to binaries in the build tree.generator expressions <cmake-generator-expressions(7)>
.Imported <Imported Targets>
Interface Libraries
learned new :prop_tgt:IMPORTED_LIBNAME and :prop_tgt:IMPORTED_LIBNAME_<CONFIG> target properties to specify a link library name since interface libraries do not build their own library files.CMAKE_<LANG>_CPPLINT
variable were introduced to tell the Makefile Generators
and the Ninja
generator to run the cpplint
style checker along with the compiler for C
and CXX
languages.add_dependencies
command.Imported <Imported Targets>
Interface Libraries
.Visual Studio Generators
for VS 2010 and above whether or not a file should e copied to the output directory.Visual Studio Generators
for VS 2010 and above what debugger working directory should be set for the target.Visual Studio Generators
for VS 2010 and above to add a .NET reference with a given hint path.Visual Studio Generators
for VS 2010 and above whether to include the file in a Visual Studio extension package.Visual Studio Generators
for VS 2010 and above a setting for the resource generator (C#
only).Visual Studio Generators
for VS 2010 and above to use a custom MSBuild user .props
file.Xcode
generator whether to emit the EFFECTIVE_PLATFORM_NAME
variable. This is useful when building with multiple SDKs like macosx
and iphoneos
in parallel.Xcode
generator to use custom values of the corresponding attributes for a target in the generated Xcode project.CSharpUtilities
module was added to aid parameterization of Visual Studio C# targets. It provides functions to allow automated setting of source file properties to support Windows Forms, WPF/XAML or other technologies as needed.ExternalData
module learned to support multiple content links for one data file using different hashes, e.g. img.png.sha256
and img.png.sha1
. This allows objects to be fetched from sources indexed by different hash algorithms.ExternalProject
module gained the GIT_PROGRESS
option to force Git to show progress when cloning repositories.ExternalProject
module gained a GIT_CONFIG
option to pass --config
options to Git when cloning repositories.FeatureSummary
module feature_summary
command now accepts a new QUIET_ON_EMPTY
option that suppresses the output when the list of packages that belong to the selected category is empty.FeatureSummary
module add_feature_info
command now accepts lists of dependencies for deciding whether a feature is enabled or not.FeatureSummary
module can now be tweaked by changing the FeatureSummary_PKG_TYPES
, FeatureSummary_REQUIRED_PKG_TYPES
and FeatureSummary_DEFAULT_PKG_TYPE
global properties.FindOpenGL
module now provides imported targets OpenGL::GL
and OpenGL::GLU
when the libraries are found.UseSWIG
module gained a swig_add_library
command to give more flexibility over the old swig_add_module
command.UseSWIG
module swig_add_source_to_module
command learned a new SWIG_OUTFILE_DIR
option to control the output file location (swig -o
).WriteCompilerDetectionHeader
module gained the ALLOW_UNKNOWN_COMPILERS
and ALLOW_UNKNOWN_COMPILER_VERSIONS
options that allow creation of headers that will work also with unknown or old compilers by simply assuming they do not support any of the requested features.ctest_memcheck
command gained a DEFECT_COUNT <var>
option to capture the number of memory defects detected.ctest_memcheck
command learned to read the location of suppressions files for sanitizers from the CTEST_MEMORYCHECK_SUPPRESSIONS_FILE
variable.ctest_memcheck
command learned to support LeakSanitizer
independently from AddressSanitizer
.ctest_update
command CDASH_UPLOAD
signature was taught to honor the RETRY_COUNT
, RETRY_DELAY
, and QUIET
options.CPackIFWConfigureFile
module was added to define a new cpack_ifw_configure_file
command to configure file templates prepared in QtIFW/SDK/Creator style.CPackIFW
module cpack_ifw_configure_component
and cpack_ifw_configure_component_group
commands gained a new DEFAULT
, VIRTUAL
, FORCED_INSTALLATION
, REQUIRES_ADMIN_RIGHTS
, DISPLAY_NAME
, UPDATE_TEXT
, DESCRIPTION
, RELEASE_DATE
, AUTO_DEPEND_ON
and TRANSLATIONS
options to more specific configuration.CPackIFW
module cpack_ifw_configure_component
command gained a new DEPENDENCIES
alias for DEPENDS
option.CPackIFW
module cpack_ifw_configure_component_group
command gained a new DEPENDS
option. The DEPENDENCIES
alias also added.CPackIFW
module cpack_ifw_configure_component
and cpack_ifw_configure_component_group
commands PRIORITY
option now is deprecated and will be removed in a future version of CMake. Please use new SORTING_PRIORITY
option instead.CPACK_IFW_PACKAGE_WATERMARK
, CPACK_IFW_PACKAGE_BANNER
, CPACK_IFW_PACKAGE_BACKGROUND
, CPACK_IFW_PACKAGE_WIZARD_STYLE
, CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
, CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT
, and CPACK_IFW_PACKAGE_TITLE_COLOR
variables to customize a QtIFW installer look.CPACK_PRODUCTBUILD_IDENTITY_NAME
, CPACK_PRODUCTBUILD_KEYCHAIN_PATH
, CPACK_PKGBUILD_IDENTITY_NAME
, and CPACK_PKGBUILD_KEYCHAIN_PATH
.rpmbuild
tool. If unsupported tags are set they are ignored and a developer warning is printed out.CPACK_RPM_MAIN_COMPONENT
variable.debuginfo
package on demand even if components packaging is used. See CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE
variable.CPACK_RPM_USER_FILELIST
variable.$<IF:cond,true-value,false-value>
was added. It resolves to the true-value if the condition is 1
and resolves to the false-value if the condition is 0
.FeatureSummary
module commands set_package_info
, set_feature_info
, print_enabled_features
, and print_disabled_features
are now deprecated.UseSWIG
module swig_add_module
command is now deprecated in favor of swig_add_library
.ctest_memcheck
command no longer automatically adds leak_check=1
to the options used by AddressSanitizer
. The default behavior of AddressSanitizer
is to run LeakSanitizer to check leaks unless leak_check=0
.ctest_memcheck
command was fixed to correctly append extra sanitizer options read from the CTEST_MEMORYCHECK_SANITIZER_OPTIONS
variable to the environment variables used internally by the sanitizers.FeatureSummary
module set_package_properties
command no longer forces the package type to OPTIONAL
when the type is not explicitly set.Compile Features <cmake-compile-features(7)>
functionality is now aware of features supported by Intel C++ compilers versions 12.1 through 17.0 on UNIX and Windows platforms.FindPkgConfig
module pkg_check_modules
command following a successful call learned to re-evaluate the cached values for a given prefix after changes to the parameters to the command for that prefix.moc_*
, *.moc
and ui_*
are placed in the <CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/include
directory which is automatically added to the target's :prop_tgt:INCLUDE_DIRECTORIES. It is therefore not necessary anymore to have CMAKE_CURRENT_BINARY_DIR
in the target's :prop_tgt:INCLUDE_DIRECTORIES.Sublime Text 2
generator no longer runs the native build command (e.g. ninja
or make
) with verbose build output enabled.try_compile
command source file signature now honors the CMAKE_WARN_DEPRECATED
variable value in the generated test project.Visual Studio Generators
for VS 2010 and above now place per-source file flags after target-wide flags when they are classified as raw flags with no project file setting (AdditionalOptions
). This behavior is more consistent with the ordering of flags produced by other generators, and allows flags on more-specific properties (per-source) to override those on more general ones (per-target).cmake.org
now records the installation directory in the Windows Registry under the key HKLM\Software\Kitware\CMake
with a value named InstallDir
.