Changes made since CMake 3.8 include the following.
CUDAis now supported by the Visual Studio Generators for VS 2010 and above. This complements the existing support by the Makefile Generators and the
Ninjagenerator. CUDA 8.0.61 or higher is recommended due to known bugs in the VS integration by earlier versions.
separate_arguments()command gained a
NATIVE_COMMANDmode that performs argument separation depending on the host operating system.
CMAKE_ANDROID_NDK_DEPRECATED_HEADERSvariable was added for use when Cross Compiling for Android with the NDK to request use of the deprecated headers even when unified headers are available. The default is now to use unified headers if available.
CMAKE_<LANG>_COMPILER_ARvariable was added to hold the path to the GCC/Clang wrapper of
CMAKE_<LANG>_COMPILER_RANLIBvariable was added to hold the path to the GCC/Clang wrapper of
BUILD_WITH_INSTALL_NAME_DIRtarget property and corresponding
CMAKE_BUILD_WITH_INSTALL_NAME_DIRvariable were added to control whether to use the
INSTALL_NAME_DIRtarget property value for binaries in the build tree. This is for macOS
INTERPROCEDURAL_OPTIMIZATIONtarget property is now enforced when enabled. CMake will add IPO flags unconditionally or produce an error if it does not know the flags for the current compiler. The project is now responsible to use the
CheckIPOSupportedmodule to check for IPO support before enabling the target property. See policy
WINDOWS_EXPORT_ALL_SYMBOLStarget property may now be used in combination with explicit
.deffiles in order to export all symbols from the object files within a target plus an explicit list of symbols that the linker finds in dependencies (e.g.
CheckIPOSupportedmodule was added to help projects check whether interprocedural optimization (IPO) is supported by the current toolchain and CMake version.
find_dependencymacro now forwards all arguments to the underlying
find_package()call. Existing uses will continue to function as before, but callers can now access the full suite of arguments that
FeatureSummarymodule gained a new
FeatureSummary_<TYPE>_DESCRIPTIONvariable that can be defined for each
<TYPE>to replace the type name with the specified string whenever the package type is used in an output string by the module.
FindDoxygenmodule learned to control Doxygen behavior using CMake variables and generate documentation via the newly added
doxygen_add_docs()function. The Doxygen input file (
Doxyfile) is automatically generated and doxygen is run as part of a custom target. Additional components can be specified to find optional tools:
FindMPImodule now provides imported targets.
FindProtobufmodule now supports usage of static libraries for Unix via a new
FindProtobufmodule now provides imported targets when the libraries are found.
GoogleTestmodule was added to provide the
gtest_add_tests()function independently of the
FindGTestmodule. The function was also updated to support keyword arguments, with functionality expanded to allow a test name prefix and suffix to be specified, the dependency on the source files to be optional and the list of discovered test cases to be returned to the caller.
ctest_submit()command gained a
HTTPHEADERoption to specify custom headers to send during submission.
ctest(1)executable gained new options which allow the developer to disable automatically adding tests to the test set to satisfy fixture dependencies.
-FSprevents adding setup tests for fixtures matching the provided regular expression,
-FCprevents adding cleanup tests for matching fixtures and
-FAprevents adding any test for matching fixtures.
DISABLEDtest property was added to mark tests that are configured but explicitly disabled so they do not run.
CPack WIX Generatorpatching system now has the ability to set additional attributes. This can be done by specifying attributes with the
CPackWiXFragmentXML tag after the
Idattribute. See the
Interprocedural optimization (IPO) is now supported for GNU and Clang compilers using link time optimization (LTO) flags. See the
INTERPROCEDURAL_OPTIMIZATIONtarget property and
Two new informational generator expressions to retrieve Apple Bundle directories have been added. The first one
$<TARGET_BUNDLE_DIR:tgt>outputs the full path to the Bundle directory, the other one
$<TARGET_BUNDLE_CONTENT_DIR:tgt>outputs the full path to the
Contentsdirectory of macOS Bundles and App Bundles. For all other bundle types and SDKs it is identical with
$<TARGET_BUNDLE_DIR:tgt>. The new expressions are helpful to query Bundle locations independent of the different Bundle types and layouts on macOS and iOS.
An explicit deprecation diagnostic was added for policies
CMP0036and below. The
cmake-policies(7)manual explains that the OLD behaviors of all policies are deprecated and that projects should always port to the NEW behaviors as soon as possible.
Visual Studio 8 2005generator is now deprecated and will be removed in a future version of CMake.
Visual Studio 7 .NET 2003generator has been removed.
Xcodegenerator dropped support for Xcode versions older than 3.
FindDoxygenmodule has deprecated several variables.
The version of curl bundled with CMake no longer accepts URLs of the form
file://c:/...on Windows due to a change in upstream curl 7.52. Use the form
file:///c:/...instead to work on all versions.
AUTOMOC, CMake now scans for the presence of the
Q_PLUGIN_METADATAmacro and reruns moc when the file from the macro's
When running tests, CTest learned to treat skipped tests (using the
SKIP_RETURN_CODEproperty) the same as tests with the new
DISABLEDproperty. Due to this change, CTest will not indicate failure when all tests are either skipped or pass.
Ninjagenerator has loosened the dependencies of object compilation. Object compilation now depends only on custom targets and custom commands associated with libraries on which the object's target depends and no longer depends on the libraries themselves. Source files in dependent targets may now compile without waiting for their targets' dependencies to link.
Visual Studio 14 2015generator has been taught about a change to the
v140toolset made by a VS 2015 update. VS changed the set of values it understands for the
GenerateDebugInformationlinker setting that produces the
-DEBUGlinker flag variants.
Changes made since CMake 3.9.0 include the following.
PACKAGE_ROOTsearch path group added by CMake 3.9.0 has been removed for the 3.9 series due to regressions caused by new use of
<PackageName>_ROOTvariables. The behavior may be re-introduced in the future in a more-compatible way.
On macOS, the default application bundle
Info.plistfile no longer enables Hi-DPI support as it did in 3.9.0 and 3.9.1. The change had to be reverted because it broke iOS applications.
The Xcode generator no longer adds "outputPaths" to custom script build phases as it did in 3.9.0 and 3.9.1. This was added in an attempt to support Xcode 9's new build system, but broke incremental rebuilds for both the old and new Xcode build systems.